*/
#include "angband.h"
+#include "util.h"
+#include "term.h"
+#include "autopick.h"
+#include "core.h"
+
+#include "mind.h"
+
#include "store.h"
+#include "player-status.h"
+#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"
+#include "object-hook.h"
+
+#include "files.h"
+#include "floor.h"
+#include "world.h"
+#include "monster.h"
+#include "monsterrace.h"
+#include "view-mainwindow.h"
#define MAX_LINELEN 1024
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";
/*
+ * 自動拾い/破壊設定のリストに関する変数 / List for auto-picker/destroyer entries
+ */
+int max_autopick = 0; /*!< 現在登録している自動拾い/破壊設定の数 */
+int max_max_autopick = 0; /*!< 自動拾い/破壊設定の限界数 */
+autopick_type *autopick_list = NULL; /*!< 自動拾い/破壊設定構造体のポインタ配列 */
+
+/*
* A function to create new entry
*/
static bool autopick_new_entry(autopick_type *entry, concptr str, bool allow_default)
}
/* 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 format("%s.prf", namebase);
case PT_WITH_PNAME:
- return format("%s-%s.prf", namebase, player_base);
+ return format("%s-%s.prf", namebase, p_ptr->base_name);
default:
return NULL;
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 ***/
* into an inventory slot.
* But an item can not be absorbed into itself!
*/
- if ((&inventory[j] != o_ptr) &&
- object_similar(&inventory[j], o_ptr))
+ if ((&p_ptr->inventory_list[j] != o_ptr) &&
+ object_similar(&p_ptr->inventory_list[j], o_ptr))
return TRUE;
}
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 = &inventory[item];
-
- /* Get the item (on the floor) */
- else o_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 = cave[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 = 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;
}
object_type *o_ptr;
int idx;
- /* Get the item (in the pack) */
- if (item >= 0) o_ptr = &inventory[item];
-
- /* Get the item (on the floor) */
- else o_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);
/*
* Automatically pickup/destroy items in this grid.
*/
-void autopick_pickup_items(cave_type *c_ptr)
+void autopick_pickup_items(grid_type *g_ptr)
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan the pile of objects */
- for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
int idx;
- object_type *o_ptr = &o_list[this_o_idx];
-
- /* Acquire next object */
- next_o_idx = o_ptr->next_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))
{
/*** Collecting items ***/
/*** Which can be absorbed into a slot as a bundle ***/
if (IS_FLG(FLG_COLLECTING))
- which_str[which_n++] = "can be absorbed into an existing inventory slot";
+ which_str[which_n++] = "can be absorbed into an existing p_ptr->inventory_list slot";
/*** Unaware items ***/
if (IS_FLG(FLG_UNAWARE))
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, filename);
-
- /* Open the file */
- fff = my_fopen(buf, "r");
+ fff = my_fopen(buf, "r");
if (fff)
{
int lines = 0;
char buf[1024];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, filename);
-
- /* Open the file */
- fff = my_fopen(buf, "w");
+ fff = my_fopen(buf, "w");
if (fff)
{
for (lines = 0; lines_list[lines]; lines++)
q = _("どのアイテムを登録しますか? ", "Enter which item? ");
s = _("アイテムを持っていない。", "You have nothing to enter.");
- o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP);
+ 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);
+ 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;
static GAME_TEXT MN_SEARCH_STR[] = "Search by string";
static GAME_TEXT MN_SEARCH_FORW[] = "Search forward";
static GAME_TEXT MN_SEARCH_BACK[] = "Search backward";
-static GAME_TEXT MN_SEARCH_OBJ[] = "Search by inventory object";
+static GAME_TEXT MN_SEARCH_OBJ[] = "Search by p_ptr->inventory_list object";
static GAME_TEXT MN_SEARCH_DESTROYED[] = "Search by destroyed object";
static GAME_TEXT MN_INSERT[] = "Insert...";
/*
* 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;
tb->dirty_line = -1;
tb->filename_mode = PT_DEFAULT;
- if (turn < old_autosave_turn)
+ if (current_world_ptr->game_turn < old_autosave_turn)
{
- while (old_autosave_turn > turn) old_autosave_turn -= TURNS_PER_TICK * TOWN_DAWN;
+ while (old_autosave_turn > current_world_ptr->game_turn) old_autosave_turn -= TURNS_PER_TICK * TOWN_DAWN;
}
/* Autosave */
- if (turn > old_autosave_turn + 100L)
+ if (current_world_ptr->game_turn > old_autosave_turn + 100L)
{
- do_cmd_save_game(TRUE);
- old_autosave_turn = turn;
+ do_cmd_save_game(player_ptr, TRUE);
+ old_autosave_turn = current_world_ptr->game_turn;
}
- /* HACK -- Reset start_time to stop counting playtime while edit */
+ /* HACK -- Reset current_world_ptr->start_time to stop counting current_world_ptr->play_time while edit */
update_playtime();
/* Free old entries */
/* Reload autopick pref */
process_autopick_file(buf);
- /* HACK -- reset start_time so that playtime is not increase while edit */
- start_time = (u32b)time(NULL);
+ /* HACK -- reset current_world_ptr->start_time so that current_world_ptr->play_time is not increase while edit */
+ current_world_ptr->start_time = (u32b)time(NULL);
/* Save cursor location */
cx_save = tb->cx;