summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.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/ouch.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/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 282de8504e..1e45959c76 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -1124,7 +1124,7 @@ void ouch(int dam, int death_source, kill_method_type death_type,
{
if (Options.hp_warning
&& you.hp <= (you.hp_max * Options.hp_warning) / 100
- && (death_type != KILLED_BY_POISON || get_player_poisoning() > you.hp))
+ && (death_type != KILLED_BY_POISON || poison_is_lethal()))
{
mprf(MSGCH_DANGER, "* * * LOW HITPOINT WARNING * * *");
dungeon_events.fire_event(DET_HP_WARNING);