summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/randart.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-16 18:55:15 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-16 18:55:15 +0000
commit4266c77e79bec9933ff1d9fe2bf78cd135893241 (patch)
tree2edc552cd0dbf1832e19253daaabdf738b2a6bd1 /crawl-ref/source/randart.cc
parent99faf9bb2e3e034fb3389ca622a05318c37fc5ec (diff)
downloadcrawl-ref-4266c77e79bec9933ff1d9fe2bf78cd135893241.tar.gz
crawl-ref-4266c77e79bec9933ff1d9fe2bf78cd135893241.zip
Properly outsource names for TSO's blessed weapon artefacts.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4265 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/randart.cc')
-rw-r--r--crawl-ref/source/randart.cc30
1 files changed, 13 insertions, 17 deletions
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index 8d9ceb8f42..1f4fab9d76 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -1172,17 +1172,20 @@ static std::string get_artefact_type(const int type)
}
}
-static bool pick_db_name(const int type)
+static bool pick_db_name( const item_def &item )
{
- switch (type)
+ if (is_blessed(item))
+ return true;
+
+ switch (item.base_type)
{
- case OBJ_WEAPONS:
- case OBJ_ARMOUR:
- return coinflip();
- case OBJ_JEWELLERY:
- return one_chance_in(5);
- default:
- return 0;
+ case OBJ_WEAPONS:
+ case OBJ_ARMOUR:
+ return coinflip();
+ case OBJ_JEWELLERY:
+ return one_chance_in(5);
+ default:
+ return false;
}
}
@@ -1250,7 +1253,7 @@ std::string randart_name( const item_def &item )
return result;
}
- if (pick_db_name(item.base_type))
+ if (pick_db_name(item))
{
result += item_base_name(item) + " ";
@@ -1287,13 +1290,6 @@ std::string randart_name( const item_def &item )
}
}
- if (is_blessed(item) && god_gift)
- {
- result = item_base_name(item) + " ";
- std::string name = "of @player_name@";
- result += replace_name_parts(name, item);
- }
-
return result;
}