summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-03 20:13:05 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-03 20:13:05 +0000
commitf681507d16fe97426545dffe4c2827bb878f5f7f (patch)
treec6512341f85e465934ee828f8264a15bcb015e6d /crawl-ref/source/monstuff.cc
parentc07f2c46323c57f9d5699293e3e4458d5bbacde5 (diff)
downloadcrawl-ref-f681507d16fe97426545dffe4c2827bb878f5f7f.tar.gz
crawl-ref-f681507d16fe97426545dffe4c2827bb878f5f7f.zip
Add an auto_exclude option that will automatically set a travel
exclusion if any monster on this list is encountered during exploration and it's either asleep or stationary. This also works during manual exploration to cover cases where only the first monster is announced and stops autoexplore but there are more monsters in the room that would fit the criteria, such as in the oklob vaults. (Players who insist on exploring manually will have to simply leave this option empty.) Once you kill the monster (or someone else does it for you, as long as you are there to watch it) or it wakes up with you in sight, this exclusion automatically is removed again. By default the setting is: auto_exclude = oklob plant,silver statue,orange crystal statue git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7109 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index ede0784ae7..f2549cd11d 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -775,6 +775,9 @@ void monster_die(monsters *monster, killer_type killer,
// Update list of monsters beholding player.
update_beholders(monster, true);
+ // Clear auto exclusion now the monster is killed.
+ remove_auto_exclude(monster);
+
const int monster_killed = monster_index(monster);
const bool hard_reset = testbits(monster->flags, MF_HARD_RESET);
const bool gives_xp = !monster->has_ench(ENCH_ABJ);
@@ -7603,6 +7606,11 @@ void seen_monster(monsters *monster)
// First time we've seen this particular monster.
monster->flags |= MF_SEEN;
+ // If the monster is in the auto_exclude list, automatically
+ // set an exclusion.
+ if (need_auto_exclude(monster) && !is_exclude_root(monster->pos()))
+ toggle_exclude(monster->pos());
+
if (!mons_is_mimic(monster->type)
&& MONST_INTERESTING(monster)
&& monster->type != MONS_PANDEMONIUM_DEMON