summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2010-01-03 23:20:00 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2010-01-03 23:54:25 +1000
commit8c9938f88a6e11f10916a360804bd4bd8516a278 (patch)
tree10b491ecc3f47b4cbbfa50ebd505a41a6cd13512 /crawl-ref/source
parent196415dd325aa0fbe4c309f29d86a07a3988cb4a (diff)
downloadcrawl-ref-8c9938f88a6e11f10916a360804bd4bd8516a278.tar.gz
crawl-ref-8c9938f88a6e11f10916a360804bd4bd8516a278.zip
Branded and positively enchanted missiles are "glowing". (Eronarn)
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/itemname.cc11
-rw-r--r--crawl-ref/source/items.cc4
-rw-r--r--crawl-ref/source/makeitem.cc25
3 files changed, 36 insertions, 4 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index d2a9bbdfdf..beda8a3e5a 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1140,6 +1140,17 @@ std::string item_def::name_aux(description_level_type desc,
}
+ if (know_cosmetic && !know_brand)
+ {
+ switch (get_equip_desc(*this))
+ {
+ case ISFLAG_GLOWING:
+ if (!testbits(ignore_flags, ISFLAG_GLOWING))
+ buff << "glowing ";
+ break;
+ }
+ }
+
if (know_pluses)
{
output_with_sign(buff, it_plus);
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index fe96b86d1b..ec73ef8cf7 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -635,10 +635,6 @@ int item_name_specialness(const item_def& item)
return ( branded ? 1 : 0 );
}
- // Missiles don't get name descriptors.
- if (item.base_type == OBJ_MISSILES)
- return 0;
-
std::string itname = item.name(DESC_PLAIN, false, false, false);
lowercase(itname);
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 551e148820..8aabb41282 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -22,6 +22,7 @@
#include "dungeon.h"
#include "env.h"
#include "food.h"
+#include "itemname.h"
#include "itemprop.h"
#include "items.h"
#include "misc.h"
@@ -3382,6 +3383,25 @@ static bool _armour_is_visibly_special(const item_def &item)
return (false);
}
+static bool _missile_is_visibly_special(const item_def &item)
+{
+ const int brand = item.special;
+
+ // Obviously branded missiles don't get any special stuff.
+ if (item_type_known(item))
+ return (false);
+
+ // All ego missiles do.
+ if (brand != SPMSL_NORMAL)
+ return (true);
+
+ // And positively enchanted do, too.
+ if (item.plus)
+ return (true);
+
+ return (false);
+}
+
jewellery_type get_random_amulet_type()
{
return (jewellery_type)
@@ -3541,6 +3561,11 @@ void item_set_appearance(item_def &item)
}
break;
+ case OBJ_MISSILES:
+ if (_missile_is_visibly_special(item))
+ set_equip_desc(item, ISFLAG_GLOWING);
+ break;
+
default:
break;
}