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 ++++++++++++-------- crawl-ref/source/randart.h | 2 +- crawl-ref/source/religion.cc | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) (limited to 'crawl-ref') 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); } diff --git a/crawl-ref/source/randart.h b/crawl-ref/source/randart.h index 853e27e4db..ce77411b9d 100644 --- a/crawl-ref/source/randart.h +++ b/crawl-ref/source/randart.h @@ -87,7 +87,7 @@ bool randart_wpn_known_prop( item_def &item, randart_prop_type prop ); * *********************************************************************** */ bool make_item_fixed_artefact( item_def &item, bool in_abyss, int which = 0 ); -bool make_item_randart( item_def &item, bool randomise = true ); +bool make_item_randart( item_def &item ); bool make_item_unrandart( item_def &item, int unrand_index ); /* *********************************************************************** diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 91169d30e4..6eb164d800 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4065,12 +4065,12 @@ static bool _bless_weapon( god_type god, int brand, int colour ) enchant_weapon( ENCHANT_TO_HIT, true, you.inv[wpn] ); enchant_weapon( ENCHANT_TO_DAM, true, you.inv[wpn] ); - if ( is_good_god(god) ) + if ( god == GOD_SHINING_ONE ) { normal2good(you.inv[wpn]); if (is_blessed(you.inv[wpn])) - make_item_randart(you.inv[wpn], false); + make_item_randart(you.inv[wpn]); } you.wield_change = true; @@ -4083,7 +4083,7 @@ static bool _bless_weapon( god_type god, int brand, int colour ) mprf( MSGCH_GOD, "Your weapon shines brightly!" ); simple_god_message( " booms: Use this gift wisely!" ); - if ( is_good_god(god) ) + if ( god == GOD_SHINING_ONE ) { holy_word( 100, HOLY_WORD_GENERIC, true ); // un-bloodify surrounding squares -- cgit v1.2.3-54-g00ecf