summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-22 02:48:12 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-22 02:48:12 +0000
commit94c42a1d74076a4767ed7d3c1394adb813e817d7 (patch)
treeec513b612f05f80d4c313430074b7dcc91ab3361 /crawl-ref/source/describe.cc
parenta0fc101bb8397b81ccd9cf5c1137764e14c57e89 (diff)
downloadcrawl-ref-94c42a1d74076a4767ed7d3c1394adb813e817d7.tar.gz
crawl-ref-94c42a1d74076a4767ed7d3c1394adb813e817d7.zip
If there are multiple matches to the "?/" describe command, then
they will be displayed in a menu, which the user can select from. Menu entries for monsters will be given the same color as the monster, with the monster's symbol added to the end of the string. Entering a single character as input to the "?/" describe command lists all monsters with that display symbol. Monsters sharing the same display symbol can now have the same string appended or prepended to their description (implemented to make the "?/" command have to deal with less special cases). Currently only used by nagas with __N_suffix. Has the side-effect advantage that the naga subspicies description and the "attractive/repulsive" description goes before the big block of quoted text, rather than after it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2177 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc39
1 files changed, 17 insertions, 22 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 8555459057..c0d50a87e9 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -3555,10 +3555,12 @@ static std::string describe_draconian(const monsters *mon)
description += "scaled humanoid with wings.";
if (subsp != MONS_DRACONIAN)
- description += " " + describe_draconian_colour(subsp);
+ if (describe_draconian_colour(subsp) != "")
+ description += " " + describe_draconian_colour(subsp);
if (subsp != mon->type)
- description += " " + describe_draconian_role(mon);
+ if (describe_draconian_role(mon) != "")
+ description += " " + describe_draconian_role(mon);
return (description);
}
@@ -3593,6 +3595,13 @@ void describe_monsters(monsters& mons)
// -peterb 4/14/07
description << getLongDescription(mons.name(DESC_PLAIN));
+ unsigned char symbol = get_monster_data(mons.type)->showchar;
+
+ std::string symbol_prefix = "__";
+ symbol_prefix += symbol;
+ symbol_prefix += "_prefix";
+ description << getLongDescription(symbol_prefix);
+
// Now that the player has examined it, he knows it's a mimic.
if (mons_is_mimic(mons.type))
mons.flags |= MF_KNOWN_MIMIC;
@@ -3632,26 +3641,6 @@ void describe_monsters(monsters& mons)
case MONS_NAGA_WARRIOR:
case MONS_GUARDIAN_NAGA:
case MONS_GREATER_NAGA:
- switch (mons.type)
- {
- case MONS_GUARDIAN_NAGA:
- description << getLongDescription("naga")
- << "$These nagas are often used as guardians "
- "by powerful creatures.$";
- break;
- case MONS_GREATER_NAGA:
- description << getLongDescription("naga")
- << "$It looks strong and aggressive.$";
- break;
- case MONS_NAGA_MAGE:
- description << getLongDescription("naga")
- << "$An eldritch nimbus trails its motions.$";
- break;
- case MONS_NAGA_WARRIOR:
- description << getLongDescription("naga")
- << "$It bears scars of many past battles.$";
- break;
- }
if (you.species == SP_NAGA)
description << "It is particularly attractive.";
else
@@ -3718,6 +3707,12 @@ void describe_monsters(monsters& mons)
break;
}
+ description << "\n";
+ std::string symbol_suffix = "__";
+ symbol_suffix += symbol;
+ symbol_suffix += "_suffix";
+ description << getLongDescription(symbol_suffix);
+
#if DEBUG_DIAGNOSTICS
if (mons_class_flag( mons.type, M_SPELLCASTER ))