From ed549479d0514ff2616fab9d0d6d21e136201743 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 21 Apr 2008 21:21:36 +0000 Subject: 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 --- crawl-ref/source/directn.cc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/directn.cc') 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; -- cgit v1.2.3-54-g00ecf