summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorelliptic <hyperelliptical@gmail.com>2014-03-13 22:21:27 -0400
committerelliptic <hyperelliptical@gmail.com>2014-03-13 23:51:32 -0400
commit90beda913c822342c3f663b078814078da1a5bc0 (patch)
treef9966f5c2f354e624f08f63e68cbe3e2bdbd4dd9 /crawl-ref/source/misc.cc
parent31db9b4381e46cdd2327bc5c8d0cada6d78be03b (diff)
downloadcrawl-ref-90beda913c822342c3f663b078814078da1a5bc0.tar.gz
crawl-ref-90beda913c822342c3f663b078814078da1a5bc0.zip
Take regeneration rate into account when displaying poison level.
Previously "lethally poisoned" often didn't actually mean the poison would be lethal if you rested it off, since it didn't take into account natural regeneration. This made a lot of the poison display useless in many situations. This commit adds functions poison_is_lethal() and poison_survival(), the latter of which returns the expected lowest that your HP will go based on your current poison level and regeneration rate. This function is occasionally off by one, hopefully always in the direction of surviving with one more HP than expected... so occasionally "lethal" poison will just leave you at 1 HP.
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 8f92bc02c9..71aaa1054f 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1592,7 +1592,7 @@ bool i_feel_safe(bool announce, bool want_move, bool just_monsters,
if (is_sanctuary(you.pos()) && env.sanctuary_time >= 5)
return true;
- if (get_player_poisoning() >= you.hp)
+ if (poison_is_lethal())
{
if (announce)
mprf(MSGCH_WARN, "There is a lethal amount of poison in your body!");