Pickup code. More...
|static void||player_pickup_gold (struct player *p)|
|Pick up all gold at the player's current location. More...|
|static bool||auto_pickup_okay (const struct object *obj)|
|Determine if an object can be picked up automatically. More...|
|static void||player_pickup_aux (struct player *p, struct object *obj, int auto_max, bool domsg)|
|Move an object from a floor pile to the player's gear, checking first whether partial pickup is needed. More...|
|static byte||player_pickup_item (struct player *p, struct object *obj, bool menu)|
|Pick up objects and treasure on the floor. More...|
|int||do_autopickup (struct player *p)|
|Pick up everything on the floor that requires no player action. More...|
|void||do_cmd_pickup (struct command *cmd)|
|Pick up objects at the player's request. More...|
|void||do_cmd_autopickup (struct command *cmd)|
|Pick up or look at objects on a square when the player steps onto it. More...|
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke, Copyright (c) 2007 Leon Marrick
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
Pick up everything on the floor that requires no player action.
Move an object from a floor pile to the player's gear, checking first whether partial pickup is needed.
References cave, player::cave, delist_object(), floor_object_for_use(), get_quantity(), inven_carry(), inven_carry_num(), object::kind, object::known, object_kind::name, player_upkeep::notice, NULL, num, object::number, PN_IGNORE, player::px, player::py, quit_fmt(), square_excise_object(), and player::upkeep.
Pick up all gold at the player's current location.
References player::au, buf, cave, player::cave, delist_object(), ignore_item_ok(), object::known, lookup_kind(), msgt(), my_strcat(), my_strcpy(), object_kind::name, object_kind::next, object::next, NULL, object_delete(), PR_GOLD, object::pval, player::px, player::py, player_upkeep::redraw, square_excise_object(), square_object(), streq, strnfmt(), object::sval, object::tval, tval_is_money(), player::upkeep, and void().
Pick up objects and treasure on the floor.
Scan the list of objects in that floor grid. Pick up gold automatically. Pick up objects automatically until backpack space is full if auto-pickup option is on, otherwise, store objects on floor in an array, and tally both how many there are and can be picked up.
If not picking up anything, indicate objects on the floor. Do the same thing if we don't have room for anything.
Pick up multiple objects using Tim Baker's menu system. Recursively call this function (forcing menus for any number of objects) until objects are gone, backpack is full, or player is satisfied.
We keep track of number of objects picked up to calculate time spent. This tally is incremented even for automatic pickup, so we are careful (in "dungeon.c" and elsewhere) to handle pickup as either a separate automated move or a no-cost part of the stay still or 'g'et command.
Note the lack of chance for the character to be disturbed by unmarked objects. They are truly "unknown".
|obj||is the object to pick up.|
|menu||is whether to present a menu to the player|
References cave, CMD_PICKUP, EVENT_SEEFLOOR, event_signal(), floor_list, angband_constants::floor_size, get_item(), i, inven_carry_okay(), mem_free(), mem_zalloc(), NULL, OFLOOR_VISIBLE, player_pickup_aux(), player_pickup_gold(), player::px, player::py, scan_floor(), square_know_pile(), square_object(), USE_FLOOR, and z_info.
Referenced by do_cmd_pickup().