From 8f9d46bf1414be7cbe44a9c38689879ab8eb4031 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 1 Oct 2007 08:50:12 +0000 Subject: Restore vampiric healing for killing blows (jarpiain). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2280 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/fight.cc') 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); -- cgit v1.2.3-54-g00ecf