diff options
-rw-r--r-- | crawl-ref/source/fight.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 7d8471429e..9bfc3ead91 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -868,7 +868,7 @@ bool melee_attack::player_apply_aux_unarmed() // Clear stab bonus which will be set for the primary weapon attack. stab_bonus = 0; aux_damage = player_apply_monster_ac(aux_damage); - + if (aux_damage < 1) aux_damage = 0; else @@ -893,7 +893,8 @@ bool melee_attack::player_apply_aux_unarmed() did_god_conduct(DID_KILL_ANGEL, 1); // normal vampiric biting attack - if (damage_brand == SPWPN_VAMPIRICISM && mons_holiness(def) == MH_NATURAL) + if (damage_brand == SPWPN_VAMPIRICISM + && defender->holiness() == MH_NATURAL) { const int chunk_type = mons_corpse_effect( def->type ); @@ -1475,6 +1476,27 @@ bool melee_attack::player_monattk_hit_effects(bool mondied) did_god_conduct(DID_UNHOLY, 1); } + // Vampiric effects for the killing blow. + if (mondied && damage_brand == SPWPN_VAMPIRICISM) + { + if (defender->holiness() == MH_NATURAL + && 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); + + inc_hp(heal, false); + + if (you.hunger_state != HS_ENGORGED) + lessen_hunger(30 + random2avg(59, 2), true); + + did_god_conduct(DID_NECROMANCY, 2); + } + } + if (mondied) return (true); |