summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-22 13:42:49 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-22 13:42:49 +0000
commitb794d555277836316ec842421c5287ff50641ff9 (patch)
tree71af9d043989c3a41d1619da84077eb35bc74b5d /crawl-ref/source/player.cc
parentdfebce7241da1ef5b2506cb175b9abf5eb32e533 (diff)
downloadcrawl-ref-b794d555277836316ec842421c5287ff50641ff9.tar.gz
crawl-ref-b794d555277836316ec842421c5287ff50641ff9.zip
Added option 'autopickup_no_burden' which, if set, will prevent autopickup
from picking up items beyond the burden limit. (Partial pickup will take place if you can take some of the items for a stack, e.g., 3 of the 5 potions of healing.) Defaults to false. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@692 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index e48b343516..84f08d09bb 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2007,10 +2007,15 @@ unsigned char player_sust_abil(bool calc_unid)
return sa;
} // end player_sust_abil()
-int carrying_capacity(void)
+int carrying_capacity( burden_state_type bs )
{
- // Originally: 1000 + you.strength * 200 + ( you.levitation ? 1000 : 0 )
- return (3500 + (you.strength * 100) + (player_is_levitating() ? 1000 : 0));
+ int cap = 3500+(you.strength * 100)+(player_is_levitating() ? 1000 : 0);
+ if ( bs == BS_UNENCUMBERED )
+ return (cap * 5) / 6;
+ else if ( bs == BS_ENCUMBERED )
+ return (cap * 11) / 12;
+ else
+ return cap;
}
int burden_change(void)
@@ -2019,8 +2024,6 @@ int burden_change(void)
you.burden = 0;
- int max_carried = carrying_capacity();
-
if (you.duration[DUR_STONEMAIL])
you.burden += 800;
@@ -2046,8 +2049,7 @@ int burden_change(void)
set_redraw_status( REDRAW_BURDEN );
// changed the burdened levels to match the change to max_carried
- if (you.burden < (max_carried * 5) / 6)
- // (you.burden < max_carried - 1000)
+ if (you.burden < carrying_capacity(BS_UNENCUMBERED))
{
you.burden_state = BS_UNENCUMBERED;
@@ -2055,8 +2057,7 @@ int burden_change(void)
if (old_burdenstate != you.burden_state)
mpr("Your possessions no longer seem quite so burdensome.");
}
- else if (you.burden < (max_carried * 11) / 12)
- // (you.burden < max_carried - 500)
+ else if (you.burden < carrying_capacity(BS_ENCUMBERED))
{
you.burden_state = BS_ENCUMBERED;