summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/command.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-15 16:25:56 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-15 16:25:56 +0000
commitb0e7dda3593b5e6022799727f3eb177fae3a5987 (patch)
tree4d87a243e4c1ac9c80c2c847751a668d3d66285e /crawl-ref/source/command.cc
parent66a704276821c4400a67aede782c580e1992bddd (diff)
downloadcrawl-ref-b0e7dda3593b5e6022799727f3eb177fae3a5987.tar.gz
crawl-ref-b0e7dda3593b5e6022799727f3eb177fae3a5987.zip
* Tweak shop command help for Tiles.
* Hook card descriptions into database. This is far from optimal at the moment, e.g. searching for the portal card returns the Portal spell as best match. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9497 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r--crawl-ref/source/command.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 6dec8688a0..f758fd84bc 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -24,6 +24,7 @@ REVISION("$Rev$");
#include "cio.h"
#include "database.h"
#include "debug.h"
+#include "decks.h"
#include "describe.h"
#include "files.h"
#include "initfile.h"
@@ -1108,6 +1109,20 @@ static bool _feature_filter(std::string key, std::string body)
return (feat_by_desc(key) == DNGN_UNSEEN);
}
+static bool _card_filter(std::string key, std::string body)
+{
+ key = lowercase_string(key);
+ std::string name;
+ for (int i = 0; i < NUM_CARDS; ++i)
+ {
+ name = lowercase_string(card_name((card_type) i));
+
+ if (name.find(key) != std::string::npos)
+ return (false);
+ }
+ return (true);
+}
+
typedef void (*db_keys_recap)(std::vector<std::string>&);
static void _recap_mon_keys(std::vector<std::string> &keys)
@@ -1459,8 +1474,8 @@ static bool _find_description(bool &again, std::string& error_inout)
if (!error_inout.empty())
mpr(error_inout.c_str(), MSGCH_PROMPT);
- mpr("Describe a (M)onster, (S)pell, s(K)ill, (I)tem, (F)eature, (G)od "
- "or (B)ranch?", MSGCH_PROMPT);
+ mpr("Describe a (M)onster, (S)pell, s(K)ill, (I)tem, (F)eature, (G)od, "
+ "(B)ranch, or (C)ard?", MSGCH_PROMPT);
int ch = toupper(getch());
std::string type;
@@ -1493,6 +1508,10 @@ static bool _find_description(bool &again, std::string& error_inout)
type = "skill";
filter = _skill_filter;
break;
+ case 'C':
+ type = "card";
+ filter = _card_filter;
+ break;
case 'I':
type = "item";
extra = " Enter a single letter to list items displayed by "