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>2008-09-27 22:57:53 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-27 22:57:53 +0000
commite1862125ea4fce442dd14faf3c1668a866876964 (patch)
tree00af2a10a40fb00cc932521dabc8692724ec1598 /crawl-ref/source/command.cc
parent1e9759d7afc0d4b75b3d5a3c7af2adebf99c99ab (diff)
downloadcrawl-ref-e1862125ea4fce442dd14faf3c1668a866876964.tar.gz
crawl-ref-e1862125ea4fce442dd14faf3c1668a866876964.zip
Implement the first part of FR 2055862: Make the database search also
output AC/EV and damage/accuracy/speed for armour and weapons, respectively. Also, you can now wish for specific fixed and randarts in wizard mode via the 'o' command. (I was getting annoyed at always having to create all of them whenever I wanted to play around with the Singing Sword.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7048 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r--crawl-ref/source/command.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 49241aea20..94eafa6827 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -21,6 +21,7 @@
#include "chardump.h"
#include "cio.h"
#include "database.h"
+#include "debug.h"
#include "describe.h"
#include "files.h"
#include "initfile.h"
@@ -1191,6 +1192,28 @@ static bool _do_description(std::string key, std::string footer = "")
suffix += getLongDescription(symbol_suffix + "_lookup");
quote += getQuoteString(symbol_suffix);
}
+ else
+ {
+ int thing_created = get_item_slot();
+ if (thing_created != NON_ITEM)
+ {
+ char name[80];
+ snprintf(name, 80, key.c_str());
+ if (get_item_by_name(&mitm[thing_created], name, OBJ_WEAPONS))
+ {
+ append_weapon_stats(desc, mitm[thing_created]);
+ desc += "$";
+ }
+ else if (get_item_by_name(&mitm[thing_created], name, OBJ_ARMOUR))
+ {
+ append_armour_stats(desc, mitm[thing_created]);
+ desc += "$";
+ }
+
+ // Now we don't need the item anymore.
+ destroy_item(thing_created);
+ }
+ }
}
key = uppercase_first(key);