OSDN Git Service

[Refactor] #39964 Moved the definition DESCRIPT_HGT from autopick-util.h to autpick...
[hengband/hengband.git] / src / autopick / autopick-util.h
1 #pragma once
2
3 #define MAX_LINELEN 1024
4 #define MAX_AUTOPICK_DEFAULT 200
5 #define MAX_YANK MAX_LINELEN
6 #define MAX_LINES 3000
7
8 #define PT_DEFAULT 0
9 #define PT_WITH_PNAME 1
10
11 #define MARK_MARK     0x01
12 #define MARK_BY_SHIFT 0x02
13
14 #define LSTAT_BYPASS        0x01
15 #define LSTAT_EXPRESSION    0x02
16 #define LSTAT_AUTOREGISTER  0x04
17
18 /*!
19  * @struct autopick_type
20  * @brief 自動拾い/破壊設定データの構造体 / A structure type for entry of auto-picker/destroyer
21  */
22 typedef struct {
23         concptr name;          /*!< 自動拾い/破壊定義の名称一致基準 / Items which have 'name' as part of its name match */
24         concptr insc;          /*!< 対象となったアイテムに自動で刻む内容 / Items will be auto-inscribed as 'insc' */
25         BIT_FLAGS flag[2];       /*!< キーワードに関する汎用的な条件フラグ / Misc. keyword to be matched */
26         byte action;        /*!< 対象のアイテムを拾う/破壊/放置するかの指定フラグ / Auto-pickup or Destroy or Leave items */
27         byte dice;          /*!< 武器のダイス値基準値 / Weapons which have more than 'dice' dice match */
28         byte bonus;         /*!< アイテムのボーナス基準値 / Items which have more than 'bonus' magical bonus match */
29 } autopick_type;
30
31 /*
32  * Struct for yank buffer
33  */
34 typedef struct chain_str {
35         struct chain_str *next;
36         char s[1];
37 } chain_str_type;
38
39 /*
40  * Data struct for text editor
41  */
42 typedef struct {
43         int wid, hgt;
44         int cx, cy;
45         int upper, left;
46         int old_wid, old_hgt;
47         int old_cy;
48         int old_upper, old_left;
49         int mx, my;
50         byte mark;
51
52         object_type *search_o_ptr;
53         concptr search_str;
54         concptr last_destroyed;
55
56         chain_str_type *yank;
57         bool yank_eol;
58
59         concptr *lines_list;
60         byte states[MAX_LINES];
61
62         u16b dirty_flags;
63         int dirty_line;
64         int filename_mode;
65         int old_com_id;
66
67         bool changed;
68 } text_body_type;
69
70 /*
71  *  List for auto-picker/destroyer entries
72  */
73 extern int max_autopick;
74 extern int max_max_autopick;
75 extern autopick_type *autopick_list;
76 extern object_type autopick_last_destroyed_object;
77
78 void autopick_free_entry(autopick_type *entry);
79 void free_text_lines(concptr *lines_list);
80 int get_com_id(char key);
81 void auto_inscribe_item(player_type *player_ptr, object_type *o_ptr, int idx);
82 void add_autopick_list(autopick_type *entry);