summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-01 08:50:12 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-01 08:50:12 +0000
commit8f9d46bf1414be7cbe44a9c38689879ab8eb4031 (patch)
tree16e8c2653620f755d5febd5c54b820c447d5b978 /crawl-ref/source/fight.cc
parentde2ef98bacd84d676d75948fa33075fa55b99c18 (diff)
downloadcrawl-ref-8f9d46bf1414be7cbe44a9c38689879ab8eb4031.tar.gz
crawl-ref-8f9d46bf1414be7cbe44a9c38689879ab8eb4031.zip
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
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc26
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);