summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/randart.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 00:51:38 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 00:51:38 +0000
commit627e34c5079bbf923fb7d687272d1abdcfb2e6ef (patch)
tree48a09c81613a6b9ed0624a2ef9e169dc932e0fc2 /crawl-ref/source/randart.cc
parentb522b828e63baba3e1136df6030ec22239764b07 (diff)
downloadcrawl-ref-627e34c5079bbf923fb7d687272d1abdcfb2e6ef.tar.gz
crawl-ref-627e34c5079bbf923fb7d687272d1abdcfb2e6ef.zip
While for the appearance of randart weapons and armour you can just
stick an adjective in front of the object type name ("bloodstained dagger"), unidentified non-artefact jewellry is described with both an adjective and material ("runed wooden ring"), making a description like "runed ring" a bit weird. So give randart jewellery an adjective that no non-artefact jewellery would have, plus a material that a non-artefact might or might not have. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5741 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/randart.cc')
-rw-r--r--crawl-ref/source/randart.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index 951ab6427e..34a7895c57 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -1252,16 +1252,19 @@ bool randart_wpn_known_prop( const item_def &item, randart_prop_type prop )
return known;
}
-static std::string _get_artefact_type(const int type)
+static std::string _get_artefact_type(const item_def &item)
{
- switch (type)
+ switch (item.base_type)
{
case OBJ_WEAPONS:
return "weapon";
case OBJ_ARMOUR:
return "armour";
case OBJ_JEWELLERY:
- return "jewellery";
+ if (jewellery_is_amulet(item))
+ return "amulet";
+ else
+ return "ring";
default:
return "artefact";
}
@@ -1319,7 +1322,7 @@ std::string randart_name(const item_def &item, bool appearance)
}
// get base type
- lookup += _get_artefact_type(item.base_type);
+ lookup += _get_artefact_type(item);
rng_save_excursion rng_state;
seed_rng( seed );
@@ -1365,7 +1368,7 @@ std::string randart_name(const item_def &item, bool appearance)
{
// if still nothing found, try base type alone
name = getRandNameString(
- _get_artefact_type(item.base_type).c_str());
+ _get_artefact_type(item).c_str());
}
}