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-01-11 13:50:07 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-11 13:50:07 +0000
commitd90612ecda4f3088e903280024b9aaf6a8279b8f (patch)
treea47f2bf9bf939818f595e4b268e2af095eb19dce /crawl-ref/source/command.cc
parent6b7d71f720060c2023960aa7ab716063630d8332 (diff)
downloadcrawl-ref-d90612ecda4f3088e903280024b9aaf6a8279b8f.tar.gz
crawl-ref-d90612ecda4f3088e903280024b9aaf6a8279b8f.zip
Extend on Haran's monster resistance description. Thanks, Haran! :)
Now lists: * all resistances on one line, sorted by resistance level. * susceptibility * magic immunity * see/sense invisible * monster speed * flying/levitating An example output: A fire vortex A swirling cloud of flame. It is extremely resistant to fire, very resistant to electricity, and resistant to poison. It is susceptible to cold. It is immune to magical enchantments. It is fast. It can levitate. I also removed all those symbol/quote/etc. checks from the database lookup. Instead describe_monster() is now called directly, so the descriptions are now identical when (v)iewing a monster and when searching the database. In other news, I removed Eringya's Surprising Bouquet since I doubt we'll ever get it implemented, disagree balance-wise, and it was shamelessly nicked from Pratchett in the first place. Breaks saves. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8411 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r--crawl-ref/source/command.cc39
1 files changed, 9 insertions, 30 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index e44ff784d6..a5c4389f2e 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1292,12 +1292,11 @@ static bool _do_description(std::string key, std::string type,
monster_type mon_num = get_monster_by_name(key, true);
if (mon_num != MONS_PROGRAM_BUG)
{
+ monsters mon;
+ mon.type = mon_num;
+
if (mons_genus(mon_num) == MONS_DRACONIAN)
{
- monsters mon;
-
- mon.type = mon_num;
-
switch (mon_num)
{
case MONS_BLACK_DRACONIAN:
@@ -1314,29 +1313,13 @@ static bool _do_description(std::string key, std::string type,
mon.base_monster = MONS_PROGRAM_BUG;
break;
}
-
- const monsters m = mon;
- describe_monsters(m);
- return (false);
}
+ else
+ mon.base_monster = MONS_PROGRAM_BUG;
- std::string symbol = "";
- symbol += get_monster_data(mon_num)->showchar;
- if (isupper(symbol[0]))
- symbol = "cap-" + symbol;
-
- std::string symbol_prefix = "__";
- symbol_prefix += symbol;
- symbol_prefix += "_prefix";
- prefix = getLongDescription(symbol_prefix);
- quote += getQuoteString(symbol_prefix);
-
- std::string symbol_suffix = "__";
- symbol_suffix += symbol;
- symbol_suffix += "_suffix";
- suffix += getLongDescription(symbol_suffix);
- suffix += getLongDescription(symbol_suffix + "_lookup");
- quote += getQuoteString(symbol_suffix);
+ const monsters m = mon;
+ describe_monsters(m);
+ return (false);
}
else
{
@@ -1642,11 +1625,7 @@ static bool _find_description(bool &again, std::string& error_inout)
footer += regex;
footer += "'. To see non-exact matches, press space.";
- if (!_do_description(regex, type, footer))
- {
- DEBUGSTR("do_description() returned false for exact_match");
- return (false);
- }
+ _do_description(regex, type, footer);
if (getch() != ' ')
return (false);