summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-03 13:11:56 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-03 14:02:48 +0100
commit7f8b6d85697774a182b3f40aca21e2286d5c32a3 (patch)
treebbd3e53fc328deb225a66fb3ae3008f3d261c918
parent120d0bec40c60b6a6080d4d8c3656896087c997d (diff)
downloadcrawl-ref-7f8b6d85697774a182b3f40aca21e2286d5c32a3.tar.gz
crawl-ref-7f8b6d85697774a182b3f40aca21e2286d5c32a3.zip
Cosmetic desc of gloves: 50% of them will be "gauntlets", 0% "bracers".
-rw-r--r--crawl-ref/source/dat/descript/items.txt8
-rw-r--r--crawl-ref/source/itemname.cc13
-rw-r--r--crawl-ref/source/itemprop.cc14
-rw-r--r--crawl-ref/source/itemprop.h10
-rw-r--r--crawl-ref/source/makeitem.cc2
5 files changed, 46 insertions, 1 deletions
diff --git a/crawl-ref/source/dat/descript/items.txt b/crawl-ref/source/dat/descript/items.txt
index 9df184dafc..b9a8e50d0a 100644
--- a/crawl-ref/source/dat/descript/items.txt
+++ b/crawl-ref/source/dat/descript/items.txt
@@ -820,6 +820,14 @@ pair of boots
A pair of boots.
%%%%
+pair of bracers
+
+A pair of bracers.
+%%%%
+pair of gauntlets
+
+A pair of gauntlets.
+%%%%
pair of gloves
A pair of gloves.
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index a0577bad38..307074402f 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1271,7 +1271,18 @@ std::string item_def::name_aux(description_level_type desc,
: "buggy ");
}
- buff << item_base_name(*this);
+ if (!basename && item_typ == ARM_GLOVES)
+ {
+ const short dglov = get_gloves_desc(*this);
+
+ buff <<
+ ((dglov == TGLOV_DESC_GLOVES) ? "gloves" :
+ (dglov == TGLOV_DESC_GAUNTLETS) ? "gauntlets" :
+ (dglov == TGLOV_DESC_BRACERS) ? "bracers" :
+ "bug-ridden gloves");
+ }
+ else
+ buff << item_base_name(*this);
if (know_ego && !is_artefact(*this))
{
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index eebf239bb2..eed9ac927d 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -893,6 +893,20 @@ void set_helmet_random_desc( item_def &item )
item.plus2 = random2(THELM_DESC_MAX_SOFT + 1);
}
+short get_gloves_desc( const item_def &item )
+{
+ ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_GLOVES );
+
+ return item.plus2;
+}
+
+void set_gloves_random_desc( item_def &item )
+{
+ ASSERT( item.base_type == OBJ_ARMOUR && item.sub_type == ARM_GLOVES );
+
+ item.plus2 = coinflip() ? TGLOV_DESC_GLOVES : TGLOV_DESC_GAUNTLETS;
+}
+
//
// Ego item functions:
//
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index 7a08a9c0d8..5fbd26c968 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -146,6 +146,13 @@ enum helmet_desc_type
THELM_NUM_DESCS
};
+enum gloves_desc_type
+{
+ TGLOV_DESC_GLOVES = 0,
+ TGLOV_DESC_GAUNTLETS,
+ TGLOV_DESC_BRACERS
+};
+
enum jewellery_type
{
RING_FIRST_RING = 0,
@@ -609,6 +616,9 @@ short get_helmet_desc( const item_def &item );
bool is_helmet( const item_def& item );
bool is_hard_helmet( const item_def& item );
+short get_gloves_desc( const item_def &item );
+void set_gloves_random_desc( item_def &item );
+
// ego items:
bool set_item_ego_type( item_def &item, int item_type, int ego_type );
int get_weapon_brand( const item_def &item );
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 8df359db5c..035113b727 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -2144,6 +2144,8 @@ static void _generate_armour_item(item_def& item, bool allow_uniques,
// If we get here the item is not an artefact.
if (is_helmet(item) && one_chance_in(3))
set_helmet_random_desc(item);
+ else if (item.sub_type == ARM_GLOVES)
+ set_gloves_random_desc(item);
if (item_race == MAKE_ITEM_RANDOM_RACE && item.sub_type == ARM_BOOTS)
{