summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorSage <SageBasilMint@gmail.com>2014-01-18 01:50:15 +0000
committerPekka Lampila <pekka.lampila@iki.fi>2014-01-30 06:47:03 +0200
commit8df0fbc07b74c87a83e9bec2611e893288bc6d11 (patch)
treed6782fadf64ebf78dfd21769ecb1a9a933249a13 /crawl-ref/source/effects.cc
parentddb37801100f666bcb571da877bc253348cbfb63 (diff)
downloadcrawl-ref-8df0fbc07b74c87a83e9bec2611e893288bc6d11.tar.gz
crawl-ref-8df0fbc07b74c87a83e9bec2611e893288bc6d11.zip
Prevent Yred servants from becoming hostile for reading ?HW.
...Provided that you didn't know the scroll beforehand. Hostility on unidentified ?HW encourages sending your mob away whenever you want to read-ID, which is sort of silly.
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 6d23e3c7d6..4d9c90c55b 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -166,8 +166,14 @@ void holy_word_monsters(coord_def where, int pow, holy_word_source_type source,
// Currently, holy word annoys the monsters it affects
// because it can kill them, and because hostile
// monsters don't use it.
- if (attacker != NULL)
+ // Tolerate unknown scroll, to not annoy Yred worshippers too much.
+ if (attacker != NULL
+ && (attacker != &you
+ || source != HOLY_WORD_SCROLL
+ || item_type_known(OBJ_SCROLLS, SCR_HOLY_WORD)))
+ {
behaviour_event(mons, ME_ANNOY, attacker);
+ }
if (mons->speed_increment >= 25)
mons->speed_increment -= 20;