summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-10 13:32:04 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-10 13:32:04 +0000
commita028038652c432ed0ee67ca632edea8deb410ef0 (patch)
treef53d054bb9f1510aab468008626b94aa596ca77b /crawl-ref/source/itemname.cc
parent269aa80ee67b5a50709de6d678892b63a7fbe75b (diff)
downloadcrawl-ref-a028038652c432ed0ee67ca632edea8deb410ef0.tar.gz
crawl-ref-a028038652c432ed0ee67ca632edea8deb410ef0.zip
Rework staves/rods to match the ID behaviour of wands etc., i.e.
they get randomised but fixed descriptions at the beginning of the game, and once you know one type you'll be able to recognize another staff/rod of the same type. In the case of rods you'll still have to evoke it to find out the number of charges. I've tried to put the secondary descriptions into an order that will roughly match the ten current staff tiles. This solves part of FR 1837348, and is likely to cause havoc to saved games, at least concerning staves. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3424 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc57
1 files changed, 36 insertions, 21 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 5298995774..a1220dd627 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -879,22 +879,33 @@ static const char* book_type_name(int booktype)
}
}
+static const char* staff_secondary_string(int p)
+{
+ switch (p) // general descriptions
+ {
+ case 0: return "crooked ";
+ case 1: return "knobbly ";
+ case 2: return "heavily ";
+ case 3: return "gnarled ";
+ case 4: return "thin ";
+ case 5: return "curved ";
+ case 6: return "twisted ";
+ case 7: return "thick ";
+ case 8: return "long ";
+ case 9: return "short ";
+ default: return "buggily ";
+ }
+}
+
static const char* staff_primary_string(int p)
{
- switch (p)
+ switch (p) // special attributes
{
-
- case 0: return "curved";
- case 1: return "glowing";
- case 2: return "thick";
- case 3: return "thin";
- case 4: return "long";
- case 5: return "twisted";
- case 6: return "jewelled";
- case 7: return "runed";
- case 8: return "smoking";
- case 9: return "gnarled";
- default: return "buggy";
+ case 0: return "glowing ";
+ case 1: return "jewelled ";
+ case 2: return "runed ";
+ case 3: return "smoking ";
+ default: return "buggy ";
}
}
@@ -1517,8 +1528,9 @@ std::string item_def::name_aux( description_level_type desc,
if (!know_type)
{
if (!basename)
- buff << staff_primary_string(this->special) << " ";
-
+ buff << staff_secondary_string(this->special / 4)
+ << staff_primary_string(this->special % 4);
+
buff << (item_is_rod( *this ) ? "rod" : "staff");
}
else
@@ -1526,7 +1538,8 @@ std::string item_def::name_aux( description_level_type desc,
buff << (item_is_rod( *this ) ? "rod" : "staff")
<< " of " << staff_type_name(item_typ);
- if (item_is_rod(*this) && !basename && !qualname && !dbname)
+ if (item_is_rod(*this) && know_pluses
+ && !basename && !qualname && !dbname)
{
buff << " (" << (this->plus / ROD_CHARGE_MULT)
<< "/" << (this->plus2 / ROD_CHARGE_MULT)
@@ -1639,6 +1652,7 @@ static item_type_id_type objtype_to_idtype(object_class_type base_type)
case OBJ_SCROLLS: return (IDTYPE_SCROLLS);
case OBJ_JEWELLERY: return (IDTYPE_JEWELLERY);
case OBJ_POTIONS: return (IDTYPE_POTIONS);
+ case OBJ_STAVES: return (IDTYPE_STAVES);
default: return (NUM_IDTYPE);
}
}
@@ -1754,12 +1768,13 @@ void check_item_knowledge()
{
std::vector<const item_def*> items;
- const object_class_type idx_to_objtype[4] = { OBJ_WANDS, OBJ_SCROLLS,
- OBJ_JEWELLERY, OBJ_POTIONS };
- const int idx_to_maxtype[4] = { NUM_WANDS, NUM_SCROLLS,
- NUM_JEWELLERY, NUM_POTIONS };
+ const object_class_type idx_to_objtype[5] = { OBJ_WANDS, OBJ_SCROLLS,
+ OBJ_JEWELLERY, OBJ_POTIONS,
+ OBJ_STAVES };
+ const int idx_to_maxtype[5] = { NUM_WANDS, NUM_SCROLLS,
+ NUM_JEWELLERY, NUM_POTIONS, NUM_STAVES };
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 5; i++)
{
for (int j = 0; j < idx_to_maxtype[i]; j++)
{