diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-02 07:59:12 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-02 07:59:12 +0000 |
commit | 07eadf8e4cf3dd61fa66d194720143685ab84174 (patch) | |
tree | 60ca13a09c47d9c6a7b0d871bac374f057134e85 /crawl-ref/source/fight.cc | |
parent | d03bcac5636625a61db20500a51418227316b34b (diff) | |
download | crawl-ref-07eadf8e4cf3dd61fa66d194720143685ab84174.tar.gz crawl-ref-07eadf8e4cf3dd61fa66d194720143685ab84174.zip |
Merge r7717 and r7718: improvements to interrupted butchery behaviour.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@7719 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 8dfbb0aafe..676c72386a 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3847,8 +3847,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(); @@ -3977,7 +3978,7 @@ void melee_attack::mons_perform_attack_rounds() defender->hurt(attacker, damage_done + special_damage); if (!defender->alive() || attacker == defender) - return; + break; special_damage = 0; special_damage_message.clear(); @@ -3997,6 +3998,13 @@ void melee_attack::mons_perform_attack_rounds() set_ident_flags( *weap, ISFLAG_KNOW_CURSE ); } } + + // 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() |