summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-21 03:05:53 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-21 03:05:53 +0000
commit68219010289d1bbfc2c31be65fa187e9ed7a61f5 (patch)
tree9c8de6e1813c2e8ec553c5b4772ab5c39a7080c4 /crawl-ref/source
parent40a5bf9e8b1a16569a2d4bbaf446bf1ea412ca43 (diff)
downloadcrawl-ref-68219010289d1bbfc2c31be65fa187e9ed7a61f5.tar.gz
crawl-ref-68219010289d1bbfc2c31be65fa187e9ed7a61f5.zip
Pacified monsters now leave the level after 20-40 turns elapse when
going between levels. Also, even stationary monsters can disappear, although only by doing that or getting far out of LOS. (Maybe pacification gives such monsters the power to move, for the sake of peace :) ?) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6028 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/effects.cc4
-rw-r--r--crawl-ref/source/monstuff.cc13
2 files changed, 7 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 23dd3a989a..84d082366f 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2851,8 +2851,8 @@ void update_level(double elapsedTime)
mons_total++;
#endif
- // Pacified monsters that can move leave the level.
- if (mons_is_pacified(mon) && !mons_is_truly_stationary(mon))
+ // Monsters that are leaving the level often do so now.
+ if (mons_is_leaving(mon) && turns > random2(20) + 21)
{
make_mons_leave_level(mon);
continue;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index f4bfeb84fb..32e5a62f62 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3006,7 +3006,7 @@ static void _handle_behaviour(monsters *mon)
break;
case BEH_WANDER:
- // Monsters that have been pacified leave the level.
+ // Monsters that have been pacified begin leaving the level.
if (mons_is_pacified(mon))
{
// XXX: Uncomment this next block to actually enable
@@ -3277,11 +3277,6 @@ static void _handle_behaviour(monsters *mon)
break;
case BEH_LEAVE:
- // If the monster can't move at all (or even teleport, as a
- // mimic would), it obviously can't leave, so get out.
- if (mons_is_truly_stationary(mon))
- break;
-
// If the monster is far enough away from the player, make
// it leave the level.
if (grid_distance(mon->x, mon->y, you.x_pos, you.y_pos)
@@ -3292,8 +3287,10 @@ static void _handle_behaviour(monsters *mon)
}
// If the monster isn't travelling toward someplace from
- // which it can leave the level, make it start doing so.
- if (mon->travel_target == MTRAV_NONE)
+ // which it can leave the level, and it can move (or at
+ // least teleport, as a mimic can), make it start doing so.
+ if (mon->travel_target == MTRAV_NONE
+ && !mons_is_truly_stationary(mon))
{
level_exit e;
if (_mons_find_nearest_level_exit(mon, e))