diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-02 06:39:09 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-02 06:39:09 +0000 |
commit | 00eb4216eab04d938358d9a382c4afacc4ff5a5f (patch) | |
tree | efad04e2ec0ac072dd4c77c6e3af9ed19febcd6b /crawl-ref/source/files.cc | |
parent | fa6393b63b270a07e02ce4c8333b23013b5ded75 (diff) | |
download | crawl-ref-00eb4216eab04d938358d9a382c4afacc4ff5a5f.tar.gz crawl-ref-00eb4216eab04d938358d9a382c4afacc4ff5a5f.zip |
Changed interrupted butchering behaviour as per Johanna's
suggestions/observations:
1) Get rid of option swap_when_safe and its behaviour.
2) If auto-swap butchery is interrupted by teleportation or chagning levels
(banishment) then auto-swap back if there's no monsters nearby.
2b) Do the same if butchery is interrupted and then later a large position
change happens.
3) If auto-swap butchery is interrupted by something like poison damage,
if the butchery is resumed and finished then swap back.
4) If auto-swap butchery is interrupted by a monster, then if the
new option prompt_for_swap is set the game will ask if you wish to
swap back from your butchering tool.
4b) Do the same if butchery is interrupted and then later a large
position change lands you near some hostile monsters.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7717 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r-- | crawl-ref/source/files.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index cb3ea53ddf..4bdf77b5f1 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -7,6 +7,7 @@ */ #include "AppHdr.h" +#include "delay.h" #include "files.h" #include "version.h" @@ -1343,6 +1344,18 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, if (load_mode != LOAD_VISITOR) dungeon_events.fire_event(DET_ENTERED_LEVEL); + if (load_mode == LOAD_ENTER_LEVEL) + { + // If butchering was interrupted by switching levels (banishment) + // then switch back from butchering tool if there's no hostiles + // nearby. + handle_interrupted_swap(true); + + // Forget about interrupted butchering, since we probably aren't going + // to get back to the corpse in time to finish things. + you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0; + } + return just_created_level; } // end load() |