diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-26 16:35:56 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-26 16:37:09 -0700 |
commit | 13f7132bae4216fb745791bc97984f6fe091d5d1 (patch) | |
tree | 24583540cd175c5495d24dcd07b6b9757571fb5d /crawl-ref/source/ouch.cc | |
parent | 61cafb898b3e8e6c4eb1866a7f57b7ac7418755b (diff) | |
download | crawl-ref-13f7132bae4216fb745791bc97984f6fe091d5d1.tar.gz crawl-ref-13f7132bae4216fb745791bc97984f6fe091d5d1.zip |
Refactor acid resistance
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r-- | crawl-ref/source/ouch.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 7a3de71ccc..f4bd1d2ccf 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -287,12 +287,12 @@ int check_your_resists(int hurted, beam_type flavour, string source, break; case BEAM_ACID: - if (player_res_acid()) - { - if (doEffects) - canned_msg(MSG_YOU_RESIST); - hurted = hurted * player_acid_resist_factor() / 100; - } + mprf("pre-dam: %d", hurted); + hurted = resist_adjust_damage(&you, flavour, player_res_acid(), + hurted, true); + mprf("post-dam: %d", hurted); + if (hurted < original && doEffects) + canned_msg(MSG_YOU_RESIST); break; case BEAM_MIASMA: @@ -408,7 +408,9 @@ void splash_with_acid(int acid_strength, int death_source, bool allow_corrosion, dam += 2; dam = roll_dice(dam, acid_strength); - const int post_res_dam = dam * player_acid_resist_factor() / 100; + const int post_res_dam = resist_adjust_damage(&you, BEAM_ACID, + you.res_acid(), dam); + mprf("pre-dam: %d, post-dam: %d", dam, post_res_dam); if (post_res_dam > 0) { |