diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-06-11 07:20:42 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-06-11 07:21:06 +0200 |
commit | 000f6272f8ab1d43ec6300fb5972f7813ada1c88 (patch) | |
tree | 00aad7d77fc407c55a82cec5cd107df09523d0ea /src/cmd3.cc | |
parent | 894d0831b5dd118b0072d9e651f4e51d41819c17 (diff) |
Remove dead Portable Hole code
Diffstat (limited to 'src/cmd3.cc')
-rw-r--r-- | src/cmd3.cc | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/src/cmd3.cc b/src/cmd3.cc index 6f2d67e9..06300982 100644 --- a/src/cmd3.cc +++ b/src/cmd3.cc @@ -1859,131 +1859,6 @@ bool_ do_cmd_sense_grid_mana() /* - * Calculate the weight of the portable holes - */ -s32b portable_hole_weight(void) -{ - s32b weight, i; - - store_type *st_ptr = &town_info[TOWN_RANDOM].store[STORE_HOME]; - - - /* Sum the objects in the appropriate home */ - for (i = 0, weight = 0; i < st_ptr->stock_num; i++) - { - object_type *o_ptr = &st_ptr->stock[i]; - - weight += (o_ptr->weight * o_ptr->number); - } - - /* Multiply the sum with 1.5 */ - weight = (weight * 3) / 2 + 2; - - return (weight); -} - - -/* - * Calculate and set the weight of the portable holes - */ -void set_portable_hole_weight(void) -{ - s32b weight, i, j; - - /* Calculate the weight of items in home */ - weight = portable_hole_weight(); - - /* Set the weight of portable holes in the shops, ... */ - for (i = 1; i < max_towns; i++) - { - for (j = 0; j < max_st_idx; j++) - { - store_type *st_ptr = &town_info[i].store[j]; - int k; - - for (k = 0; k < st_ptr->stock_num; k++) - { - object_type *o_ptr = &st_ptr->stock[k]; - - if ((o_ptr->tval == TV_TOOL) && - (o_ptr->sval == SV_PORTABLE_HOLE)) - o_ptr->weight = weight; - } - } - } - - /* ... in the object list, ... */ - for (i = 1; i < o_max; i++) - { - object_type *o_ptr = &o_list[i]; - - if ((o_ptr->tval == TV_TOOL) && - (o_ptr->sval == SV_PORTABLE_HOLE)) o_ptr->weight = weight; - } - - /* ... and in the p_ptr->inventory to the appropriate value */ - for (i = 0; i < INVEN_TOTAL; i++) - { - object_type *o_ptr = &p_ptr->inventory[i]; - - /* Skip non-objects */ - if ((o_ptr->tval == TV_TOOL) && - (o_ptr->sval == SV_PORTABLE_HOLE)) o_ptr->weight = weight; - } -} - - -/* - * Use a portable hole - */ -void do_cmd_portable_hole(void) -{ - cave_type *c_ptr = &cave[p_ptr->py][p_ptr->px]; - - int feat, special, town_num; - - /* Is it currently wielded? */ - if (!p_ptr->inventory[INVEN_TOOL].k_idx || - (p_ptr->inventory[INVEN_TOOL].tval != TV_TOOL) || - (p_ptr->inventory[INVEN_TOOL].sval != SV_PORTABLE_HOLE)) - { - /* No, it isn't */ - msg_print("You have to wield a portable hole to use your abilities"); - return; - } - - /* Mega-hack: Saving the old values, and then... */ - feat = c_ptr->feat; - special = c_ptr->special; - town_num = p_ptr->town_num; - - /* ... change the current grid to the home in town #1 */ - /* DG -- use the first random town, since random towns cannot have houses */ - /* - * pelpel -- This doesn't affect LoS, so we can manipulate - * terrain feature without calling cave_set_feat() - */ - c_ptr->feat = FEAT_SHOP; - c_ptr->special = STORE_HOME; - p_ptr->town_num = TOWN_RANDOM; - - /* Now use the portable hole */ - do_cmd_store(); - - /* Mega-hack part II: change the current grid to the original value */ - c_ptr->feat = feat; - c_ptr->special = special; - p_ptr->town_num = town_num; - - set_portable_hole_weight(); - - /* Recalculate bonuses */ - p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER); - p_ptr->update |= (PU_BONUS); -} - - -/* * Try to add a CLI action. */ void cli_add(cptr active, cptr trigger, cptr descr) |