OSDN Git Service

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