summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/randart.cc12
-rw-r--r--crawl-ref/source/randart.h2
-rw-r--r--crawl-ref/source/religion.cc5
3 files changed, 14 insertions, 5 deletions
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index 93aefc9ba6..635873953d 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -1643,7 +1643,7 @@ bool randart_is_bad( const item_def &item )
return randart_is_bad( item, proprt);
}
-bool make_item_randart( item_def &item )
+bool make_item_randart( item_def &item, bool randomise )
{
if (item.base_type != OBJ_WEAPONS
&& item.base_type != OBJ_ARMOUR
@@ -1666,10 +1666,14 @@ bool make_item_randart( item_def &item )
known[i] = (bool) false;
item.flags |= ISFLAG_RANDART;
- do
+
+ if (randomise)
{
- item.special = (random_int() & RANDART_SEED_MASK);
- } while (randart_is_bad( item ));
+ do
+ {
+ 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 ce77411b9d..853e27e4db 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 make_item_randart( item_def &item, bool randomise = true );
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 09289b8fc3..91169d30e4 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -4066,8 +4066,13 @@ static bool _bless_weapon( god_type god, int brand, int colour )
enchant_weapon( ENCHANT_TO_DAM, true, you.inv[wpn] );
if ( is_good_god(god) )
+ {
normal2good(you.inv[wpn]);
+ if (is_blessed(you.inv[wpn]))
+ make_item_randart(you.inv[wpn], false);
+ }
+
you.wield_change = true;
you.num_gifts[god]++;
take_note(Note(NOTE_GOD_GIFT, you.religion));