From b67ca8220470dc19f83db1b199fec11c8f311da4 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 25 Sep 2008 22:42:41 +0000 Subject: Yred flavor, part 3: forbid the use of holy items (weapons of holy wrath and scrolls of holy word) or spells. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6994 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/item_use.cc') diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 46c97586b4..a08ccee3ba 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -4583,8 +4583,10 @@ void read_scroll( int slot ) you.piety / 2; } - if (!holy_word(pow, HOLY_WORD_SCROLL, you.pos(), - !item_type_known(scroll))) + const bool success = holy_word(pow, HOLY_WORD_SCROLL, you.pos(), + !item_type_known(scroll)); + + if (!success) { canned_msg(MSG_NOTHING_HAPPENS); id_the_scroll = false; @@ -4597,6 +4599,11 @@ void read_scroll( int slot ) if (you.duration[DUR_PIETY_POOL] > 500) you.duration[DUR_PIETY_POOL] = 500; } + + // This is only naughty if you know you're doing it, or if it's + // succeeded, in which case you'll know for next time. + if (item_type_known(scroll) || success) + did_god_conduct(DID_HOLY, 10, item_type_known(scroll)); break; } -- cgit v1.2.3-54-g00ecf