From 4266c77e79bec9933ff1d9fe2bf78cd135893241 Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 16 Apr 2008 18:55:15 +0000 Subject: 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 --- crawl-ref/source/randart.cc | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'crawl-ref/source/randart.cc') 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; } -- cgit v1.2.3-54-g00ecf