summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.h
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-23 00:51:29 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-23 00:51:29 +0000
commit8a2dfbcb11bd09dab998a6b81e8c7407a3c4c42a (patch)
tree3df55b11e9678b3754feb19b6307301cb7ec660e /crawl-ref/source/database.h
parent435e410c4c086fa96d6068c1f7da3bd7f16f7a1c (diff)
downloadcrawl-ref-8a2dfbcb11bd09dab998a6b81e8c7407a3c4c42a.tar.gz
crawl-ref-8a2dfbcb11bd09dab998a6b81e8c7407a3c4c42a.zip
Modify database lookup to allow for lookup of the nth entry for a
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
Diffstat (limited to 'crawl-ref/source/database.h')
-rw-r--r--crawl-ref/source/database.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/database.h b/crawl-ref/source/database.h
index b335af9699..8be7ed8ccc 100644
--- a/crawl-ref/source/database.h
+++ b/crawl-ref/source/database.h
@@ -46,6 +46,11 @@ std::vector<std::string> database_find_bodies(DBM *database,
bool ignore_case = false,
db_find_filter filter = NULL);
+
+std::string getWeightedSpeechString(const std::string &key,
+ const std::string &suffix,
+ const int weight = -1);
+
std::string getLongDescription(const std::string &key);
std::vector<std::string> getLongDescKeysByRegex(const std::string &regex,
db_find_filter filter = NULL);