summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-16 15:20:16 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-16 15:20:16 +0000
commit173858bc3514e1de1c406400ff9b1f2261cea836 (patch)
tree91e0d124bdbed818dc377fd381e58f6b5545d58a /crawl-ref
parentbf6b4b21ccc66c8e458ee433add5741ec90e5d87 (diff)
downloadcrawl-ref-173858bc3514e1de1c406400ff9b1f2261cea836.tar.gz
crawl-ref-173858bc3514e1de1c406400ff9b1f2261cea836.zip
Long blades blessed by TSO now become artefact blessed blades (without
the randomized effects). There should probably be some restrictions on the randart name eventually, so you don't end up with e.g. "the +1 blessed blade of Atheism". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4258 c06c8d41-db1a-0410-9941-cceddc491573
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));