summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-21 21:21:36 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-21 21:21:36 +0000
commited549479d0514ff2616fab9d0d6d21e136201743 (patch)
tree5c4cecf217cfcf86918fd811eafdc91ceba0c4d1 /crawl-ref/source/directn.cc
parenta9e1c69a175d42318387459cfd686dedd8480833 (diff)
downloadcrawl-ref-ed549479d0514ff2616fab9d0d6d21e136201743.tar.gz
crawl-ref-ed549479d0514ff2616fab9d0d6d21e136201743.zip
In get_monster_desc(), display the shield a monster's wearing, if any,
in the full description. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4451 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index f18e22e0f5..95df12ab38 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2051,7 +2051,6 @@ static std::string stair_destination_description(const coord_def &pos)
static void describe_monster(const monsters *mon)
{
-
// first print type and equipment
std::string text = get_monster_desc(mon);
text += ".";
@@ -2155,6 +2154,7 @@ std::string get_monster_desc(const monsters *mon, bool full_desc,
std::string desc = mon->name(mondtype);
const int mon_arm = mon->inv[MSLOT_ARMOUR];
+ const int mon_shd = mon->inv[MSLOT_SHIELD];
std::string weap = "";
if (mon->type != MONS_DANCING_WEAPON)
@@ -2167,13 +2167,25 @@ std::string get_monster_desc(const monsters *mon, bool full_desc,
desc += weap;
}
- if (full_desc && mon_arm != NON_ITEM)
+ if (full_desc)
{
- desc += ", ";
- if (!weap.empty())
- desc += "and ";
- desc += "wearing ";
- desc += mitm[mon_arm].name(DESC_NOCAP_A);
+ if (mon_arm != NON_ITEM)
+ {
+ desc += ", ";
+ if (!weap.empty() && mon_shd == NON_ITEM)
+ desc += "and ";
+ desc += "wearing ";
+ desc += mitm[mon_arm].name(DESC_NOCAP_A);
+ }
+
+ if (mon_shd != NON_ITEM)
+ {
+ desc += ", ";
+ if (!weap.empty() || mon_arm != NON_ITEM)
+ desc += "and ";
+ desc += "wearing ";
+ desc += mitm[mon_shd].name(DESC_NOCAP_A);
+ }
}
return desc;