diff options
author | Steve Melenchuk <smelenchuk@gmail.com> | 2014-02-15 18:50:14 -0700 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2014-02-15 18:50:14 -0700 |
commit | 59b0af933f2f1d0ffca26c9dc7a889e44ed321f8 (patch) | |
tree | eecb57f7543f08a45ba875f0bd2cae8e6f434287 /crawl-ref/source/ouch.cc | |
parent | 91d52adc3bd71d278d1c9d06759fe00898681eef (diff) | |
download | crawl-ref-59b0af933f2f1d0ffca26c9dc7a889e44ed321f8.tar.gz crawl-ref-59b0af933f2f1d0ffca26c9dc7a889e44ed321f8.zip |
Shadow Form skill-drains on taking damage.
Basically, think of it splitting damage between HP and skills.
It may still be too powerful.
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r-- | crawl-ref/source/ouch.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 2db296efd6..cf08851a9f 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -1017,6 +1017,8 @@ void ouch(int dam, int death_source, kill_method_type death_type, if (you.dead) // ... but eligible for revival return; + int drain_amount = 0; + if (attacker_effects && dam != INSTANT_DEATH && !invalid_monster_index(death_source) && menv[death_source].has_ench(ENCH_WRETCHED)) @@ -1047,7 +1049,10 @@ void ouch(int dam, int death_source, kill_method_type death_type, if (dam != INSTANT_DEATH) { if (you.form == TRAN_SHADOW) + { + drain_amount = (dam - (dam / 2)); dam /= 2; + } if (you.petrified()) dam /= 2; else if (you.petrifying()) @@ -1139,6 +1144,8 @@ void ouch(int dam, int death_source, kill_method_type death_type, _maybe_spawn_jellies(dam, aux, death_type, death_source); _maybe_fog(dam); _powered_by_pain(dam); + if (drain_amount > 0) + drain_exp(true, drain_amount, true); } if (you.hp > 0) return; |