diff options
-rw-r--r-- | crawl-ref/source/describe.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/itemname.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/itemname.h | 4 |
3 files changed, 15 insertions, 8 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index d6d0b5040c..7763ebb7b9 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -990,10 +990,17 @@ static string _describe_weapon(const item_def &item, bool verbose) } } - if (you.duration[DUR_WEAPON_BRAND]) + if (you.duration[DUR_WEAPON_BRAND] && &item == you.weapon()) { - description += "\nIt is temporarily rebranded; it is actually a weapon of " - + ego_type_string(item, false, you.props["orig brand"]) + "."; + description += "\nIt is temporarily rebranded; it is actually a"; + if ((int) you.props["orig brand"] == SPWPN_NORMAL) + description += "n unbranded weapon."; + else + { + description += " weapon of " + + ego_type_string(item, false, you.props["orig brand"]) + + "."; + } } if (is_artefact(item)) diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 9c83e7d601..40878144f1 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -446,7 +446,7 @@ static const char* _missile_brand_name(special_missile_type brand, mbn_type t) const char* weapon_brand_name(const item_def& item, bool terse, int override_brand) { - switch (override_brand == -1 ? get_weapon_brand(item) : override_brand) + switch (override_brand ? override_brand : get_weapon_brand(item)) { case SPWPN_NORMAL: return ""; case SPWPN_FLAMING: return terse ? "flame" : "flaming"; @@ -1227,8 +1227,8 @@ string ego_type_string(const item_def &item, bool terse, int override_brand) case OBJ_WEAPONS: if (!terse) { - int checkbrand = override_brand == -1 ? get_weapon_brand(item) - : override_brand; + int checkbrand = override_brand ? override_brand + : get_weapon_brand(item); // this is specialcased out of weapon_brand_name // ("vampiric hand axe", etc) if (checkbrand == SPWPN_VAMPIRICISM) diff --git a/crawl-ref/source/itemname.h b/crawl-ref/source/itemname.h index 44c14580ed..386cc047d9 100644 --- a/crawl-ref/source/itemname.h +++ b/crawl-ref/source/itemname.h @@ -101,7 +101,7 @@ bool is_useless_item(const item_def &item, bool temp = false); string make_name(uint32_t seed, bool all_caps, int maxlen = -1, char start = 0); -const char* weapon_brand_name(const item_def& item, bool terse, int override_brand = -1); +const char* weapon_brand_name(const item_def& item, bool terse, int override_brand = 0); const char* armour_ego_name(const item_def& item, bool terse); bool item_type_has_ids(object_class_type base_type); @@ -134,7 +134,7 @@ string base_type_string(const item_def &item, bool known = true); string sub_type_string(const item_def &item, bool known = true); -string ego_type_string(const item_def &item, bool terse = false, int override_brand = -1); +string ego_type_string(const item_def &item, bool terse = false, int override_brand = 0); const char* potion_type_name(int potiontype); //used in xom.cc #endif |