OSDN Git Service

7baf001841170f6631e366ad5b3adcb3bf78d0f4
[hengbandforosx/hengbandosx.git] / src / system / grid-type-definition.h
1 #pragma once
2
3 #include "system/angband.h"
4 #include "object/object-index-list.h"
5
6 /*
7  * 特殊なマス状態フラグ / Special grid flags
8  */
9 #define CAVE_MARK 0x0001 /*!< 現在プレイヤーの記憶に収まっている / memorized feature */
10 #define CAVE_GLOW 0x0002 /*!< マス自体が光源を持っている / self-illuminating */
11 #define CAVE_ICKY 0x0004 /*!< 生成されたVaultの一部である / part of a vault */
12 #define CAVE_ROOM 0x0008 /*!< 生成された部屋の一部である / part of a room */
13 #define CAVE_LITE 0x0010 /*!< 現在光に照らされている / lite flag  */
14 #define CAVE_VIEW 0x0020 /*!< 現在プレイヤーの視界に収まっている / view flag */
15 #define CAVE_TEMP 0x0040 /*!< 光源に関する処理のアルゴリズム用記録フラグ / temp flag */
16 #define CAVE_XTRA 0x0080 /*!< 視界に関する処理のアルゴリズム用記録フラグ(update_view()等参照) / misc flag */
17 #define CAVE_MNLT 0x0100 /*!< モンスターの光源によって照らされている / Illuminated by monster */
18 #define CAVE_MNDK 0x8000 /*!< モンスターの暗源によって暗闇になっている / Darken by monster */
19
20 /* Used only while floor generation */
21 #define CAVE_FLOOR 0x0200 /*!< フロア属性のあるマス */
22 #define CAVE_EXTRA 0x0400
23 #define CAVE_INNER 0x0800
24 #define CAVE_OUTER 0x1000
25 #define CAVE_SOLID 0x2000
26 #define CAVE_VAULT 0x4000
27 #define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
28
29 // clang-format off
30
31 /* Used only after floor generation */
32 #define CAVE_KNOWN     0x0200 /* Directly viewed or map detected flag */
33 #define CAVE_NOTE      0x0400 /* Flag for delayed visual update (needs note_spot()) */
34 #define CAVE_REDRAW    0x0800 /* Flag for delayed visual update (needs lite_spot()) */
35 #define CAVE_OBJECT    0x1000 /* Mirror, rune, etc. */
36 #define CAVE_UNSAFE    0x2000 /* Might have trap */
37 #define CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */
38
39 // clang-format on
40
41 enum flow_type {
42     FLOW_NORMAL = 0,
43     FLOW_CAN_FLY = 1,
44     FLOW_MAX = 2,
45 };
46
47 struct monster_race;
48 struct grid_type {
49 public:
50     BIT_FLAGS info{}; /* Hack -- grid flags */
51
52     FEAT_IDX feat{}; /* Hack -- feature type */
53     ObjectIndexList o_idx_list; /* Object list in this grid */
54     MONSTER_IDX m_idx{}; /* Monster in this grid */
55
56     /*
57      * 地形の特別な情報を保存する / Special grid info
58      * 具体的な使用一覧はクエスト行き階段の移行先クエストID、
59      * 各ダンジョン入口の移行先ダンジョンID、
60      */
61     s16b special{};
62
63     FEAT_IDX mimic{}; /* Feature to mimic */
64
65     byte costs[FLOW_MAX]{}; /* Hack -- cost of flowing */
66     byte dists[FLOW_MAX]{}; /* Hack -- distance from player */
67     byte when{}; /* Hack -- when cost was computed */
68
69     bool is_floor();
70     bool is_room();
71     bool is_extra();
72     bool is_inner();
73     bool is_outer();
74     bool is_solid();
75     bool is_icky();
76     bool is_lite();
77     bool is_redraw();
78     bool is_view();
79     bool is_object();
80     bool is_mark();
81     bool is_mirror();
82     bool is_rune_protection();
83     bool is_rune_explosion();
84     byte get_cost(monster_race *r_ptr);
85     byte get_distance(monster_race *r_ptr);
86     FEAT_IDX get_feat_mimic();
87
88 private:
89     flow_type get_grid_flow_type(monster_race *r_ptr);
90 };