Pickup code. More...
|static void||player_pickup_gold (void)|
|Pick up all gold at the player's current location. |
|static bool||auto_pickup_okay (const struct object *obj)|
|Determine if an object can be picked up automatically. |
|static void||player_pickup_aux (struct object *obj, bool domsg)|
|Move an object from a floor pile to the player's gear. |
|static byte||player_pickup_item (struct object *obj, bool menu)|
|Pick up objects and treasure on the floor. |
|Pick up everything on the floor that requires no player action. |
|void||do_cmd_pickup (struct command *cmd)|
|Pick up objects at the player's request. |
|void||do_cmd_autopickup (struct command *cmd)|
|Pick up or look at objects on a square when the player steps onto it. |
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.
References object::artifact, cave, history_add_artifact(), inven_carry(), inven_carry_okay(), object::kind, object_kind::name, player_upkeep::notice, object_is_known(), object_sense_artifact(), PN_IGNORE, player::px, player::py, quit_fmt(), square_excise_object(), TRUE, and player::upkeep.
Pick up all gold at the player's current location.
References player::au, buf, cave, FALSE, ignore_item_ok(), lookup_kind(), msgt(), my_strcat(), my_strcpy(), object_kind::name, object_kind::next, object::next, object_delete(), PR_GOLD, object::pval, player::px, player::py, player_upkeep::redraw, square_excise_object(), square_object(), streq, strnfmt(), object::sval, TRUE, 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(), FALSE, angband_constants::floor_size, get_item(), i, inven_carry_okay(), mem_free(), mem_zalloc(), player_pickup_aux(), player_pickup_gold(), player::px, player::py, scan_floor(), square_holds_object(), square_object(), TRUE, USE_FLOOR, and z_info.
Referenced by do_cmd_pickup().