diff options
author | elliptic <hyperelliptical@gmail.com> | 2012-09-20 00:08:21 -0400 |
---|---|---|
committer | elliptic <hyperelliptical@gmail.com> | 2012-09-20 00:10:56 -0400 |
commit | 5d399064b6427ae31d3ce39e44d9526da9d71a68 (patch) | |
tree | 0d3025581a57ff615a603907d0dcd941c6fc5290 /crawl-ref/source/player-stats.cc | |
parent | ad5ac8db5d51f284ba5a119c9e8da08bae042386 (diff) | |
download | crawl-ref-5d399064b6427ae31d3ce39e44d9526da9d71a68.tar.gz crawl-ref-5d399064b6427ae31d3ce39e44d9526da9d71a68.zip |
Fix stats being capped below at zero in situations where they shouldn't be.
Specifically, for checking whether a stat is drained and for output.
You can now get the uncapped stats with you.strength(false), you.intel(false),
and you.dex(false).
Diffstat (limited to 'crawl-ref/source/player-stats.cc')
-rw-r--r-- | crawl-ref/source/player-stats.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/player-stats.cc b/crawl-ref/source/player-stats.cc index 1046ce26bc..56fd6d08ad 100644 --- a/crawl-ref/source/player-stats.cc +++ b/crawl-ref/source/player-stats.cc @@ -31,19 +31,19 @@ int player::stat(stat_type s, bool nonneg) const return (nonneg ? max(val, 0) : val); } -int player::strength() const +int player::strength(bool nonneg) const { - return stat(STAT_STR); + return stat(STAT_STR, nonneg); } -int player::intel() const +int player::intel(bool nonneg) const { - return stat(STAT_INT); + return stat(STAT_INT, nonneg); } -int player::dex() const +int player::dex(bool nonneg) const { - return stat(STAT_DEX); + return stat(STAT_DEX, nonneg); } static int _stat_modifier(stat_type stat); |