summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-project.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-08-29 22:47:25 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-08-29 23:27:05 +0200
commitc8216b768c2db8b7ae558fbb76f4c9cde8258d1d (patch)
treea2e6104d7b3446c509bfe193cf6bafcb3f9cceec /crawl-ref/source/mon-project.cc
parente2827d32889293174c0160e70871351727a853e3 (diff)
downloadcrawl-ref-c8216b768c2db8b7ae558fbb76f4c9cde8258d1d.tar.gz
crawl-ref-c8216b768c2db8b7ae558fbb76f4c9cde8258d1d.zip
Give pghosts and pillusions flawed IOODs.
They were players once, and thus couldn't possibly get the full version (per the spell's description). All other users are centuries old, or don't need books in the first place.
Diffstat (limited to 'crawl-ref/source/mon-project.cc')
-rw-r--r--crawl-ref/source/mon-project.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc
index 4e170621ec..7ffb615cb5 100644
--- a/crawl-ref/source/mon-project.cc
+++ b/crawl-ref/source/mon-project.cc
@@ -94,6 +94,12 @@ spret_type cast_iood(actor *caster, int pow, bolt *beam, float vx, float vy,
: (caster->is_player()) ? "you" : "";
mon->props["iood_mid"].get_int() = caster->mid;
+ if (caster->is_player() || caster->type == MONS_PLAYER_GHOST
+ || caster->type == MONS_PLAYER_ILLUSION)
+ {
+ mon->props["iood_flawed"].get_byte() = true;
+ }
+
// Move away from the caster's square.
iood_act(*mon, true);
// We need to take at least one full move (for the above), but let's
@@ -354,11 +360,15 @@ move_again:
return true;
}
- if (iood && mon.props["iood_kc"].get_byte() == KC_YOU
- && (you.pos() - pos).rdist() > LOS_RADIUS)
- { // not actual vision, because of the smoke trail
- _iood_stop(mon);
- return true;
+ if (iood && mon.props.exists("iood_flawed"))
+ {
+ const actor *caster = actor_by_mid(mon.props["iood_mid"].get_int());
+ if (!caster || caster->pos().origin() ||
+ (caster->pos() - pos).rdist() > LOS_RADIUS)
+ { // not actual vision, because of the smoke trail
+ _iood_stop(mon);
+ return true;
+ }
}
if (pos == mon.pos())