From 8b989e877550fcc89c79e06905a2128537a852f0 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 22 Apr 2008 19:40:42 +0000 Subject: Modify descriptions of artefact-capable items to allow for unquoted 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 --- crawl-ref/source/dat/descript/items.txt | 16 ++++++++++++++++ crawl-ref/source/database.cc | 8 +++++++- crawl-ref/source/database.h | 5 +++-- crawl-ref/source/describe.cc | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/dat/descript/items.txt b/crawl-ref/source/dat/descript/items.txt index fec7e1ab3e..c1d3cd2aab 100644 --- a/crawl-ref/source/dat/descript/items.txt +++ b/crawl-ref/source/dat/descript/items.txt @@ -412,6 +412,10 @@ chunk of flesh A piece of meat found in the dungeon. %%%% +cloak noquote + +A cloth cloak. +%%%% cloak A cloth cloak. @@ -426,6 +430,10 @@ A cloth cloak. For I'll have a new cloak about me." -Anonymous, "The Old Cloak". 16th Century. %%%% +club noquote + +A heavy piece of wood. +%%%% club A heavy piece of wood. @@ -467,6 +475,10 @@ crystal plate mail An incredibly heavy but extremely effective suit of crystalline armour. It is somewhat resistant to corrosion. %%%% +dagger noquote + +A long knife or a very short sword, which can be held or thrown. +%%%% dagger A long knife or a very short sword, which can be held or thrown. @@ -755,6 +767,10 @@ lemon A yellow fruit. %%%% +long sword noquote + +A sword with a long, slashing blade. +%%%% long sword A sword with a long, slashing blade. diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc index af43a29c76..140051b4db 100644 --- a/crawl-ref/source/database.cc +++ b/crawl-ref/source/database.cc @@ -591,11 +591,17 @@ static std::string _query_database(DBM *db, std::string key, ///////////////////////////////////////////////////////////////////////////// // Description DB specific functions. -std::string getLongDescription(const std::string &key) +std::string getLongDescription(const std::string &key, bool noquote) { if (!DescriptionDB.get()) return (""); + if (noquote) + { + return _query_database(DescriptionDB.get(), key + " noquote", + true, true); + } + return _query_database(DescriptionDB.get(), key, true, true); } diff --git a/crawl-ref/source/database.h b/crawl-ref/source/database.h index 8be7ed8ccc..c48c863a37 100644 --- a/crawl-ref/source/database.h +++ b/crawl-ref/source/database.h @@ -50,8 +50,9 @@ std::vector database_find_bodies(DBM *database, std::string getWeightedSpeechString(const std::string &key, const std::string &suffix, const int weight = -1); - -std::string getLongDescription(const std::string &key); + +std::string getLongDescription(const std::string &key, + bool noquote = false); std::vector getLongDescKeysByRegex(const std::string ®ex, db_find_filter filter = NULL); std::vector getLongDescBodiesByRegex(const std::string ®ex, diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 6c48fc1cee..1d56a276b2 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1566,7 +1566,7 @@ std::string get_item_description( const item_def &item, bool verbose, { description << "$$"; std::string db_name = item.name(DESC_DBNAME, true, false, false); - std::string db_desc = getLongDescription(db_name); + std::string db_desc = getLongDescription(db_name, is_artefact(item)); if (db_desc == "") { -- cgit v1.2.3-54-g00ecf