diff options
author | Chris Campbell <chriscampbell89@gmail.com> | 2014-07-25 06:28:43 +0100 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2014-07-25 21:30:33 +0100 |
commit | de178d7cde5e9e62b68406bd3685819d0aed721f (patch) | |
tree | 503ddeb3d264a4122aaf553a836c91afc6f51047 /crawl-ref/source/ouch.cc | |
parent | d54d80d0058b7467c579a32e31c67a17ae467146 (diff) | |
download | crawl-ref-de178d7cde5e9e62b68406bd3685819d0aed721f.tar.gz crawl-ref-de178d7cde5e9e62b68406bd3685819d0aed721f.zip |
Revert "Put heavily drained players out of their misery"
Heavy draining already recovers quickly, such that it should be possible to
recover even when killing low-XP monsters. If very heavy draining is still
problematic, it might be better to scale down draining when already heavily
drained, rather than making it behave in a different way entirely past a
certain point.
This reverts commit bc4cca05f1829bd4bb812008c01682b204ee4975 and commit
1c0d6e64a9a9.
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r-- | crawl-ref/source/ouch.cc | 56 |
1 files changed, 8 insertions, 48 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 6d2f212d86..7a3de71ccc 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -257,11 +257,7 @@ int check_your_resists(int hurted, beam_type flavour, string source, hurted, true); if (doEffects) - { - drain_player(min(75, 35 + original * 2 / 3), - beam ? beam->beam_source : -1, - source.c_str(), true); - } + drain_player(min(75, 35 + original * 2 / 3), true); break; case BEAM_ICE: @@ -514,15 +510,12 @@ void lose_level(int death_source, const char *aux) * Drain the player. * * @param power The amount by which to drain the player. - * @param death_source The index of the monster causing the draining. - * @param cause The source of the draining. (May be null.) * @param announce_full Whether to print messages even when fully resisting * the drain. * @param ignore_protection Whether to ignore the player's rN. * @return Whether draining occurred. */ -bool drain_player(int power, int death_source, const char* cause, - bool announce_full, bool ignore_protection) +bool drain_player(int power, bool announce_full, bool ignore_protection) { const int protection = player_prot_life(); @@ -540,52 +533,22 @@ bool drain_player(int power, int death_source, const char* cause, power /= (protection * 2); } - if (power <= 0) - return false; - - // at xl27, at worst go from skill 27 to ~19 - // at xl1, at worst go from skill 3 to 1, or 4 to 2 - const int MAX_DRAIN = ignore_protection ? INT_MAX : - 150 + you.experience_level * 10; - const int drain_power = max(0, - min(MAX_DRAIN - you.attribute[ATTR_XP_DRAIN], - power)); - const int pain_power = power - drain_power; - - if (pain_power) - { - mpr("You feel horribly drained!"); - xom_is_stimulated(25); - } - else + if (power > 0) { mpr("You feel drained."); xom_is_stimulated(15); - } - if (drain_power) - { - you.attribute[ATTR_XP_DRAIN] += drain_power; + you.attribute[ATTR_XP_DRAIN] += power; // Losing skills may affect AC/EV. you.redraw_armour_class = true; you.redraw_evasion = true; - dprf("Drained by %d points (%d total)", drain_power, - you.attribute[ATTR_XP_DRAIN]); - } + dprf("Drained by %d points (%d total)", power, you.attribute[ATTR_XP_DRAIN]); - if (pain_power) - { - // -- just die already! - const int pain_damage = pain_power / 5 - + get_real_hp(true) * pain_power / 200; - ouch(pain_damage, death_source, KILLED_BY_DRAINING, NULL, - announce_full, cause, false); - dprf("%d overflow drain/pain points -> %d damage", pain_power, - pain_damage); + return true; } - return true; + return false; } static void _xom_checks_damage(kill_method_type death_type, @@ -992,10 +955,7 @@ void ouch(int dam, int death_source, kill_method_type death_type, _maybe_fog(dam); _powered_by_pain(dam); if (drain_amount > 0) - { - drain_player(drain_amount, death_source, - "taking damage in shadow form", true, true); - } + drain_player(drain_amount, true, true); } if (you.hp > 0) return; |