summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-02 06:39:09 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-02 06:39:09 +0000
commit00eb4216eab04d938358d9a382c4afacc4ff5a5f (patch)
treeefad04e2ec0ac072dd4c77c6e3af9ed19febcd6b /crawl-ref/source/fight.cc
parentfa6393b63b270a07e02ce4c8333b23013b5ded75 (diff)
downloadcrawl-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/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 7e702fd1a6..a47588edb9 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -4199,8 +4199,9 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk)
void melee_attack::mons_perform_attack_rounds()
{
- const int nrounds = atk->has_hydra_multi_attack() ? atk->number : 4;
- const coord_def pos = defender->pos();
+ const int nrounds = atk->has_hydra_multi_attack() ? atk->number : 4;
+ const coord_def pos = defender->pos();
+ const bool was_delayed = you_are_delayed();
// Melee combat, tell attacker to wield its melee weapon.
atk->wield_melee_weapon();
@@ -4379,6 +4380,13 @@ void melee_attack::mons_perform_attack_rounds()
if (def_copy)
delete def_copy;
+
+ // Inivislbe monster might have interrupted butchering.
+ if (was_delayed && defender->atype() == ACT_PLAYER && perceived_attack
+ && !attacker_visible)
+ {
+ handle_interrupted_swap(false, true);
+ }
}
bool melee_attack::mons_perform_attack()