diff options
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 9bfc3ead91..4b033bb609 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -869,11 +869,7 @@ bool melee_attack::player_apply_aux_unarmed() stab_bonus = 0; aux_damage = player_apply_monster_ac(aux_damage); - if (aux_damage < 1) - aux_damage = 0; - else - hurt_monster(def, aux_damage); - + aux_damage = hurt_monster(def, aux_damage); damage_done = aux_damage; if (damage_done > 0) @@ -1437,7 +1433,7 @@ int melee_attack::player_weapon_type_modify(int damage) bool melee_attack::player_hurt_monster() { - return damage_done && hurt_monster(def, damage_done); + return damage_done && (damage_done = hurt_monster(def, damage_done)); } void melee_attack::player_exercise_combat_skills() @@ -1480,14 +1476,20 @@ bool melee_attack::player_monattk_hit_effects(bool mondied) if (mondied && damage_brand == SPWPN_VAMPIRICISM) { if (defender->holiness() == MH_NATURAL - && damage_done > 0 && you.hp < you.hp_max + && damage_done > 0 + && you.hp < you.hp_max && !one_chance_in(5)) { mpr("You feel better."); // more than if not killed - int heal = 1 + random2(damage_done); + const int heal = 1 + random2(damage_done); +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, + "Vampiric healing: damage %d, healed %d", + damage_done, heal); +#endif inc_hp(heal, false); if (you.hunger_state != HS_ENGORGED) @@ -1525,8 +1527,7 @@ bool melee_attack::player_monattk_hit_effects(bool mondied) if (needs_message && !special_damage_message.empty()) mprf("%s", special_damage_message.c_str()); - - hurt_monster(def, special_damage); + special_damage = hurt_monster(def, special_damage); if (def->hit_points < 1) { |