summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-13 22:54:18 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-13 23:05:10 +0100
commit726bbec9c9c26a60e10e318a4bffc932f04358ea (patch)
tree1ab27bc4367154d5fa8b4575ccf17cc50b2b3ea9 /crawl-ref/source/effects.cc
parent64a27c34a406bfe9ae86a91dd8f216d187f3babf (diff)
downloadcrawl-ref-726bbec9c9c26a60e10e318a4bffc932f04358ea.tar.gz
crawl-ref-726bbec9c9c26a60e10e318a4bffc932f04358ea.zip
Restrict torment and holy word to LOS.
Fixes 2842516. Also make them fill LOS properly.
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 2d9c8fbe54..cd100715d9 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -186,8 +186,13 @@ int holy_word(int pow, int caster, const coord_def& where, bool silent,
attacker->conj_verb("speak").c_str());
}
- return (apply_area_within_radius(holy_word_monsters, where, pow, 8, caster,
- attacker));
+ // We could use actor.get_los(), but maybe it's NULL.
+ los_def los(where);
+ los.update();
+ int r = 0;
+ for (radius_iterator ri(&los); ri; ++ri)
+ r += holy_word_monsters(*ri, 0, caster, attacker);
+ return (r);
}
int torment_player(int pow, int caster)
@@ -314,6 +319,7 @@ int torment_monsters(coord_def where, int pow, int caster, actor *attacker)
// Currently, torment doesn't annoy the monsters it affects
// because it can't kill them, and because hostile monsters use
// it. It does alert them, though.
+ // XXX: attacker isn't passed through "int torment()".
if (attacker != NULL)
behaviour_event(monster, ME_ALERT, attacker->mindex());
}
@@ -328,7 +334,12 @@ int torment_monsters(coord_def where, int pow, int caster, actor *attacker)
int torment(int caster, const coord_def& where)
{
- return (apply_area_within_radius(torment_monsters, where, 0, 8, caster));
+ los_def los(where);
+ los.update();
+ int r = 0;
+ for (radius_iterator ri(&los); ri; ++ri)
+ r += torment_monsters(*ri, 0, caster);
+ return (r);
}
void immolation(int pow, int caster, coord_def where, bool known,