summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-25 22:42:41 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-25 22:42:41 +0000
commitb67ca8220470dc19f83db1b199fec11c8f311da4 (patch)
treeea0e2924f4205a57f40bf4ac6e3e501b96d632c3 /crawl-ref/source/item_use.cc
parentfe66a480da9ae461070c73f7690922b240ff3ace (diff)
downloadcrawl-ref-b67ca8220470dc19f83db1b199fec11c8f311da4.tar.gz
crawl-ref-b67ca8220470dc19f83db1b199fec11c8f311da4.zip
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
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc11
1 files changed, 9 insertions, 2 deletions
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;
}