From b794d555277836316ec842421c5287ff50641ff9 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 22 Dec 2006 13:42:49 +0000 Subject: 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 --- crawl-ref/source/player.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/player.cc') 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; -- cgit v1.2.3-54-g00ecf