From 8c9938f88a6e11f10916a360804bd4bd8516a278 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 3 Jan 2010 23:20:00 +1000 Subject: Branded and positively enchanted missiles are "glowing". (Eronarn) --- crawl-ref/source/itemname.cc | 11 +++++++++++ crawl-ref/source/items.cc | 4 ---- crawl-ref/source/makeitem.cc | 25 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) (limited to 'crawl-ref') 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; } -- cgit v1.2.3-54-g00ecf