diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-11-05 16:22:35 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-11-05 16:22:35 +0100 |
commit | 259a353db2a544831c572146cf50bdafcdc4ed5d (patch) | |
tree | 7c215a193ad91f80c7e7b0733e7b6655ede7490b /crawl-ref/source/player.cc | |
parent | 8a71b54ce2a022bdd79680e19f88d9c600a0fc4e (diff) | |
download | crawl-ref-259a353db2a544831c572146cf50bdafcdc4ed5d.tar.gz crawl-ref-259a353db2a544831c572146cf50bdafcdc4ed5d.zip |
Move rot_player() to player::rot() (Zaba)
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index e1bcf50a2d..905843576b 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5433,34 +5433,6 @@ void dec_disease_player() } } -bool rot_player(int amount) -{ - ASSERT(!crawl_state.arena); - - if (amount <= 0) - return (false); - - if (you.res_rotting()) - { - mpr("You feel terrible."); - return (false); - } - - if (you.rotting < 40) - { - // Either this, or the actual rotting message should probably - // be changed so that they're easier to tell apart. -- bwr - mprf(MSGCH_WARN, "You feel your flesh %s away!", - you.rotting > 0 ? "rotting" : "start to rot"); - - you.rotting += amount; - - learned_something_new(TUT_YOU_ROTTING); - } - - return (true); -} - int count_worn_ego(int which_ego) { int result = 0; @@ -6861,13 +6833,31 @@ void player::drain_stat(int stat, int amount, actor *attacker) bool player::rot(actor *who, int amount, int immediate, bool quiet) { - if (this->res_rotting() || amount <= 0) + ASSERT(!crawl_state.arena); + + if (amount <= 0) + return (false); + + if (you.res_rotting()) + { + mpr("You feel terrible."); return (false); + } if (immediate > 0) rot_hp(immediate); - rot_player(amount); + if (you.rotting < 40) + { + // Either this, or the actual rotting message should probably + // be changed so that they're easier to tell apart. -- bwr + mprf(MSGCH_WARN, "You feel your flesh %s away!", + you.rotting > 0 ? "rotting" : "start to rot"); + + you.rotting += amount; + + learned_something_new(TUT_YOU_ROTTING); + } if (one_chance_in(4)) disease_player(50 + random2(100)); |