summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-06-12 13:26:47 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-06-12 13:41:10 -0400
commite561a6638b9c70b2f3ad265faa83520c7af28226 (patch)
treeeb7e8c675d6119f1f1915ce90d3b26ef922b3973 /crawl-ref/source/itemname.cc
parentb80c8152ad0ca63863a0ba367b1fede1f4b36504 (diff)
downloadcrawl-ref-e561a6638b9c70b2f3ad265faa83520c7af28226.tar.gz
crawl-ref-e561a6638b9c70b2f3ad265faa83520c7af28226.zip
Allow temporary branding to go over a permanent brand.
Toting around an unbranded weapon just to be able to swap to it is no fun, and not even that much more of a difficulty; maybe it just means getting pain out takes 0.7 more turns or so. You still can't overwrite artefacts, of course.
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index fae13ca525..9c83e7d601 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -444,9 +444,9 @@ static const char* _missile_brand_name(special_missile_type brand, mbn_type t)
}
}
-const char* weapon_brand_name(const item_def& item, bool terse)
+const char* weapon_brand_name(const item_def& item, bool terse, int override_brand)
{
- switch (get_weapon_brand(item))
+ switch (override_brand == -1 ? get_weapon_brand(item) : override_brand)
{
case SPWPN_NORMAL: return "";
case SPWPN_FLAMING: return terse ? "flame" : "flaming";
@@ -1218,7 +1218,7 @@ string sub_type_string(const item_def &item, bool known)
}
}
-string ego_type_string(const item_def &item, bool terse)
+string ego_type_string(const item_def &item, bool terse, int override_brand)
{
switch (item.base_type)
{
@@ -1227,15 +1227,17 @@ string ego_type_string(const item_def &item, bool terse)
case OBJ_WEAPONS:
if (!terse)
{
+ int checkbrand = override_brand == -1 ? get_weapon_brand(item)
+ : override_brand;
// this is specialcased out of weapon_brand_name
// ("vampiric hand axe", etc)
- if (get_weapon_brand(item) == SPWPN_VAMPIRICISM)
+ if (checkbrand == SPWPN_VAMPIRICISM)
return "vampiricism";
- else if (get_weapon_brand(item) == SPWPN_ANTIMAGIC)
+ else if (checkbrand == SPWPN_ANTIMAGIC)
return "antimagic";
}
if (get_weapon_brand(item) != SPWPN_NORMAL)
- return weapon_brand_name(item, terse);
+ return weapon_brand_name(item, terse, override_brand);
else
return "";
case OBJ_MISSILES: