diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-19 07:53:07 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-19 07:53:07 +0000 |
commit | b353902c5b7312fbd2f7d4959ea5c6971bc6db74 (patch) | |
tree | f4b86440ca85c749433d474de94b0f218a83faa4 | |
parent | 94328e825e21105c225a85de384f7276c6ded547 (diff) | |
download | crawl-ref-b353902c5b7312fbd2f7d4959ea5c6971bc6db74.tar.gz crawl-ref-b353902c5b7312fbd2f7d4959ea5c6971bc6db74.zip |
Take advantage of check_redraw() generating an AI_SEE_MONSTER interrupt when
appropriate, and fix dispersal ammo's usage of apply_location_effects() and
check_redraw().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8582 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/item_use.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 6881c556d0..15415b9467 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1898,11 +1898,13 @@ static bool _dispersal_hit_victim(bolt& beam, actor* victim, int dmg, { monsters *mon = dynamic_cast<monsters*>(victim); + if (!(mon->flags & MF_WAS_IN_VIEW)) + mon->seen_context = "thin air"; + mons_clear_trapping_net(mon); - mon->check_redraw(oldpos); mon->move_to_pos(pos); - mon->apply_location_effects(pos); - mon->check_redraw(pos); + mon->apply_location_effects(oldpos); + mon->check_redraw(oldpos); const bool seen = you.can_see(mon); const std::string name = mon->name(DESC_CAP_THE); @@ -1910,8 +1912,6 @@ static bool _dispersal_hit_victim(bolt& beam, actor* victim, int dmg, mprf("%s blinks!", name.c_str()); else if (was_seen && !seen) mprf("%s vanishes!", name.c_str()); - else if (!was_seen && seen) - mprf("%s appears from out of thin air!", name.c_str()); } return (true); diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 8f0f2d793d..63b1482941 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2111,15 +2111,15 @@ bool monster_blink(monsters *monster) if (near == monster->pos()) return (false); + if (!(monster->flags & MF_WAS_IN_VIEW)) + monster->seen_context = "thin air"; + mons_clear_trapping_net(monster); const coord_def oldplace = monster->pos(); if (!monster->move_to_pos(near)) return (false); - if (player_monster_visible(monster) && mons_near(monster)) - seen_monster(monster); - monster->check_redraw(oldplace); monster->apply_location_effects(oldplace); @@ -7521,6 +7521,7 @@ static bool _monster_swaps_places( monsters *mon, const coord_def& delta ) mon->check_redraw(c); mon->apply_location_effects(c); + m2->check_redraw(c); m2->apply_location_effects(n); return (false); |