summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-07 20:19:31 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-07 20:19:31 +0000
commit537692804ed95d5fd31dfc482b4f3fdc494cf73b (patch)
tree503e9fc394466c1ab723fbf8a133686148ec900a /crawl-ref/source/itemname.cc
parentcf924211cb8cc1a72c79410a21054eb378bb0c4b (diff)
downloadcrawl-ref-537692804ed95d5fd31dfc482b4f3fdc494cf73b.tar.gz
crawl-ref-537692804ed95d5fd31dfc482b4f3fdc494cf73b.zip
Display rods' charges after their type, so that rods that have
sub-subtypes (such as the rod of destruction [ice]) can be looked up via "destruction [ice]", the same way books that have sub-subtypes (such as the book of Conjurations [ice]) can. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8957 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 77c585f890..9098999a0f 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1588,8 +1588,10 @@ std::string item_def::name_aux( description_level_type desc,
if (!know_type)
{
if (!basename)
- buff << staff_secondary_string(this->special / 4)
- << staff_primary_string(this->special % 4);
+ {
+ buff << staff_secondary_string(this->special / 4)
+ << staff_primary_string(this->special % 4);
+ }
buff << (item_is_rod( *this ) ? "rod" : "staff");
}
@@ -1597,18 +1599,9 @@ std::string item_def::name_aux( description_level_type desc,
{
buff << (item_is_rod( *this ) ? "rod" : "staff")
<< " of " << staff_type_name(item_typ);
-
- if (item_is_rod(*this) && know_pluses
- && !basename && !qualname && !dbname)
- {
- buff << " (" << (this->plus / ROD_CHARGE_MULT)
- << "/" << (this->plus2 / ROD_CHARGE_MULT)
- << ")";
- }
}
break;
-
// rearranged 15 Apr 2000 {dlb}:
case OBJ_ORBS:
buff.str("Orb of Zot");
@@ -1658,7 +1651,7 @@ std::string item_def::name_aux( description_level_type desc,
if (need_plural && this->quantity > 1 && !basename && !qualname)
buff.str( pluralise(buff.str()) );
- // Disambiguation
+ // Disambiguation.
if (!terse && !basename && !dbname && know_type &&
!is_random_artefact( *this ))
{
@@ -1706,6 +1699,15 @@ std::string item_def::name_aux( description_level_type desc,
}
}
+ // Rod charges.
+ if (item_is_rod(*this) && know_type && know_pluses
+ && !basename && !qualname && !dbname)
+ {
+ buff << " (" << (this->plus / ROD_CHARGE_MULT)
+ << "/" << (this->plus2 / ROD_CHARGE_MULT)
+ << ")";
+ }
+
// debugging output -- oops, I probably block it above ... dang! {dlb}
if (buff.str().length() < 3)
{