diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-08 14:01:16 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-08 14:01:16 +0000 |
commit | c7ab36b8b51c2fa925fd5245d31e5f98cfa466e0 (patch) | |
tree | f121170da25495ab7f6deaedfeac493c4fb201e2 /crawl-ref/source/fight.cc | |
parent | c0976eb78b1c1319e427b449073d532d033dee50 (diff) | |
download | crawl-ref-c7ab36b8b51c2fa925fd5245d31e5f98cfa466e0.tar.gz crawl-ref-c7ab36b8b51c2fa925fd5245d31e5f98cfa466e0.zip |
Ghosts can use ensorcelled hibernation. Breaks saves, needs some work on PC sleep and wake-up correctness.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2377 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 857daf5109..e09e30410b 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2886,6 +2886,17 @@ int melee_attack::mons_calc_damage(const mon_attack_def &attk) if (water_attack) damage *= 2; + // If the defender is asleep, the attacker gets a stab. + if (defender && defender->asleep()) + { + damage = damage * 5 / 2; +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Stab damage vs %s: %d", + defender->name(DESC_PLAIN).c_str(), + damage); +#endif + } + return (mons_apply_defender_ac(damage, damage_max)); } |