From 8a2dfbcb11bd09dab998a6b81e8c7407a3c4c42a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 23 Mar 2008 00:51:29 +0000 Subject: 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 --- crawl-ref/source/database.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crawl-ref/source/database.h') 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 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 getLongDescKeysByRegex(const std::string ®ex, db_find_filter filter = NULL); -- cgit v1.2.3-54-g00ecf