summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-01 01:35:07 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-01 01:35:07 +0000
commit62d953c65b657eca6880483b8b4382aba66e45ac (patch)
treef01204e0de88863c50efea0e95ca373ad3782274 /crawl-ref/source/database.cc
parentf81059ebbd6926656378e2f7d85a61e3bdc714c8 (diff)
downloadcrawl-ref-62d953c65b657eca6880483b8b4382aba66e45ac.tar.gz
crawl-ref-62d953c65b657eca6880483b8b4382aba66e45ac.zip
Lowercase the last of the the miscellaneous names text, and move it out
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
Diffstat (limited to 'crawl-ref/source/database.cc')
-rw-r--r--crawl-ref/source/database.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc
index af4b9b90e1..c949606788 100644
--- a/crawl-ref/source/database.cc
+++ b/crawl-ref/source/database.cc
@@ -74,8 +74,6 @@ static TextDB AllDBs[] =
"database/rand_all.txt", // jewellery and general
// This doesn't really belong here, but they *are* god gifts...
"database/monname.txt", // orcish names for Beogh to choose from
- // This doesn't really belong here, but *can* be used by randarts...
- "database/miscname.txt", // names for miscellaneous things
NULL),
TextDB( "db/speak",
@@ -93,6 +91,10 @@ static TextDB AllDBs[] =
TextDB( "db/help",
"database/help.txt",
NULL),
+
+ TextDB( "db/misc",
+ "database/miscname.txt", // names for miscellaneous things
+ NULL),
};
static TextDB& DescriptionDB = AllDBs[0];
@@ -100,6 +102,7 @@ static TextDB& RandartDB = AllDBs[1];
static TextDB& SpeakDB = AllDBs[2];
static TextDB& ShoutDB = AllDBs[3];
static TextDB& HelpDB = AllDBs[4];
+static TextDB& MiscDB = AllDBs[5];
// ----------------------------------------------------------------------
// TextDB
@@ -683,3 +686,18 @@ std::string getHelpString(const std::string &topic)
{
return _query_database(HelpDB.get(), topic, false, true);
}
+
+/////////////////////////////////////////////////////////////////////////////
+// Miscellaneous DB specific functions.
+
+std::string getMiscString(const std::string &misc,
+ const std::string &suffix)
+
+{
+ if (!MiscDB)
+ return ("");
+
+ int num_replacements = 0;
+
+ return _getRandomizedStr(MiscDB, misc, suffix, num_replacements);
+}