summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgammafunk <gammafunk@gmail.com>2014-05-26 05:21:20 -0500
committergammafunk <gammafunk@gmail.com>2014-05-26 22:45:16 -0500
commit55d1b512e3395f07e9341ce9eae5079b581b6894 (patch)
tree811704017046d8ed62335bd1c45d36476e0dea55
parentb364f15f4eeff0e148b6fc026c01de1327254cd2 (diff)
downloadcrawl-ref-55d1b512e3395f07e9341ce9eae5079b581b6894.tar.gz
crawl-ref-55d1b512e3395f07e9341ce9eae5079b581b6894.zip
Remove player burden and carrying capacity
Item inventory weights (based on item mass) generally don't lead to meaningful decisions that justify the inventory juggling and interface problems that come from having burden states. The 52-slot limit is a better system for limiting inventory and providing inventory-related decisions because it's not so fine-grained and doesn't require the player to examine weights for each slot. Work is ongoing to improve the slot system by consolidating food types and handling strategic consumables in a different way.
-rw-r--r--crawl-ref/docs/options_guide.txt20
-rw-r--r--crawl-ref/settings/init.txt1
-rw-r--r--crawl-ref/source/chardump.cc20
-rw-r--r--crawl-ref/source/delay.cc6
-rw-r--r--crawl-ref/source/effects.cc5
-rw-r--r--crawl-ref/source/enum.h8
-rw-r--r--crawl-ref/source/exercise.cc5
-rw-r--r--crawl-ref/source/externs.h2
-rw-r--r--crawl-ref/source/food.cc60
-rw-r--r--crawl-ref/source/food.h2
-rw-r--r--crawl-ref/source/godprayer.cc5
-rw-r--r--crawl-ref/source/hints.cc21
-rw-r--r--crawl-ref/source/hints.h2
-rw-r--r--crawl-ref/source/initfile.cc16
-rw-r--r--crawl-ref/source/invent.cc54
-rw-r--r--crawl-ref/source/invent.h2
-rw-r--r--crawl-ref/source/itemprop.cc6
-rw-r--r--crawl-ref/source/items.cc175
-rw-r--r--crawl-ref/source/items.h7
-rw-r--r--crawl-ref/source/l_food.cc4
-rw-r--r--crawl-ref/source/l_option.cc1
-rw-r--r--crawl-ref/source/l_you.cc4
-rw-r--r--crawl-ref/source/main.cc11
-rw-r--r--crawl-ref/source/misc.cc37
-rw-r--r--crawl-ref/source/misc.h2
-rw-r--r--crawl-ref/source/mon-util.cc2
-rw-r--r--crawl-ref/source/options.h2
-rw-r--r--crawl-ref/source/output.cc3
-rw-r--r--crawl-ref/source/output.h3
-rw-r--r--crawl-ref/source/player-act.cc20
-rw-r--r--crawl-ref/source/player-stats.cc3
-rw-r--r--crawl-ref/source/player.cc101
-rw-r--r--crawl-ref/source/player.h8
-rw-r--r--crawl-ref/source/shopping.cc1
-rw-r--r--crawl-ref/source/spl-summoning.cc2
-rw-r--r--crawl-ref/source/startup.cc1
-rw-r--r--crawl-ref/source/status.cc26
-rw-r--r--crawl-ref/source/status.h1
-rw-r--r--crawl-ref/source/tag-version.h1
-rw-r--r--crawl-ref/source/tags.cc7
-rw-r--r--crawl-ref/source/transform.cc3
-rw-r--r--crawl-ref/source/wiz-fsim.cc2
-rw-r--r--crawl-ref/source/wiz-you.cc1
-rw-r--r--crawl-ref/source/xom.cc1
44 files changed, 111 insertions, 553 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index 29678580b4..5c10abdee1 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -62,14 +62,13 @@ The contents of this text are:
3-i Message and Display Improvements.
hp_warning, mp_warning, hp_colour, mp_colour, stat_colour,
status_caption_colour, enemy_hp_colour, clear_messages,
- show_more, small_more, show_inventory_weights,
- show_newturn_mark, show_gold_turns, show_game_turns,
- item_stack_summary_minimum,
+ show_more, small_more, show_newturn_mark, show_gold_turns,
+ show_game_turns, item_stack_summary_minimum,
mlist_min_height, mlist_allow_alternate_layout,
mlist_targeting, msg_min_height, msg_max_height,
- messages_at_top, skill_focus,
- msg_condense_repeats, msg_condense_short, show_travel_trail,
- monster_list_colour, view_delay, force_more_message
+ messages_at_top, skill_focus, msg_condense_repeats,
+ msg_condense_short, show_travel_trail, monster_list_colour,
+ view_delay, force_more_message
3-j Colours (messages and menus)
menu_colour, message_colour
3-k Missiles.
@@ -1291,15 +1290,6 @@ small_more = false
small_more = true, it is just the bottom left character if
clear_messages is not set.
-show_inventory_weights = drop_pickup|true|false
- When this is set to true, inventory listings will mention the
- weight of each item. When set to "drop_pickup" (the default), or
- indeed any value other than true/false/yes/no, the menus for
- picking up and dropping items will list item weights, but other
- inventory menus will not.
- Note: This option doesn't currently work for Tiles unless you use
- tile_menu_icons = false.
-
show_newturn_mark = true
When set to false, this option disables the underscore (_) displayed in
front of the first line of a turn.
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index bcb6356fa1..0314439722 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -207,7 +207,6 @@
# clear_messages = true
# small_more = true
# show_more = false
-# show_inventory_weights = (drop_pickup | true | false)
# show_newturn_mark = false
# show_gold_turns = false
# show_game_turns = false
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index 8602769b2d..740f4653df 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -70,7 +70,6 @@ static void _sdump_header(dump_params &);
static void _sdump_stats(dump_params &);
static void _sdump_location(dump_params &);
static void _sdump_religion(dump_params &);
-static void _sdump_burden(dump_params &);
static void _sdump_hunger(dump_params &);
static void _sdump_transform(dump_params &);
static void _sdump_visits(dump_params &);
@@ -125,7 +124,6 @@ static dump_section_handler dump_handlers[] =
{ "stats", _sdump_stats },
{ "location", _sdump_location },
{ "religion", _sdump_religion },
- { "burden", _sdump_burden },
{ "hunger", _sdump_hunger },
{ "transform", _sdump_transform },
{ "visits", _sdump_visits },
@@ -218,23 +216,6 @@ static void _sdump_stats(dump_params &par)
par.text += "\n\n";
}
-static void _sdump_burden(dump_params &par)
-{
- string verb = par.se? "were" : "are";
-
- switch (you.burden_state)
- {
- case BS_OVERLOADED:
- par.text += "You " + verb + " overloaded with stuff.\n";
- break;
- case BS_ENCUMBERED:
- par.text += "You " + verb + " encumbered.\n";
- break;
- default:
- break;
- }
-}
-
static void _sdump_hunger(dump_params &par)
{
if (par.se)
@@ -491,7 +472,6 @@ static void _sdump_misc(dump_params &par)
{
_sdump_location(par);
_sdump_religion(par);
- _sdump_burden(par);
_sdump_hunger(par);
_sdump_transform(par);
_sdump_visits(par);
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 584e3ffd95..d4541054c8 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1806,9 +1806,9 @@ bool interrupt_activity(activity_interrupt_type ai,
static const char *activity_interrupt_names[] =
{
- "force", "keypress", "full_hp", "full_mp", "statue",
- "hungry", "message", "hp_loss", "burden", "stat",
- "monster", "monster_attack", "teleport", "hit_monster", "sense_monster"
+ "force", "keypress", "full_hp", "full_mp", "statue", "hungry", "message",
+ "hp_loss", "stat", "monster", "monster_attack", "teleport", "hit_monster",
+ "sense_monster"
};
static const char *_activity_interrupt_name(activity_interrupt_type ai)
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 5ec9767e5e..c3b78d22c7 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1778,9 +1778,7 @@ static void _rot_inventory_food(int time_delta)
if (item.base_type == OBJ_POTIONS)
{
- // Also handles messaging.
- if (maybe_coagulate_blood_potions_inv(item))
- burden_changed_by_rot = true;
+ maybe_coagulate_blood_potions_inv(item);
continue;
}
@@ -1944,7 +1942,6 @@ static void _rot_inventory_food(int time_delta)
msg += "rotted away.";
mprf(MSGCH_ROTTEN_MEAT, "%s", msg.c_str());
}
- burden_change();
}
}
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 6250297814..a267636b8e 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -252,7 +252,6 @@ enum activity_interrupt_type
AI_HUNGRY, // Hunger increased
AI_MESSAGE, // Message was displayed
AI_HP_LOSS,
- AI_BURDEN_CHANGE,
AI_STAT_CHANGE,
AI_SEE_MONSTER,
AI_MONSTER_ATTACKS,
@@ -600,13 +599,6 @@ enum branch_type // you.where_are_you
NUM_BRANCHES
};
-enum burden_state_type // you.burden_state
-{ // these values increase hunger and divide stealth
- BS_UNENCUMBERED = 0,
- BS_ENCUMBERED = 2,
- BS_OVERLOADED = 5,
-};
-
enum caction_type // Primary categorization of counted actions.
{ // A subtype will also be given in each case:
CACT_MELEE, // weapon subtype or unrand index
diff --git a/crawl-ref/source/exercise.cc b/crawl-ref/source/exercise.cc
index 0787e441f2..bab81a6ce3 100644
--- a/crawl-ref/source/exercise.cc
+++ b/crawl-ref/source/exercise.cc
@@ -291,7 +291,6 @@ static void _check_train_sneak(bool invis)
const item_def *body_armour = you.slot_item(EQ_BODY_ARMOUR, false);
const int armour_mass = body_armour? item_mass(*body_armour) : 0;
if (!x_chance_in_y(armour_mass, 1000)
- && you.burden_state == BS_UNENCUMBERED
&& !you.attribute[ATTR_SHADOWS]
// If invisible, training happens much more rarely.
&& (!invis && one_chance_in(25) || one_chance_in(100)))
@@ -307,9 +306,7 @@ static void _exercise_passive()
// Armour trained in check_train_armour
}
// Exercise stealth skill:
- else if (you.burden_state == BS_UNENCUMBERED
- && !you.berserk()
- && !you.attribute[ATTR_SHADOWS])
+ else if (!you.berserk() && !you.attribute[ATTR_SHADOWS])
{
const item_def *body_armour = you.slot_item(EQ_BODY_ARMOUR, false);
const int armour_mass = body_armour? item_mass(*body_armour) : 0;
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index dd9bf6e8ec..4c8de576d4 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -63,8 +63,6 @@ protected:
#define ITEMNAME_SIZE 200 // size of item names/shop names/etc
#define HIGHSCORE_SIZE 800 // <= 10 Lines for long format scores
-#define BURDEN_TO_AUM 0.1f // scale factor for converting burden to aum
-
extern char info[INFO_SIZE]; // defined in main.cc {dlb}
#define kNameLen 30
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 8a0618bbcf..b1dc318f2d 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -667,8 +667,6 @@ bool prompt_eat_inventory_item(int slot)
return false;
eat_item(item);
-
- burden_change();
you.turn_is_over = true;
return true;
@@ -2424,31 +2422,18 @@ static bool _compare_second(const pair<int, int> &a, const pair<int, int> &b)
return a.second < b.second;
}
-static int _chunk_mass()
-{
- item_def chunk;
- chunk.base_type = OBJ_FOOD;
- chunk.sub_type = FOOD_CHUNK;
- return item_mass(chunk);
-}
-
/**
- * Try to make space in the inventory. Caller must call pickup_burden() later.
- * @param num_needed Try to free at least that much carrying capacity.
+ * Try to free an inventory slot by dropping a stack of chunks.
+ * @returns True if a stack was dropped, false otherwise.
**/
-maybe_bool drop_spoiled_chunks(int weight_needed, bool whole_slot)
+bool drop_spoiled_chunks()
{
if (Options.auto_drop_chunks == ADC_NEVER)
- return MB_FALSE;
-
- int num_needed = 1 + (weight_needed - 1) / _chunk_mass();
+ return false;
bool wants_any = you.has_spell(SPELL_SIMULACRUM)
|| you.has_spell(SPELL_SUBLIMATION_OF_BLOOD);
-
int nchunks = 0;
- maybe_bool result = MB_FALSE;
-
vector<pair<int, int> > chunk_slots;
for (int slot = 0; slot < ENDOFPACK; slot++)
{
@@ -2463,54 +2448,37 @@ maybe_bool drop_spoiled_chunks(int weight_needed, bool whole_slot)
bool rotten = food_is_rotten(item);
if (rotten && !you.mutation[MUT_SAPROVOROUS] && !wants_any)
- {
- num_needed -= item.quantity;
- if (!drop_item(slot, item.quantity))
- return result; // level full, error out
- if (num_needed <= 0)
- return MB_TRUE;
- result = MB_MAYBE; // at least a bit lighter
- continue;
- }
+ return drop_item(slot, item.quantity);
corpse_effect_type ce = _determine_chunk_effect(mons_corpse_effect(
item.mon_type),
rotten);
if (ce == CE_MUTAGEN || ce == CE_ROT)
continue; // no nutrition from those
- // We assume that carrying poisonous chunks means you can swap rPois in.
+ // We assume that carrying poisonous chunks means you can swap rPois in.
int badness = _corpse_badness(ce, item, wants_any);
-
nchunks += item.quantity;
chunk_slots.push_back(pair<int,int>(slot, badness));
}
// No rotten ones to drop, and we're not allowed to drop others.
if (Options.auto_drop_chunks == ADC_ROTTEN)
- return result;
+ return false;
nchunks -= _chunks_needed();
+ if (nchunks <= 0)
+ return false;
sort(chunk_slots.begin(), chunk_slots.end(), _compare_second);
-
- while (nchunks > 0 && !chunk_slots.empty())
+ while (!chunk_slots.empty())
{
int slot = chunk_slots.back().first;
chunk_slots.pop_back();
- int quant = min<int>(nchunks, you.inv[slot].quantity);
- if (whole_slot && quant < you.inv[slot].quantity)
- return result;
-
- if (!drop_item(slot, quant))
- return result; // level full, error out
-
- if (num_needed -= quant <= 0)
- return MB_TRUE;
-
- result = MB_MAYBE; // at least a bit lighter
+ // A slot was freed up.
+ if (nchunks >= you.inv[slot].quantity)
+ return drop_item(slot, you.inv[slot].quantity);
}
-
- return result;
+ return false;
}
diff --git a/crawl-ref/source/food.h b/crawl-ref/source/food.h
index 33c0fcddaf..333c585a28 100644
--- a/crawl-ref/source/food.h
+++ b/crawl-ref/source/food.h
@@ -74,5 +74,5 @@ bool you_foodless_normally();
void handle_starvation();
string hunger_cost_string(const int hunger);
-maybe_bool drop_spoiled_chunks(int weight_needed, bool whole_slot = false);
+bool drop_spoiled_chunks();
#endif
diff --git a/crawl-ref/source/godprayer.cc b/crawl-ref/source/godprayer.cc
index 0bc3e46051..7ef208a33e 100644
--- a/crawl-ref/source/godprayer.cc
+++ b/crawl-ref/source/godprayer.cc
@@ -133,16 +133,11 @@ static bool _bless_weapon(god_type god, brand_type brand, int colour)
origin_acquired(wpn, GOD_SHINING_ONE);
wpn.flags |= ISFLAG_BLESSED_WEAPON;
}
-
- burden_change();
}
else if (is_evil_god(god))
{
convert2bad(wpn);
-
wpn.flags &= ~ISFLAG_BLESSED_WEAPON;
-
- burden_change();
}
you.wield_change = true;
diff --git a/crawl-ref/source/hints.cc b/crawl-ref/source/hints.cc
index 7cf939691b..b4e92e1cd5 100644
--- a/crawl-ref/source/hints.cc
+++ b/crawl-ref/source/hints.cc
@@ -2007,18 +2007,9 @@ void learned_something_new(hints_event_type seen_what, coord_def gc)
cmd.push_back(CMD_PICKUP);
break;
- case HINT_HEAVY_LOAD:
- if (you.burden_state != BS_UNENCUMBERED)
- {
- text << "It is not usually a good idea to run around encumbered; "
- "it slows you down and increases your hunger.";
- }
- else
- {
- text << "Sadly, your inventory is limited to 52 items, and it "
- "appears your knapsack is full.";
- }
-
+ case HINT_FULL_INVENTORY:
+ text << "Sadly, your inventory is limited to 52 items, and it "
+ "appears your knapsack is full.";
text << " However, this is easy enough to rectify: simply "
"<w>%</w>rop some of the stuff you don't need or that's too "
"heavy to lug around permanently.";
@@ -2713,10 +2704,8 @@ void learned_something_new(hints_event_type seen_what, coord_def gc)
<< "</w>)"
#endif
", keep moving, don't fight any of the monsters, and don't "
- "bother picking up any items on the ground. If you're "
- "encumbered or overburdened, then lighten up your load, and if "
- "the monsters are closing in, try to use items of hasting to get "
- "away.";
+ "bother picking up any items on the ground. If the monsters "
+ "are closing in, try to use items of hasting to get away.";
break;
case HINT_SPELL_MISCAST:
diff --git a/crawl-ref/source/hints.h b/crawl-ref/source/hints.h
index 8d156d951e..2dedc4dec5 100644
--- a/crawl-ref/source/hints.h
+++ b/crawl-ref/source/hints.h
@@ -117,7 +117,7 @@ enum hints_event_type
HINT_ABYSS,
// interface
HINT_MULTI_PICKUP,
- HINT_HEAVY_LOAD,
+ HINT_FULL_INVENTORY,
HINT_SHIFT_RUN,
HINT_MAP_VIEW,
HINT_AUTO_EXPLORE,
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 93a55ce385..db47f66831 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -575,8 +575,8 @@ void game_options::set_default_activity_interrupts()
"interrupt_vampire_feed = interrupt_butcher",
"interrupt_multidrop = hp_loss, monster_attack, teleport, stat",
"interrupt_macro = interrupt_multidrop",
- "interrupt_travel = interrupt_butcher, statue, hungry, "
- "burden, hit_monster, sense_monster",
+ "interrupt_travel = interrupt_butcher, statue, hungry, hit_monster, "
+ "sense_monster",
"interrupt_run = interrupt_travel, message",
"interrupt_rest = interrupt_run, full_hp, full_mp",
@@ -800,7 +800,6 @@ void game_options::reset_options()
auto_switch = false;
suppress_startup_errors = false;
- show_inventory_weights = MB_MAYBE;
show_uncursed = true;
travel_open_doors = true;
easy_unequip = true;
@@ -816,7 +815,6 @@ void game_options::reset_options()
allow_self_target = CONFIRM_PROMPT;
hp_warning = 30;
magic_point_warning = 0;
- autopickup_no_burden = true;
skill_focus = SKM_FOCUS_ON;
user_note_prefix = "";
@@ -2616,15 +2614,6 @@ void game_options::read_option_line(const string &str, bool runscript)
else
report_error("Unknown show_god_gift value: %s\n", field.c_str());
}
- else if (key == "show_inventory_weights")
- {
- if (field == "yes" || field == "true")
- show_inventory_weights = MB_TRUE;
- else if (field == "no" || field == "false")
- show_inventory_weights = MB_FALSE;
- else
- show_inventory_weights = MB_MAYBE;
- }
else if (key == "fire_order")
set_fire_order(field, plus_equal, caret_equal);
#if !defined(DGAMELAUNCH) || defined(DGL_REMEMBER_NAME)
@@ -2657,7 +2646,6 @@ void game_options::read_option_line(const string &str, bool runscript)
macro_dir = field;
#endif
#endif
- else BOOL_OPTION(autopickup_no_burden);
#ifdef DGL_SIMPLE_MESSAGING
else BOOL_OPTION(messaging);
#endif
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 934b4a1545..c395ea9ef4 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -66,8 +66,7 @@ string InvTitle::get_text(const bool) const
}
InvEntry::InvEntry(const item_def &i, bool show_bg)
- : MenuEntry("", MEL_ITEM), show_background(show_bg), item(&i),
- show_weight(false)
+ : MenuEntry("", MEL_ITEM), show_background(show_bg), item(&i)
{
data = const_cast<item_def *>(item);
@@ -219,16 +218,7 @@ string InvEntry::get_text(bool need_cursor) const
if (InvEntry::show_glyph)
tstr << "(" << glyph_to_tagstr(get_item_glyph(item)) << ")" << " ";
- //For weights display we need to know maximum number of chars in each column
- //which fit in one line.
- //XXX There should be a better way to determine this, for now we simply
- //estimate it by the following heuristics {kittel}.
unsigned max_chars_in_line = get_number_of_cols() - 2;
-#ifdef USE_TILE_LOCAL
- if (Options.tile_menu_icons && show_weight)
- max_chars_in_line = get_number_of_cols() * 4 / 9 - 2;
-#endif
-
int colour_tag_adjustment = 0;
if (InvEntry::show_glyph)
{
@@ -238,29 +228,13 @@ string InvEntry::get_text(bool need_cursor) const
colour_tag_adjustment = colour_tag.size() * 2 + 5;
}
- if (show_weight)
- max_chars_in_line -= 1;
-
- const int w_weight = show_weight ? 10 //length of " (999 aum)"
- : 0;
const int excess = strwidth(tstr.str()) - colour_tag_adjustment
- + strwidth(text) + w_weight - max_chars_in_line;
+ + strwidth(text) - max_chars_in_line;
if (excess > 0)
tstr << chop_string(text, max(0, strwidth(text) - excess - 2)) << "..";
else
tstr << text;
- if (show_weight)
- {
- const int mass = item_mass(*item) * item->quantity;
- // Note: If updating the " (%i aum)" format, remember to update
- // w_weight above.
- tstr << setw(max_chars_in_line - strwidth(tstr.str())
- + colour_tag_adjustment)
- << right
- << make_stringf(" (%i aum)",
- static_cast<int>(0.5 + BURDEN_TO_AUM * mass));
- }
return tstr.str();
}
@@ -411,13 +385,8 @@ void InvMenu::set_title(const string &s)
// so that get_number_of_cols returns the appropriate value.
cgotoxy(1, 1);
- const int cap = carrying_capacity(BS_UNENCUMBERED);
-
stitle = make_stringf(
- "Inventory: %.0f/%.0f aum (%d%%, %d/%d slots)",
- BURDEN_TO_AUM * you.burden,
- BURDEN_TO_AUM * cap,
- (you.burden * 100) / cap,
+ "Inventory: %d/%d slots",
inv_count(),
ENDOFPACK);
@@ -870,16 +839,12 @@ menu_letter InvMenu::load_items(const vector<const item_def*> &mitems,
items_in_class.clear();
InvEntry *forced_first = NULL;
- const bool show_weight = Options.show_inventory_weights
- >= (flags & MF_DROP_PICKUP ? MB_MAYBE : MB_TRUE);
for (int j = 0, count = mitems.size(); j < count; ++j)
{
if (mitems[j]->base_type != i)
continue;
InvEntry * const ie = new InvEntry(*mitems[j]);
- ie->show_weight = show_weight;
-
if (mitems[j]->sub_type == get_max_subtype(mitems[j]->base_type))
forced_first = ie;
else
@@ -941,15 +906,6 @@ vector<SelItem> InvMenu::get_selitems() const
bool InvMenu::process_key(int key)
{
- if (key == CONTROL('W'))
- {
- for (size_t i = 0; i < items.size(); i++)
- if (InvEntry *ie = dynamic_cast<InvEntry *>(items[i]))
- ie->show_weight = !ie->show_weight;
- draw_menu();
- return true;
- }
-
if (type == MT_KNOW)
{
bool resetting = (lastch == CONTROL('D'));
@@ -1113,14 +1069,14 @@ const char* item_slot_name(equipment_type type, bool terse)
vector<SelItem> select_items(const vector<const item_def*> &items,
const char *title, bool noselect,
- menu_type mtype, invtitle_annotator titlefn)
+ menu_type mtype,
+ invtitle_annotator titlefn)
{
vector<SelItem> selected;
if (!items.empty())
{
InvMenu menu;
menu.set_type(mtype);
- menu.set_title_annotator(titlefn);
menu.set_title(title);
if (mtype == MT_PICKUP)
{
diff --git a/crawl-ref/source/invent.h b/crawl-ref/source/invent.h
index 702c64073d..83dbcac6ad 100644
--- a/crawl-ref/source/invent.h
+++ b/crawl-ref/source/invent.h
@@ -116,8 +116,6 @@ public:
virtual bool get_tiles(vector<tile_def>& tiles) const;
#endif
- bool show_weight;
-
private:
void add_class_hotkeys(const item_def &i);
};
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index f25519d097..57c03d2ddd 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -2439,6 +2439,12 @@ bool gives_resistance(const item_def &item)
return false;
}
+/*
+ * Return the mass of an item (aum).
+ *
+ * @param item The item.
+ * @returns The mass of the item.
+*/
int item_mass(const item_def &item)
{
int unit_mass = 0;
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 183acfaa63..28cff29545 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -287,12 +287,12 @@ stack_iterator stack_iterator::operator++(int dummy)
++(*this);
return copy;
}
-/*---------------------------------------------------------------------*/
-// Reduce quantity of an inventory item, do cleanup if item goes away.
-//
-// Returns true if stack of items no longer exists.
-bool dec_inv_item_quantity(int obj, int amount, bool suppress_burden)
+/*
+ * Reduce quantity of an inventory item, do cleanup if item goes away.
+ * @returns True if stack of items no longer exists, false otherwise.
+*/
+bool dec_inv_item_quantity(int obj, int amount)
{
bool ret = false;
@@ -333,9 +333,6 @@ bool dec_inv_item_quantity(int obj, int amount, bool suppress_burden)
else
you.inv[obj].quantity -= amount;
- if (!suppress_burden)
- burden_change();
-
return ret;
}
@@ -363,16 +360,13 @@ bool dec_mitm_item_quantity(int obj, int amount)
return false;
}
-void inc_inv_item_quantity(int obj, int amount, bool suppress_burden)
+void inc_inv_item_quantity(int obj, int amount)
{
if (you.equip[EQ_WEAPON] == obj)
you.wield_change = true;
you.m_quiver->on_inv_quantity_changed(obj, amount);
you.inv[obj].quantity += amount;
-
- if (!suppress_burden)
- burden_change();
}
void inc_mitm_item_quantity(int obj, int amount)
@@ -819,45 +813,6 @@ void item_check(bool verbose)
}
}
-static int _menu_selection_weight(const Menu* menu)
-{
- vector<MenuEntry*> se = menu->selected_entries();
- int weight(0);
- for (int i = 0, size = se.size(); i < size; ++i)
- {
- const item_def *item = static_cast<item_def*>(se[i]->data);
- if (se[i]->selected_qty > 0)
- weight += item_mass(*item) * se[i]->selected_qty;
- }
- return weight;
-}
-
-static string _menu_burden_invstatus(const Menu *menu, bool is_pickup = false)
-{
- int sel_weight = _menu_selection_weight(menu);
- int new_burd = you.burden + (is_pickup ? sel_weight : -sel_weight);
- string sw = sel_weight ? make_stringf(">%.0f", new_burd * BURDEN_TO_AUM) : "";
- //TODO: Should somehow colour burdened/overloaded in LIGHTRED/RED
- // respectively {kittel}
- string newstate =
- new_burd > carrying_capacity(BS_ENCUMBERED) ? "overloaded" :
- new_burd > carrying_capacity(BS_UNENCUMBERED) ? "burdened"
- : "unencumbered";
- if (Options.show_inventory_weights)
- {
- newstate = make_stringf("%.0f%s/%.0f aum",
- you.burden * BURDEN_TO_AUM,
- sw.c_str(),
- carrying_capacity(BS_UNENCUMBERED) * BURDEN_TO_AUM);
- }
- return make_stringf("(Burden: %s)", newstate.c_str());
-}
-
-static string _pickup_menu_title(const Menu *menu, const string &oldt)
-{
- return _menu_burden_invstatus(menu, true) + " " + oldt;
-}
-
void pickup_menu(int item_link)
{
int n_did_pickup = 0;
@@ -874,7 +829,7 @@ void pickup_menu(int item_link)
if (items.size() == 1 && items[0]->quantity > 1)
prompt = "Select pick up quantity by entering a number, then select the item";
vector<SelItem> selected = select_items(items, prompt.c_str(), false,
- MT_PICKUP, _pickup_menu_title);
+ MT_PICKUP);
if (selected.empty())
canned_msg(MSG_OK);
redraw_screen();
@@ -897,14 +852,10 @@ void pickup_menu(int item_link)
// If we cleared any flags on the items, but the pickup was
// partial, reset the flags for the items that remain on the
// floor.
- if (result == 0 || result == -1)
+ if (result == -1)
{
n_tried_pickup++;
- if (result == 0)
- pickup_warning = "You can't carry that much weight.";
- else
- pickup_warning = "You can't carry that many items.";
-
+ pickup_warning = "You can't carry that many items.";
if (mitm[j].defined())
mitm[j].flags = oldflags;
}
@@ -923,7 +874,7 @@ void pickup_menu(int item_link)
if (!pickup_warning.empty())
{
mpr(pickup_warning.c_str());
- learned_something_new(HINT_HEAVY_LOAD);
+ learned_something_new(HINT_FULL_INVENTORY);
}
if (n_did_pickup)
@@ -1215,13 +1166,13 @@ bool pickup_single_item(int link, int qty)
if (num == -1)
{
mpr("You can't carry that many items.");
- learned_something_new(HINT_HEAVY_LOAD);
+ learned_something_new(HINT_FULL_INVENTORY);
return false;
}
else if (num == 0)
{
mpr("You can't carry that much weight.");
- learned_something_new(HINT_HEAVY_LOAD);
+ learned_something_new(HINT_FULL_INVENTORY);
return false;
}
@@ -1579,10 +1530,16 @@ void note_inscribe_item(item_def &item)
_check_note_item(item);
}
-// Returns quantity of items moved into player's inventory and -1 if
-// the player's inventory is full.
-int move_item_to_player(int obj, int quant_got, bool quiet,
- bool ignore_burden)
+/*
+ * Move the given item and quantity to the player's inventory
+ * @param obj The item index in mitm.
+ * @param quant_got The quantity of this item to move.
+ * @param quiet If true, most messages notifying the player of item pickup (or
+ * item pickup failure) aren't printed.
+ * @returns The quantity of items moved or -1 if the player's inventory is
+ * full.
+*/
+int move_item_to_player(int obj, int quant_got, bool quiet)
{
item_def &it = mitm[obj];
@@ -1669,7 +1626,6 @@ int move_item_to_player(int obj, int quant_got, bool quiet,
mprf(MSGCH_ORB, "You pick up the Orb of Zot!");
you.char_direction = GDT_ASCENDING;
- burden_change();
env.orb_pos = you.pos(); // can be wrong in wizmode
orb_pickup_noise(you.pos(), 30);
@@ -1693,7 +1649,6 @@ int move_item_to_player(int obj, int quant_got, bool quiet,
return retval;
}
- const int unit_mass = item_mass(it);
if (quant_got > it.quantity || quant_got <= 0)
quant_got = it.quantity;
@@ -1738,39 +1693,12 @@ int move_item_to_player(int obj, int quant_got, bool quiet,
}
}
- int imass = unit_mass * quant_got;
- if (!ignore_burden && (you.burden + imass > carrying_capacity()))
- {
- if (drop_spoiled_chunks(you.burden + imass - carrying_capacity()))
- imass = unit_mass * quant_got;
- }
-
- bool partial_pickup = false;
-
- if (!ignore_burden && (you.burden + imass > carrying_capacity()))
- {
- // calculate quantity we can actually pick up
- int part = (carrying_capacity() - you.burden) / unit_mass;
-
- if (part < 1)
- return 0;
-
- // only pickup 'part' items
- quant_got = part;
- partial_pickup = true;
-
- retval = part;
- }
-
if (is_stackable_item(it))
{
for (int m = 0; m < ENDOFPACK; m++)
{
if (items_stack(you.inv[m], it))
{
- if (!quiet && partial_pickup)
- mpr("You can only carry some of what is here.");
-
_check_note_item(it);
// If the object on the ground is inscribed, but not
@@ -1786,7 +1714,6 @@ int move_item_to_player(int obj, int quant_got, bool quiet,
inc_inv_item_quantity(m, quant_got);
dec_mitm_item_quantity(obj, quant_got);
- burden_change();
_got_item(it, quant_got);
@@ -1806,14 +1733,9 @@ int move_item_to_player(int obj, int quant_got, bool quiet,
}
// Can't combine, check for slot space.
- if (inv_count() >= ENDOFPACK)
- drop_spoiled_chunks(1, true);
- if (inv_count() >= ENDOFPACK)
+ if (inv_count() >= ENDOFPACK && !drop_spoiled_chunks())
return -1;
- if (!quiet && partial_pickup)
- mpr("You can only carry some of what is here.");
-
int freeslot = find_free_slot(it);
ASSERT_RANGE(freeslot, 0, ENDOFPACK);
ASSERT(!you.inv[freeslot].defined());
@@ -1859,7 +1781,6 @@ int move_item_to_player(int obj, int quant_got, bool quiet,
}
dec_mitm_item_quantity(obj, quant_got);
you.m_quiver->on_inv_quantity_changed(freeslot, quant_got);
- burden_change();
if (!quiet)
{
@@ -2310,11 +2231,6 @@ void drop_last()
}
}
-static string _drop_menu_title(const Menu *menu, const string &oldt)
-{
- return _menu_burden_invstatus(menu) + " " + oldt;
-}
-
int get_equip_slot(const item_def *item)
{
int worn = -1;
@@ -2419,7 +2335,7 @@ void drop()
#else
tmp_items = prompt_invent_items("Drop what? (_ for help)", MT_DROP,
#endif
- -1, _drop_menu_title, true, true, 0,
+ -1, NULL, true, true, 0,
&Options.drop_filter, _drop_selitem_text,
&items_for_multidrop);
@@ -2914,40 +2830,6 @@ static void _do_autopickup()
if (item_needs_autopickup(mitm[o]))
{
- int num_to_take = mitm[o].quantity;
- int unit_mass = item_mass(mitm[o]);
- if (Options.autopickup_no_burden && unit_mass != 0)
- {
- int capacity = carrying_capacity(you.burden_state);
- int num_can_take = (capacity - you.burden) / unit_mass;
-
- if (num_can_take < num_to_take
- && drop_spoiled_chunks(you.burden
- + num_to_take * unit_mass - capacity))
- {
- // Yay, some new space, retry.
- // Compare to the old burden capacity, not the new one.
- num_can_take = (capacity - you.burden) / unit_mass;
- }
-
- if (num_can_take < num_to_take)
- {
- if (!n_tried_pickup)
- {
- mpr("You can't pick everything up without burdening "
- "yourself.");
- }
- n_tried_pickup++;
- num_to_take = num_can_take;
- }
-
- if (num_can_take == 0)
- {
- o = next;
- continue;
- }
- }
-
// Do this before it's picked up, otherwise the picked up
// item will be in inventory and _interesting_explore_pickup()
// will always return false.
@@ -2960,17 +2842,14 @@ static void _do_autopickup()
clear_item_pickup_flags(mitm[o]);
- const int result = move_item_to_player(o, num_to_take);
+ const int result = move_item_to_player(o, mitm[o].quantity);
if (mitm[o].base_type == OBJ_FOOD && mitm[o].sub_type == FOOD_CHUNK)
mitm[o].flags |= ISFLAG_DROPPED;
- if (result == 0 || result == -1)
+ if (result == -1)
{
n_tried_pickup++;
- if (result == 0)
- pickup_warning = "You can't carry any more.";
- else
- pickup_warning = "Your pack is full.";
+ pickup_warning = "Your pack is full.";
mitm[o].flags = iflags;
}
else
diff --git a/crawl-ref/source/items.h b/crawl-ref/source/items.h
index f28414059d..a1f78fe7e7 100644
--- a/crawl-ref/source/items.h
+++ b/crawl-ref/source/items.h
@@ -29,18 +29,17 @@ enum item_source_type
int get_max_subtype(object_class_type base_type);
bool item_type_has_unidentified(object_class_type base_type);
-bool dec_inv_item_quantity(int obj, int amount, bool suppress_burden = false);
+bool dec_inv_item_quantity(int obj, int amount);
bool dec_mitm_item_quantity(int obj, int amount);
-void inc_inv_item_quantity(int obj, int amount, bool suppress_burden = false);
+void inc_inv_item_quantity(int obj, int amount);
void inc_mitm_item_quantity(int obj, int amount);
bool move_item_to_grid(int *const obj, const coord_def& p,
bool silent = false);
void move_item_stack_to_grid(const coord_def& from, const coord_def& to);
void note_inscribe_item(item_def &item);
-int move_item_to_player(int obj, int quant_got, bool quiet = false,
- bool ignore_burden = false);
+int move_item_to_player(int obj, int quant_got, bool quiet = false);
void mark_items_non_pickup_at(const coord_def &pos);
void mark_items_non_visit_at(const coord_def &pos);
void clear_item_pickup_flags(item_def &item);
diff --git a/crawl-ref/source/l_food.cc b/crawl-ref/source/l_food.cc
index b29dd599df..8efc4be418 100644
--- a/crawl-ref/source/l_food.cc
+++ b/crawl-ref/source/l_food.cc
@@ -35,11 +35,7 @@ static int food_prompt_floor(lua_State *ls)
{
int eaten = 0;
if (!you.turn_is_over)
- {
eaten = eat_from_floor();
- if (eaten == 1)
- burden_change();
- }
lua_pushboolean(ls, (eaten != 0));
return 1;
}
diff --git a/crawl-ref/source/l_option.cc b/crawl-ref/source/l_option.cc
index 64a507dc50..63f0ae8a37 100644
--- a/crawl-ref/source/l_option.cc
+++ b/crawl-ref/source/l_option.cc
@@ -47,7 +47,6 @@ static option_handler handlers[] =
{ "travel_open_doors", &Options.travel_open_doors, option_hboolean },
{ "easy_armour", &Options.easy_unequip, option_hboolean },
{ "easy_unequip", &Options.easy_unequip, option_hboolean },
- { "autopickup_no_burden", &Options.autopickup_no_burden, option_hboolean },
{ "note_skill_max", &Options.note_skill_max, option_hboolean },
{ "clear_messages", &Options.clear_messages, option_hboolean },
{ "no_dark_brand", &Options.no_dark_brand, option_hboolean },
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc
index d2de07d67d..1634ab1063 100644
--- a/crawl-ref/source/l_you.cc
+++ b/crawl-ref/source/l_you.cc
@@ -187,8 +187,6 @@ LUARET1(you_see_cell_rel, boolean,
LUARET1(you_see_cell_no_trans_rel, boolean,
you.see_cell_no_trans(coord_def(luaL_checkint(ls, 1), luaL_checkint(ls, 2)) + you.pos()))
LUARET1(you_piety_rank, number, piety_rank(you.piety) - 1)
-LUARET1(you_max_burden, number, carrying_capacity(BS_UNENCUMBERED))
-LUARET1(you_burden, number, you.burden)
LUARET1(you_constricted, boolean, you.is_constricted())
LUARET1(you_constricting, boolean, you.is_constricting())
@@ -507,8 +505,6 @@ static const struct luaL_reg you_clib[] =
{ "deaths", you_deaths },
{ "lives", you_lives },
{ "piety_rank", you_piety_rank },
- { "max_burden", you_max_burden },
- { "burden", you_burden },
{ "constricted", you_constricted },
{ "constricting", you_constricting },
{ "antimagic", you_antimagic },
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index 8f072638d3..10f37b2ca8 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -1474,14 +1474,6 @@ static bool _can_take_stairs(dungeon_feature_type ftype, bool down,
}
}
- // Overloaded, can't go up stairs.
- if (!down && you.burden_state == BS_OVERLOADED
- && !feat_is_escape_hatch(ftype) && !feat_is_gate(ftype))
- {
- mpr("You are carrying too much to climb upwards.");
- return false;
- }
-
return true;
}
@@ -1612,8 +1604,7 @@ static void _take_stairs(bool down)
else
{
tag_followers(); // Only those beside us right now can follow.
- start_delay(down ? DELAY_DESCENDING_STAIRS : DELAY_ASCENDING_STAIRS,
- 1 + (you.burden_state > BS_UNENCUMBERED));
+ start_delay(down ? DELAY_DESCENDING_STAIRS : DELAY_ASCENDING_STAIRS, 1);
}
}
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index fb26644805..14c68bf6dd 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -521,10 +521,12 @@ static void _potion_stack_changed_message(item_def &potion, int num_changed,
verb.c_str());
}
-// Returns true if the total number of potions in inventory decreased,
-// in which case burden_change() will need to be called.
-// Also handles coagulation messages.
-bool maybe_coagulate_blood_potions_inv(item_def &blood)
+
+/*
+ * Coagulate and/or rot away blood potions in a stack if necessary.
+ * @param blood The blood potion.
+*/
+void maybe_coagulate_blood_potions_inv(item_def &blood)
{
ASSERT(blood.defined());
ASSERT(is_blood_potion(blood));
@@ -570,7 +572,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
}
if (!rot_count && !coag_count)
- return false; // Nothing to be done.
+ return; // Nothing to be done.
#ifdef DEBUG_BLOOD_POTIONS
mprf(MSGCH_DIAGNOSTICS, "in maybe_coagulate_blood_potions_INV "
@@ -594,8 +596,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
if (!destroyed)
_compare_blood_quantity(blood, timer.size());
-
- return true;
+ return;
}
// Coagulated blood cannot coagulate any further...
@@ -620,9 +621,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
ASSERT(props2.exists("timer"));
CrawlVector &timer2 = props2["timer"].get_vector();
- // Don't recalculate burden here, since we will add the same
- // same number of potions back in.
- if (!dec_inv_item_quantity(blood.link, coag_count + rot_count, true))
+ if (!dec_inv_item_quantity(blood.link, coag_count + rot_count))
_compare_blood_quantity(blood, timer.size());
// Update timer -> push(pop).
@@ -639,8 +638,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
// re-sort timer
_int_sort(timer2);
-
- return rot_count > 0;
+ return;
}
}
@@ -663,8 +661,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
blood.quantity -= rot_count;
// Stack still exists because of coag_count.
_compare_blood_quantity(blood, timer.size());
-
- return rot_count > 0;
+ return;
}
// Else, create new stack in inventory.
@@ -680,8 +677,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
blood.quantity -= coag_count + rot_count;
_compare_blood_quantity(blood, timer.size());
-
- return rot_count > 0;
+ return;
}
mprf("You can't carry %s right now.", coag_count > 1 ? "them" : "it");
@@ -716,8 +712,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
ASSERT(timer2.size() == mitm[o].quantity);
dec_inv_item_quantity(blood.link, rot_count + coag_count);
_compare_blood_quantity(blood, timer.size());
-
- return true;
+ return;
}
o = mitm[o].link;
}
@@ -726,14 +721,14 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
// Create a new stack of potions.
o = get_mitm_slot();
if (o == NON_ITEM)
- return false;
+ return;
+
_init_coagulated_blood(mitm[o], coag_count, blood, age_timer);
move_item_to_grid(&o, you.pos());
if (!dec_inv_item_quantity(blood.link, coag_count + rot_count))
_compare_blood_quantity(blood, timer.size());
- return true;
}
// Removes the oldest timer of a stack of blood potions.
@@ -2083,8 +2078,6 @@ void revive()
mpr("You rejoin the land of the living...");
more();
-
- burden_change();
}
////////////////////////////////////////////////////////////////////////////
diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h
index fb9ca48c70..ab36a043cd 100644
--- a/crawl-ref/source/misc.h
+++ b/crawl-ref/source/misc.h
@@ -36,7 +36,7 @@ void init_stack_blood_potions(item_def &stack, int age = -1);
string get_desc_quantity(const int quant, const int total,
string whose = "Your");
void maybe_coagulate_blood_potions_floor(int obj);
-bool maybe_coagulate_blood_potions_inv(item_def &blood);
+void maybe_coagulate_blood_potions_inv(item_def &blood);
int remove_oldest_blood_potion(item_def &stack);
void remove_newest_blood_potion(item_def &stack, int quant = -1);
void merge_blood_potion_stacks(item_def &source, item_def &dest, int quant);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 9d00ccddf4..646688621b 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -689,7 +689,7 @@ int cheibriados_monster_player_speed_delta(const monster* mon)
{
// Ignore the Slow effect.
unwind_var<int> ignore_slow(you.duration[DUR_SLOW], 0);
- const int pspeed = 1000 / (player_movement_speed(true) * player_speed());
+ const int pspeed = 1000 / (player_movement_speed() * player_speed());
dprf("Your delay: %d, your speed: %d, mon speed: %d",
player_movement_speed(), pspeed, mon->speed);
return mon->speed - pspeed;
diff --git a/crawl-ref/source/options.h b/crawl-ref/source/options.h
index 55e722ca21..1d14e20965 100644
--- a/crawl-ref/source/options.h
+++ b/crawl-ref/source/options.h
@@ -166,7 +166,6 @@ public:
FixedBitVector<NUM_OBJECT_CLASSES> autopickups; // items to autopickup
bool auto_switch; // switch melee&ranged weapons according to enemy range
- maybe_bool show_inventory_weights; // show weights in inventory listings
bool show_uncursed; // label known uncursed items as "uncursed"
bool travel_open_doors; // open doors while exploring
bool easy_unequip; // allow auto-removing of armour / jewellery
@@ -178,7 +177,6 @@ public:
chunk_drop_type auto_drop_chunks; // drop chunks when overburdened
bool easy_eat_chunks; // make 'e' auto-eat the oldest safe chunk
bool auto_eat_chunks; // allow eating chunks while resting or travelling
- bool autopickup_no_burden; // don't autopickup if it changes burden
skill_focus_mode skill_focus; // is the focus skills available
bool note_all_skill_levels; // take note for all skill levels (1-27)
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 4e1c7d37ca..8acf63b3be 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -962,7 +962,7 @@ static void _add_status_light_to_out(int i, vector<status_light>& out)
// - blue, light blue for good enchantments
// - magenta, light magenta for "better" enchantments (deflect, fly)
//
-// Prints burden, hunger,
+// Prints hunger,
// pray, holy, teleport, regen, fly/lev, invis, silence,
// conf. touch, sage
// confused, mesmerised, fire, poison, disease, rot, held, glow, swift,
@@ -1007,7 +1007,6 @@ static void _get_status_lights(vector<status_light>& out)
DUR_DEATHS_DOOR,
DUR_EXHAUSTED,
DUR_QUAD_DAMAGE,
- STATUS_BURDEN,
};
for (unsigned i = 0; i < ARRAYSZ(important_statuses) ; ++i)
diff --git a/crawl-ref/source/output.h b/crawl-ref/source/output.h
index 816369f2ed..8ee7a490b4 100644
--- a/crawl-ref/source/output.h
+++ b/crawl-ref/source/output.h
@@ -9,8 +9,7 @@
enum status_redraw_flag_type
{
REDRAW_HUNGER = 0x00000001,
- REDRAW_BURDEN = 0x00000002,
- REDRAW_LINE_1_MASK = 0x00000003,
+ REDRAW_LINE_1_MASK = 0x00000002,
REDRAW_PRAYER = 0x00000100,
REDRAW_BREATH = 0x00000200,
diff --git a/crawl-ref/source/player-act.cc b/crawl-ref/source/player-act.cc
index 415f60e80d..590d6da209 100644
--- a/crawl-ref/source/player-act.cc
+++ b/crawl-ref/source/player-act.cc
@@ -300,12 +300,8 @@ random_var player::attack_delay(item_def *weap, item_def *projectile,
rv::roll_dice(2, armour_penalty),
20)));
- // Unarmed speed. Min delay is 10 - 270/54 = 5.
- if (you.burden_state == BS_UNENCUMBERED)
- {
- skill_type sk = projectile ? SK_THROWING : SK_UNARMED_COMBAT;
- attk_delay -= div_rand_round(constant(you.skill(sk, 10)), 54);
- }
+ skill_type sk = projectile ? SK_THROWING : SK_UNARMED_COMBAT;
+ attk_delay -= div_rand_round(constant(you.skill(sk, 10)), 54);
// Bats are faster (for what good it does them).
if (you.form == TRAN_BAT && !projectile)
@@ -417,12 +413,14 @@ bool player::can_wield(const item_def& item, bool ignore_curse,
bool player::could_wield(const item_def &item, bool ignore_brand,
bool ignore_transform) const
{
+ size_type bsize = body_size(PSIZE_TORSO, ignore_transform);
+
if (species == SP_FELID)
return false;
- // Only ogres and trolls can wield giant clubs and large rocks (for
+ // Only ogres and trolls can wield giant clubs or large rocks (for
// sandblast).
- if (body_size(PSIZE_TORSO, ignore_transform) < SIZE_LARGE
+ if (bsize < SIZE_LARGE
&& ((item.base_type == OBJ_WEAPONS
&& is_giant_club_type(item.sub_type))
|| (item.base_type == OBJ_MISSILES &&
@@ -440,12 +438,8 @@ bool player::could_wield(const item_def &item, bool ignore_brand,
return true;
// Small species wielding large weapons...
- if (body_size(PSIZE_BODY, ignore_transform) < SIZE_MEDIUM
- && !check_weapon_wieldable_size(item,
- body_size(PSIZE_BODY, ignore_transform)))
- {
+ if (bsize < SIZE_MEDIUM && !check_weapon_wieldable_size(item, bsize))
return false;
- }
if (!ignore_brand)
{
diff --git a/crawl-ref/source/player-stats.cc b/crawl-ref/source/player-stats.cc
index 434a613a97..036a06aa4c 100644
--- a/crawl-ref/source/player-stats.cc
+++ b/crawl-ref/source/player-stats.cc
@@ -669,7 +669,6 @@ static void _handle_stat_change(stat_type stat, const char* cause, bool see_sour
switch (stat)
{
case STAT_STR:
- burden_change();
you.redraw_armour_class = true; // includes shields
break;
@@ -710,8 +709,6 @@ void update_stat_zero()
{
mprf("Your %s has recovered.", stat_desc(s, SD_NAME));
you.redraw_stats[s] = true;
- if (i == STAT_STR)
- burden_change();
}
}
else // no stat penalty at all
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 66acf389d8..9c92e725b5 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1421,10 +1421,6 @@ int player_hunger_rate(bool temp)
- player_mutation_level(MUT_SLOW_METABOLISM);
}
- // burden
- if (temp)
- hunger += you.burden_state;
-
if (you.hp < you.hp_max
&& player_mutation_level(MUT_SLOW_HEALING) < 3)
{
@@ -2239,7 +2235,7 @@ int player_prot_life(bool calc_unid, bool temp, bool items)
// this isn't as fast as it used to be (6 for having anything), but
// even a slight speed advantage is very good... and we certainly don't
// want to go past 6 (see below). -- bwr
-int player_movement_speed(bool ignore_burden)
+int player_movement_speed()
{
int mv = 10;
@@ -2287,15 +2283,6 @@ int player_movement_speed(bool ignore_burden)
mv /= 10;
}
- // Burden
- if (!ignore_burden)
- {
- if (you.burden_state == BS_ENCUMBERED)
- mv++;
- else if (you.burden_state == BS_OVERLOADED)
- mv += 3;
- }
-
if (you.duration[DUR_SWIFTNESS] > 0 && !you.in_liquid())
{
if (you.attribute[ATTR_SWIFTNESS] > 0)
@@ -2706,82 +2693,6 @@ bool player_sust_abil(bool calc_unid)
|| you.scan_artefacts(ARTP_SUSTAB);
}
-int carrying_capacity(burden_state_type bs)
-{
- // Use untransformed body weight, to prevent transformations
- // causing frequent large changes in carrying capacity.
- int cap = 2 * you.body_weight(true) + you.strength() * 250 + 1000;
- // We are nice to the lighter species in that strength adds absolutely
- // instead of relatively to body weight. --dpeg
-
- if (you.stat_zero[STAT_STR])
- cap /= 2;
-
- if (bs == BS_UNENCUMBERED)
- return cap * 5 / 6;
- else if (bs == BS_ENCUMBERED)
- return cap * 11 / 12;
- else
- return cap;
-}
-
-int burden_change()
-{
- const burden_state_type old_burdenstate = you.burden_state;
-
- // XXX: the 600 here is the weight of the Orb.
- // TODO: make this use a dummy item or similar?
- you.burden = player_has_orb() ? 600 : 0;
-
- for (int bu = 0; bu < ENDOFPACK; bu++)
- {
- if (you.inv[bu].quantity < 1)
- continue;
-
- you.burden += item_mass(you.inv[bu]) * you.inv[bu].quantity;
- }
-
- you.burden_state = BS_UNENCUMBERED;
- set_redraw_status(REDRAW_BURDEN);
- you.redraw_evasion = true;
-
- // changed the burdened levels to match the change to max_carried
- if (you.burden <= carrying_capacity(BS_UNENCUMBERED))
- {
- you.burden_state = BS_UNENCUMBERED;
-
- // this message may have to change, just testing {dlb}
- if (old_burdenstate != you.burden_state)
- mpr("Your possessions no longer seem quite so burdensome.");
- }
- else if (you.burden <= carrying_capacity(BS_ENCUMBERED))
- {
- you.burden_state = BS_ENCUMBERED;
-
- if (old_burdenstate != you.burden_state)
- {
- mpr("You are being weighed down by all of your possessions.");
- learned_something_new(HINT_HEAVY_LOAD);
- }
- }
- else
- {
- you.burden_state = BS_OVERLOADED;
-
- if (old_burdenstate != you.burden_state)
- {
- mpr("You are being crushed by all of your possessions.");
- learned_something_new(HINT_HEAVY_LOAD);
- }
- }
-
- // Stop travel if we get burdened (as from potions of might wearing off).
- if (you.burden_state > old_burdenstate)
- interrupt_activity(AI_BURDEN_CHANGE);
-
- return you.burden;
-}
-
void forget_map(bool rot)
{
ASSERT(!crawl_state.game_is_arena());
@@ -3787,9 +3698,6 @@ int check_stealth()
stealth += you.skill(SK_STEALTH, race_mod);
- if (you.burden_state > BS_UNENCUMBERED)
- stealth /= you.burden_state;
-
if (you.confused())
stealth /= 3;
@@ -5742,8 +5650,6 @@ void player::init()
runes.reset();
obtainable_runes = 15;
- burden = 0;
- burden_state = BS_UNENCUMBERED;
spells.init(SPELL_NO_SPELL);
old_vehumet_gifts.clear();
spell_no = 0;
@@ -7055,9 +6961,8 @@ bool player::no_tele(bool calc_unid, bool permit_id, bool blinking) const
bool player::fights_well_unarmed(int heavy_armour_penalty)
{
- return burden_state == BS_UNENCUMBERED
- && x_chance_in_y(skill(SK_UNARMED_COMBAT, 10), 200)
- && x_chance_in_y(2, 1 + heavy_armour_penalty);
+ return x_chance_in_y(skill(SK_UNARMED_COMBAT, 10), 200)
+ && x_chance_in_y(2, 1 + heavy_armour_penalty);
}
bool player::cancellable_flight() const
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index 9fd02426f2..c26d02b0f9 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -91,8 +91,6 @@ public:
FixedBitVector<NUM_RUNE_TYPES> runes;
int obtainable_runes; // can be != 15 in Sprint
- int burden;
- burden_state_type burden_state;
FixedVector<spell_type, MAX_KNOWN_SPELLS> spells;
set<spell_type> old_vehumet_gifts, vehumet_gifts;
@@ -840,10 +838,6 @@ static inline int player_under_penance(god_type god = you.religion)
return you.penance[god];
}
-int burden_change();
-
-int carrying_capacity(burden_state_type bs = BS_OVERLOADED);
-
int player_energy();
int player_raw_body_armour_evasion_penalty();
@@ -851,7 +845,7 @@ int player_adjusted_shield_evasion_penalty(int scale);
int player_armour_shield_spell_penalty();
int player_evasion(ev_ignore_type evit = EV_IGNORE_NONE);
-int player_movement_speed(bool ignore_burden = false);
+int player_movement_speed();
int player_hunger_rate(bool temp = true);
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 460f74221c..c95524c76f 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -1894,7 +1894,6 @@ void shop()
if (_shop_get_stock(i).empty())
_delete_shop(i);
- burden_change();
redraw_screen();
if (bought_something)
diff --git a/crawl-ref/source/spl-summoning.cc b/crawl-ref/source/spl-summoning.cc
index 0622ac6cc4..bb7137d536 100644
--- a/crawl-ref/source/spl-summoning.cc
+++ b/crawl-ref/source/spl-summoning.cc
@@ -772,8 +772,6 @@ spret_type cast_tukimas_dance(int pow, god_type god, bool force_hostile,
did_god_conduct(why, 10, true, mons);
}
- burden_change();
-
return SPRET_SUCCESS;
}
diff --git a/crawl-ref/source/startup.cc b/crawl-ref/source/startup.cc
index a312a4393a..639489b553 100644
--- a/crawl-ref/source/startup.cc
+++ b/crawl-ref/source/startup.cc
@@ -248,7 +248,6 @@ static void _post_init(bool newc)
#endif
init_properties();
- burden_change();
you.redraw_stats.init(true);
you.redraw_hit_points = true;
diff --git a/crawl-ref/source/status.cc b/crawl-ref/source/status.cc
index 63a8fbcb93..099dfce362 100644
--- a/crawl-ref/source/status.cc
+++ b/crawl-ref/source/status.cc
@@ -99,7 +99,6 @@ static void _mark_expiring(status_info* inf, bool expiring)
}
static void _describe_airborne(status_info* inf);
-static void _describe_burden(status_info* inf);
static void _describe_glow(status_info* inf);
static void _describe_hunger(status_info* inf);
static void _describe_regen(status_info* inf);
@@ -186,10 +185,6 @@ bool fill_status_info(int status, status_info* inf)
}
break;
- case STATUS_BURDEN:
- _describe_burden(inf);
- break;
-
case STATUS_CONTAMINATION:
_describe_glow(inf);
break;
@@ -806,27 +801,6 @@ static void _describe_sickness(status_info* inf)
}
}
-static void _describe_burden(status_info* inf)
-{
- switch (you.burden_state)
- {
- case BS_OVERLOADED:
- inf->light_colour = RED;
- inf->light_text = "Overloaded";
- inf->short_text = "overloaded";
- inf->long_text = "You are overloaded with stuff.";
- break;
- case BS_ENCUMBERED:
- inf->light_colour = LIGHTRED;
- inf->light_text = "Burdened";
- inf->short_text = "burdened";
- inf->long_text = "You are burdened.";
- break;
- case BS_UNENCUMBERED:
- break;
- }
-}
-
static void _describe_transform(status_info* inf)
{
const bool vampbat = (you.species == SP_VAMPIRE && you.form == TRAN_BAT);
diff --git a/crawl-ref/source/status.h b/crawl-ref/source/status.h
index b6f645b7a0..6c765098e1 100644
--- a/crawl-ref/source/status.h
+++ b/crawl-ref/source/status.h
@@ -10,7 +10,6 @@ enum status_type
{
STATUS_AIRBORNE = NUM_DURATIONS + 1,
STATUS_BEHELD,
- STATUS_BURDEN,
STATUS_CONTAMINATION,
STATUS_NET,
STATUS_HUNGER,
diff --git a/crawl-ref/source/tag-version.h b/crawl-ref/source/tag-version.h
index 8b56d178ac..1d70b61d4b 100644
--- a/crawl-ref/source/tag-version.h
+++ b/crawl-ref/source/tag-version.h
@@ -104,6 +104,7 @@ enum tag_minor_version
TAG_MINOR_FOUL_STENCH, // Remove Saprovore from the Foul Stench DS Facet
TAG_MINOR_FOOD_PURGE, // Cleaning up old types of food.
TAG_MINOR_FOOD_PURGE_AP_FIX, // Correctly carry over old fruit autopickup.
+ TAG_MINOR_WEIGHTLESS, // Removal of player burden.
#endif
NUM_TAG_MINORS,
TAG_MINOR_VERSION = NUM_TAG_MINORS - 1
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 89c5b68c2e..4c1cc40145 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1345,8 +1345,6 @@ static void tag_construct_you(writer &th)
marshallShort(th, you.pos().x);
marshallShort(th, you.pos().y);
- marshallShort(th, you.burden);
-
// how many spells?
marshallUByte(th, MAX_KNOWN_SPELLS);
for (i = 0; i < MAX_KNOWN_SPELLS; ++i)
@@ -2230,7 +2228,10 @@ static void tag_read_you(reader &th)
ASSERT(!x && !y || in_bounds(x, y));
you.moveto(coord_def(x, y));
- you.burden = unmarshallShort(th);
+#if TAG_MAJOR_VERSION == 34
+ if (th.getMinorVersion() < TAG_MINOR_WEIGHTLESS)
+ unmarshallShort(th);
+#endif
// how many spells?
you.spell_no = 0;
diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc
index 5a8838c7c7..1c57fedc6f 100644
--- a/crawl-ref/source/transform.cc
+++ b/crawl-ref/source/transform.cc
@@ -1056,7 +1056,6 @@ bool transform(int pow, transformation_type which_trans, bool involuntary,
update_player_symbol();
_remove_equipment(rem_stuff);
- burden_change();
if (str)
{
@@ -1258,8 +1257,6 @@ void untransform(bool skip_wielding, bool skip_move)
you.duration[DUR_TRANSFORMATION] = 0;
update_player_symbol();
- burden_change();
-
switch (old_form)
{
case TRAN_SPIDER:
diff --git a/crawl-ref/source/wiz-fsim.cc b/crawl-ref/source/wiz-fsim.cc
index 7a9ff6c7ec..b72835f768 100644
--- a/crawl-ref/source/wiz-fsim.cc
+++ b/crawl-ref/source/wiz-fsim.cc
@@ -210,7 +210,7 @@ static bool _fsim_kit_equip(const string &kit, string &error)
you.pos(), &error);
if (item == NON_ITEM)
return false;
- if (move_item_to_player(item, 1, true, true) <= 0)
+ if (move_item_to_player(item, 1, true) <= 0)
return false;
_equip_weapon(weapon, abort);
}
diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc
index 86f089a8ed..95cbbe355f 100644
--- a/crawl-ref/source/wiz-you.cc
+++ b/crawl-ref/source/wiz-you.cc
@@ -216,7 +216,6 @@ void wizard_change_species()
calc_hp();
calc_mp();
- burden_change();
// The player symbol depends on species.
update_player_symbol();
#ifdef USE_TILE
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index ec89d53799..18b53921e7 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -1503,7 +1503,6 @@ static int _xom_swap_weapons(bool debug = false)
note_inscribe_item(myitem);
dec_mitm_item_quantity(monwpn, myitem.quantity);
you.m_quiver->on_inv_quantity_changed(freeslot, myitem.quantity);
- burden_change();
mprf("You wield %s %s!",
mon->name(DESC_ITS).c_str(),