#include "player-move.h"
#include "player-class.h"
#include "player-race.h"
+#include "player-inventory.h"
#include "objectkind.h"
#include "object-ego.h"
#include "object-flavor.h"
static GAME_TEXT KEY_ARTIFACT[] = "artifact";
static GAME_TEXT KEY_EGO[] = "ego";
static GAME_TEXT KEY_GOOD[] = "good";
-static GAME_TEXT KEY_nameLESS[] = "nameless";
+static GAME_TEXT KEY_NAMELESS[] = "nameless";
static GAME_TEXT KEY_AVERAGE[] = "average";
static GAME_TEXT KEY_WORTHLESS[] = "worthless";
static GAME_TEXT KEY_RARE[] = "rare";
}
/* Wanted monster's corpse */
- if (object_is_shoukinkubi(o_ptr))
+ if (object_is_bounty(o_ptr))
{
REM_FLG(FLG_WORTHLESS);
ADD_FLG(FLG_WANTED);
return FALSE;
/*** Wanted monster's corpse/skeletons ***/
- if (IS_FLG(FLG_WANTED) && !object_is_shoukinkubi(o_ptr))
+ if (IS_FLG(FLG_WANTED) && !object_is_bounty(o_ptr))
return FALSE;
/*** Unique monster's corpse/skeletons/statues ***/
{
/*
* 'Collecting' means the item must be absorbed
- * into an p_ptr->inventory_list slot.
+ * into an inventory slot.
* But an item can not be absorbed into itself!
*/
if ((&p_ptr->inventory_list[j] != o_ptr) &&
if (leave_wanted)
{
- if (object_is_shoukinkubi(o_ptr)) return FALSE;
+ if (object_is_bounty(o_ptr)) return FALSE;
}
if (leave_corpse)
/* Now decided to destroy */
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
/* Artifact? */
if (!can_player_destroy_object(o_ptr))
{
object_type *o_ptr;
- /* Get the item (in the pack) */
- if (item >= 0) o_ptr = &p_ptr->inventory_list[item];
-
- /* Get the item (on the floor) */
- else o_ptr = ¤t_floor_ptr->o_list[0 - item];
+ o_ptr = REF_ITEM(p_ptr, p_ptr->current_floor_ptr, item);
if (o_ptr->k_idx && (o_ptr->marked & OM_AUTODESTROY))
{
autopick_delayed_alter_aux(item);
/* Scan the pile of objects */
- item = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx;
+ item = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx;
while (item)
{
- OBJECT_IDX next = current_floor_ptr->o_list[item].next_o_idx;
+ OBJECT_IDX next = p_ptr->current_floor_ptr->o_list[item].next_o_idx;
autopick_delayed_alter_aux(-item);
item = next;
}
/*
* Auto-inscription and/or destroy
*
- * Auto-destroyer works only on p_ptr->inventory_list or on floor stack only when
+ * Auto-destroyer works only on inventory or on floor stack only when
* requested.
*/
void autopick_alter_item(INVENTORY_IDX item, bool destroy)
object_type *o_ptr;
int idx;
- /* Get the item (in the pack) */
- if (item >= 0) o_ptr = &p_ptr->inventory_list[item];
-
- /* Get the item (on the floor) */
- else o_ptr = ¤t_floor_ptr->o_list[0 - item];
+ o_ptr = REF_ITEM(p_ptr, p_ptr->current_floor_ptr, item);
/* Get the index in the auto-pick/destroy list */
idx = is_autopick(o_ptr);
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
int idx;
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
idx = is_autopick(o_ptr);
if (idx >= 0 &&
(autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK)))
{
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
if (!inven_carry_okay(o_ptr))
{
q = _("どのアイテムを登録しますか? ", "Enter which item? ");
s = _("アイテムを持っていない。", "You have nothing to enter.");
- o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
+ o_ptr = choose_object(p_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
if (!o_ptr) return FALSE;
autopick_entry_from_object(entry, o_ptr);
q = _("どのアイテムを検索しますか? ", "Enter which item? ");
s = _("アイテムを持っていない。", "You have nothing to enter.");
- o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
+ o_ptr = choose_object(p_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
if (!o_ptr) return 0;
*o_handle = o_ptr;
/*
* In-game editor of Object Auto-picker/Destoryer
+ * @param player_ptr プレーヤーへの参照ポインタ
*/
-void do_cmd_edit_autopick(void)
+void do_cmd_edit_autopick(player_type *player_ptr)
{
static int cx_save = 0;
static int cy_save = 0;
/* Autosave */
if (current_world_ptr->game_turn > old_autosave_turn + 100L)
{
- do_cmd_save_game(TRUE);
+ do_cmd_save_game(player_ptr, TRUE);
old_autosave_turn = current_world_ptr->game_turn;
}