summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-07-26 16:35:56 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-26 16:37:09 -0700
commit13f7132bae4216fb745791bc97984f6fe091d5d1 (patch)
tree24583540cd175c5495d24dcd07b6b9757571fb5d /crawl-ref/source/fight.cc
parent61cafb898b3e8e6c4eb1866a7f57b7ac7418755b (diff)
downloadcrawl-ref-13f7132bae4216fb745791bc97984f6fe091d5d1.tar.gz
crawl-ref-13f7132bae4216fb745791bc97984f6fe091d5d1.zip
Refactor acid resistance
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 85452d70ce..6a47fc045b 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -524,9 +524,8 @@ static inline int get_resistible_fraction(beam_type flavour)
/**
* Adjusts damage for elemental resists, electricity and poison.
*
- * FIXME: Does not (yet) handle life draining, player acid damage
- * (does handle monster acid damage), miasma, and other exotic
- * attacks.
+ * FIXME: Does not (yet) handle draining (?), miasma, and other exotic attacks.
+ * XXX: which other attacks?
*
* @param defender The victim of the attack.
* @param flavour The type of attack having its damage adjusted.
@@ -553,7 +552,9 @@ int resist_adjust_damage(const actor* defender, beam_type flavour, int res,
if (res > 0)
{
- if (((is_mon || flavour == BEAM_NEG) && res >= 3) || res > 3)
+ const bool immune_at_3_res = is_mon || flavour == BEAM_NEG
+ || flavour == BEAM_ACID;
+ if (immune_at_3_res && res >= 3 || res > 3)
resistible = 0;
else
{