/** * Stay still. Search. Enter stores. * Pick up treasure if "pickup" is true. */ void do_cmd_hold(struct command *cmd) { /* Take a turn */ player->upkeep->energy_use = z_info->move_energy; /* Searching (probably not necessary - NRM)*/ search(); /* Pick things up, not using extra energy */ do_autopickup(player); /* Enter a store if we are on one, otherwise look at the floor */ if (square_isshop(cave, player->py, player->px)) { disturb(player, 0); event_signal(EVENT_ENTER_STORE); event_remove_handler_type(EVENT_ENTER_STORE); event_signal(EVENT_USE_STORE); event_remove_handler_type(EVENT_USE_STORE); event_signal(EVENT_LEAVE_STORE); event_remove_handler_type(EVENT_LEAVE_STORE); /* Turn will be taken exiting the shop */ player->upkeep->energy_use = 0; } else { event_signal(EVENT_SEEFLOOR); square_know_pile(cave, player->py, player->px); } }
/** * Stay still. Search. Enter stores. * Pick up treasure if "pickup" is true. */ void do_cmd_hold(struct command *cmd) { /* Take a turn */ player->upkeep->energy_use = z_info->move_energy; /* Spontaneous Searching */ if ((player->state.skills[SKILL_SEARCH_FREQUENCY] >= 50) || one_in_(50 - player->state.skills[SKILL_SEARCH_FREQUENCY])) search(false); /* Continuous Searching */ if (player->searching) search(false); /* Pick things up, not using extra energy */ do_autopickup(); /* Enter a store if we are on one, otherwise look at the floor */ if (square_isshop(cave, player->py, player->px)) { disturb(player, 0); event_signal(EVENT_ENTER_STORE); event_remove_handler_type(EVENT_ENTER_STORE); event_signal(EVENT_USE_STORE); event_remove_handler_type(EVENT_USE_STORE); event_signal(EVENT_LEAVE_STORE); event_remove_handler_type(EVENT_LEAVE_STORE); /* Turn will be taken exiting the shop */ player->upkeep->energy_use = 0; } else { event_signal(EVENT_SEEFLOOR); floor_pile_know(cave, player->py, player->px); } }
/** * Pick up or look at objects on a square when the player steps onto it */ void do_cmd_autopickup(struct command *cmd) { /* Get the obvious things */ player->upkeep->energy_use = do_autopickup() * z_info->move_energy / 10; if (player->upkeep->energy_use > z_info->move_energy) player->upkeep->energy_use = z_info->move_energy; /* Look at what's left */ event_signal(EVENT_SEEFLOOR); }
/** * Pick up objects at the player's request */ void do_cmd_pickup(struct command *cmd) { int energy_cost; struct object *obj = square_object(cave, player->py, player->px); /* Autopickup first */ energy_cost = do_autopickup() * z_info->move_energy / 10; /* Pick up floor objects with a menu for multiple objects */ energy_cost += player_pickup_item(obj, FALSE) * z_info->move_energy / 10; /* Limit */ if (energy_cost > z_info->move_energy) energy_cost = z_info->move_energy; /* Charge this amount of energy. */ player->upkeep->energy_use = energy_cost; }
/* * Stay still. Search. Enter stores. * Pick up treasure if "pickup" is true. */ void do_cmd_hold(cmd_code code, cmd_arg args[]) { /* Take a turn */ p_ptr->energy_use = 100; /* Spontaneous Searching */ if ((p_ptr->state.skills[SKILL_SEARCH_FREQUENCY] >= 50) || one_in_(50 - p_ptr->state.skills[SKILL_SEARCH_FREQUENCY])) { search(FALSE); } /* Continuous Searching */ if (p_ptr->searching) { search(FALSE); } /* Pick things up, not using extra energy */ do_autopickup(); /* Hack -- enter a store if we are on one */ if ((cave->feat[p_ptr->py][p_ptr->px] >= FEAT_SHOP_HEAD) && (cave->feat[p_ptr->py][p_ptr->px] <= FEAT_SHOP_TAIL)) { /* Disturb */ disturb(p_ptr, 0, 0); cmd_insert(CMD_ENTER_STORE); /* Free turn XXX XXX XXX */ p_ptr->energy_use = 0; } else { event_signal(EVENT_SEEFLOOR); } }
/* * Pick up objects on the floor beneath you. -LM- */ void do_cmd_autopickup(cmd_code code, cmd_arg args[]) { p_ptr->energy_use = do_autopickup() * 10; }