From fc2d149b397d8efe4077001a160799d01e1d3fe9 Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 16 Apr 2008 17:12:00 +0000 Subject: Clean up TSO's weapon blessing, and give all blessed weapons the title "of [player name]". The randartization isn't working as expected, so, until it can be fixed, give the blessed blades random properties for now, just like other artefacts. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4260 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/randart.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/randart.cc') diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index 8e613cc299..57927f6863 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -1237,7 +1237,14 @@ std::string randart_name( const item_def &item ) if (pick_db_name(item.base_type)) { result += item_base_name(item) + " "; - std::string name = getRandNameString(lookup); + + std::string name; + + // special case for blessed artefact weapons, since they're unique + if (is_blessed(item)) + name = "of @player_name@"; + else + name = getRandNameString(lookup); if (name.empty() && god_gift) // if nothing found, try god name alone { @@ -1645,7 +1652,7 @@ bool randart_is_bad( const item_def &item ) return randart_is_bad( item, proprt); } -bool make_item_randart( item_def &item, bool randomise ) +bool make_item_randart( item_def &item ) { if (item.base_type != OBJ_WEAPONS && item.base_type != OBJ_ARMOUR @@ -1669,14 +1676,11 @@ bool make_item_randart( item_def &item, bool randomise ) item.flags |= ISFLAG_RANDART; - if (randomise) + do { - do - { - item.special = (random_int() & RANDART_SEED_MASK); - } - while (randart_is_bad( item )); + item.special = (random_int() & RANDART_SEED_MASK); } + while (randart_is_bad( item )); return (true); } -- cgit v1.2.3-54-g00ecf