Hengband  2.2.1
grid.h
[詳解]
1 #pragma once
2 
3 /*!
4  * @file grid.h
5  * @brief ダンジョンの生成処理の基幹部分ヘッダーファイル
6  * @date 2014/08/15
7  * @details
8  * Purpose: header file for grid.c, used only in dungeon generation
9  * files (generate.c, rooms.c)
10  * @author
11  * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
12  * This software may be copied and distributed for educational, research, and
13  * not for profit purposes provided that this copyright and statement are
14  * included in all such copies.
15  */
16 
17 
18  /*
19  * A single "grid" in a Cave
20  *
21  * Note that several aspects of the code restrict the actual p_ptr->current_floor_ptr->grid_array
22  * to a max size of 256 by 256. In partcular, locations are often
23  * saved as bytes, limiting each coordinate to the 0-255 range.
24  *
25  * The "o_idx" and "m_idx" fields are very interesting. There are
26  * many places in the code where we need quick access to the actual
27  * monster or object(s) in a given grid. The easiest way to
28  * do this is to simply keep the index of the monster and object
29  * (if any) with the grid, but this takes 198*66*4 bytes of memory.
30  * Several other methods come to mind, which require only half this
31  * amound of memory, but they all seem rather complicated, and would
32  * probably add enough code that the savings would be lost. So for
33  * these reasons, we simply store an index into the "o_list" and
34  * "p_ptr->current_floor_ptr->m_list" arrays, using "zero" when no monster/object is present.
35  *
36  * Note that "o_idx" is the index of the top object in a stack of
37  * objects, using the "next_o_idx" field of objects (see below) to
38  * create the singly linked list of objects. If "o_idx" is zero
39  * then there are no objects in the grid.
40  *
41  * Note the special fields for the "MONSTER_FLOW" code.
42  */
43 
44 typedef struct player_type player_type; // TODO: Delete Finally.
45 
46 typedef struct grid_type grid_type;
47 
48 struct grid_type
49 {
50  BIT_FLAGS info; /* Hack -- p_ptr->current_floor_ptr->grid_array flags */
51 
52  FEAT_IDX feat; /* Hack -- feature type */
53  OBJECT_IDX o_idx; /* Object in this grid */
54  MONSTER_IDX m_idx; /* Monster in this grid */
55 
56  /*! 地形の特別な情報を保存する / Special p_ptr->current_floor_ptr->grid_array info
57  * 具体的な使用一覧はクエスト行き階段の移行先クエストID、
58  * 各ダンジョン入口の移行先ダンジョンID、
59  *
60  */
62 
63  FEAT_IDX mimic; /* Feature to mimic */
64 
65  byte cost; /* Hack -- cost of flowing */
66  byte dist; /* Hack -- distance from player */
67  byte when; /* Hack -- when cost was computed */
68 };
69 
70 /*
71  * A structure type for terrain template of saving dungeon floor
72  */
73 typedef struct
74 {
81 
82 /* This should not be used */
83 /*#define set_cave_info(Y,X,I) (p_ptr->current_floor_ptr->grid_array[(Y)][(X)].info = (I)) */
84 
85 #define feat_locked_door_random(DOOR_TYPE) \
86  (feat_door[(DOOR_TYPE)].num_locked ? \
87  feat_door[(DOOR_TYPE)].locked[randint0(feat_door[(DOOR_TYPE)].num_locked)] : feat_none)
88 
89 #define feat_jammed_door_random(DOOR_TYPE) \
90  (feat_door[(DOOR_TYPE)].num_jammed ? \
91  feat_door[(DOOR_TYPE)].jammed[randint0(feat_door[(DOOR_TYPE)].num_jammed)] : feat_none)
92 
93 /* Macros */
94 #define set_cave_feat(FL,Y,X,F) ((FL)->grid_array[(Y)][(X)].feat = (F))
95 #define add_cave_info(FL,Y,X,I) ((FL)->grid_array[(Y)][(X)].info |= (I))
96 
97 /*!
98  * @brief 指定座標に瓦礫を配置する
99  * @param Y 指定Y座標
100  * @param X 指定X座標
101  */
102 #define place_rubble(F,Y,X) set_cave_feat(F,Y,X,feat_rubble)
103 
104 /*!
105  * @brief 指定座標がFLOOR属性を持ったマスかどうかを返す
106  * @param Y 指定Y座標
107  * @param X 指定X座標
108  * @return FLOOR属性を持っているならばTRUE
109  */
110 #define is_floor_bold(F,Y,X) (F->grid_array[Y][X].info & CAVE_FLOOR)
111 #define is_extra_bold(F,Y,X) (F->grid_array[Y][X].info & CAVE_EXTRA)
112 
113 #define is_inner_bold(F,Y,X) (F->grid_array[Y][X].info & CAVE_INNER)
114 #define is_outer_bold(F,Y,X) (F->grid_array[Y][X].info & CAVE_OUTER)
115 #define is_solid_bold(F,Y,X) (F->grid_array[Y][X].info & CAVE_SOLID)
116 
117 #define is_floor_grid(C) ((C)->info & CAVE_FLOOR)
118 #define is_extra_grid(C) ((C)->info & CAVE_EXTRA)
119 #define is_inner_grid(C) ((C)->info & CAVE_INNER)
120 #define is_outer_grid(C) ((C)->info & CAVE_OUTER)
121 #define is_solid_grid(C) ((C)->info & CAVE_SOLID)
122 
123 #define place_floor_bold(F, Y, X) \
124 { \
125  set_cave_feat((F), Y,X,feat_ground_type[randint0(100)]); \
126  (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
127  add_cave_info((F), Y,X,CAVE_FLOOR); \
128  delete_monster(Y, X); \
129 }
130 
131 #define place_floor_grid(C) \
132 { \
133  (C)->feat = feat_ground_type[randint0(100)]; \
134  (C)->info &= ~(CAVE_MASK); \
135  (C)->info |= CAVE_FLOOR; \
136  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
137 }
138 
139 #define place_extra_bold(Y, X) \
140 { \
141  set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_type[randint0(100)]); \
142  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
143  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_EXTRA); \
144  delete_monster(Y, X); \
145 }
146 
147 #define place_extra_grid(C) \
148 { \
149  (C)->feat = feat_wall_type[randint0(100)]; \
150  (C)->info &= ~(CAVE_MASK); \
151  (C)->info |= CAVE_EXTRA; \
152  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
153 }
154 
155 #define place_extra_perm_bold(Y, X) \
156 { \
157  set_cave_feat(floor_ptr, Y,X,feat_permanent); \
158  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
159  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_EXTRA); \
160  delete_monster(Y, X); \
161 }
162 
163 #define place_extra_perm_grid(C) \
164 { \
165  (C)->feat = feat_permanent; \
166  (C)->info &= ~(CAVE_MASK); \
167  (C)->info |= CAVE_EXTRA; \
168  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
169 }
170 
171 #define place_extra_noperm_bold(F, Y, X) \
172 { \
173  feature_type *_f_ptr; \
174  set_cave_feat((F), Y,X,feat_wall_type[randint0(100)]); \
175  _f_ptr = &f_info[(F)->grid_array[Y][X].feat]; \
176  if (permanent_wall(_f_ptr)) (F)->grid_array[Y][X].feat = feat_state((F)->grid_array[Y][X].feat, FF_UNPERM); \
177  (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
178  add_cave_info((F), Y, X, CAVE_EXTRA); \
179  delete_monster(Y, X); \
180 }
181 
182 #define place_inner_bold(F, Y, X) \
183 { \
184  set_cave_feat((F), Y, X, feat_wall_inner); \
185  (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
186  add_cave_info((F), Y, X, CAVE_INNER); \
187  delete_monster(Y, X); \
188 }
189 
190 #define place_inner_grid(C) \
191 { \
192  (C)->feat = feat_wall_inner; \
193  (C)->info &= ~(CAVE_MASK); \
194  (C)->info |= CAVE_INNER; \
195  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
196 }
197 
198 #define place_inner_perm_bold(Y, X) \
199 { \
200  set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_permanent); \
201  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
202  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_INNER); \
203  delete_monster(Y, X); \
204 }
205 
206 #define place_inner_perm_grid(C) \
207 { \
208  (C)->feat = feat_permanent; \
209  (C)->info &= ~(CAVE_MASK); \
210  (C)->info |= CAVE_INNER; \
211  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
212 }
213 
214 #define place_outer_bold(Y, X) \
215 { \
216  set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_outer); \
217  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
218  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_OUTER); \
219  delete_monster(Y, X); \
220 }
221 
222 #define place_outer_grid(C) \
223 { \
224  (C)->feat = feat_wall_outer; \
225  (C)->info &= ~(CAVE_MASK); \
226  (C)->info |= CAVE_OUTER; \
227  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
228 }
229 
230 #define place_outer_perm_bold(Y, X) \
231 { \
232  set_cave_feat(floor_ptr, Y,X,feat_permanent); \
233  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
234  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_OUTER); \
235  delete_monster(Y, X); \
236 }
237 
238 #define place_outer_perm_grid(C) \
239 { \
240  (C)->feat = feat_permanent; \
241  (C)->info &= ~(CAVE_MASK); \
242  (C)->info |= CAVE_OUTER; \
243  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
244 }
245 
246 #define place_outer_noperm_bold(Y, X) \
247 { \
248  feature_type *_f_ptr = &f_info[feat_wall_outer]; \
249  if (permanent_wall(_f_ptr)) set_cave_feat(p_ptr->current_floor_ptr, Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
250  else set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_outer); \
251  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
252  add_cave_info(p_ptr->current_floor_ptr, Y,X,(CAVE_OUTER | CAVE_VAULT)); \
253  delete_monster(Y, X); \
254 }
255 
256 #define place_outer_noperm_grid(C) \
257 { \
258  feature_type *_f_ptr = &f_info[feat_wall_outer]; \
259  if (permanent_wall(_f_ptr)) (C)->feat = (s16b)feat_state(feat_wall_outer, FF_UNPERM); \
260  else (C)->feat = feat_wall_outer; \
261  (C)->info &= ~(CAVE_MASK); \
262  (C)->info |= (CAVE_OUTER | CAVE_VAULT); \
263  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
264 }
265 
266 #define place_solid_bold(Y, X) \
267 { \
268  set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_solid); \
269  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
270  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_SOLID); \
271  delete_monster(Y, X); \
272 }
273 
274 #define place_solid_grid(C) \
275 { \
276  (C)->feat = feat_wall_solid; \
277  (C)->info &= ~(CAVE_MASK); \
278  (C)->info |= CAVE_SOLID; \
279  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
280 }
281 
282 #define place_solid_perm_bold(Y, X) \
283 { \
284  set_cave_feat(floor_ptr, Y,X,feat_permanent); \
285  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
286  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_SOLID); \
287  delete_monster(Y, X); \
288 }
289 
290 #define place_solid_perm_grid(C) \
291 { \
292  (C)->feat = feat_permanent; \
293  (C)->info &= ~(CAVE_MASK); \
294  (C)->info |= CAVE_SOLID; \
295  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
296 }
297 
298 #define place_solid_noperm_bold(Y, X) \
299 { \
300  feature_type *_f_ptr = &f_info[feat_wall_solid]; \
301  if ((p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
302  set_cave_feat(p_ptr->current_floor_ptr, Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
303  else set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_solid); \
304  p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
305  add_cave_info(p_ptr->current_floor_ptr, Y,X,CAVE_SOLID); \
306  delete_monster(Y, X); \
307 }
308 
309 #define place_solid_noperm_grid(C) \
310 { \
311  feature_type *_f_ptr = &f_info[feat_wall_solid]; \
312  if (((C)->info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
313  (C)->feat = feat_state(feat_wall_solid, FF_UNPERM); \
314  else (C)->feat = feat_wall_solid; \
315  (C)->info &= ~(CAVE_MASK); \
316  (C)->info |= CAVE_SOLID; \
317  if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
318 }
319 
320 
321 /*
322  * 特殊なマス状態フラグ / Special grid flags
323  */
324 #define CAVE_MARK 0x0001 /*!< 現在プレイヤーの記憶に収まっている / memorized feature */
325 #define CAVE_GLOW 0x0002 /*!< マス自体が光源を持っている / self-illuminating */
326 #define CAVE_ICKY 0x0004 /*!< 生成されたVaultの一部である / part of a vault */
327 #define CAVE_ROOM 0x0008 /*!< 生成された部屋の一部である / part of a room */
328 #define CAVE_LITE 0x0010 /*!< 現在光に照らされている / lite flag */
329 #define CAVE_VIEW 0x0020 /*!< 現在プレイヤーの視界に収まっている / view flag */
330 #define CAVE_TEMP 0x0040 /*!< 光源に関する処理のアルゴリズム用記録フラグ / temp flag */
331 #define CAVE_XTRA 0x0080 /*!< 視界に関する処理のアルゴリズム用記録フラグ(update_view()等参照) / misc flag */
332 #define CAVE_MNLT 0x0100 /*!< モンスターの光源によって照らされている / Illuminated by monster */
333 #define CAVE_MNDK 0x8000 /*!< モンスターの暗源によって暗闇になっている / Darken by monster */
334 
335  /* Used only while p_ptr->current_floor_ptr->grid_array generation */
336 #define CAVE_FLOOR 0x0200 /*!< フロア属性のあるマス */
337 #define CAVE_EXTRA 0x0400
338 #define CAVE_INNER 0x0800
339 #define CAVE_OUTER 0x1000
340 #define CAVE_SOLID 0x2000
341 #define CAVE_VAULT 0x4000
342 #define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
343 
344 /* Used only after p_ptr->current_floor_ptr->grid_array generation */
345 #define CAVE_KNOWN 0x0200 /* Directly viewed or map detected flag */
346 #define CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */
347 #define CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */
348 #define CAVE_OBJECT 0x1000 /* Mirror, glyph, etc. */
349 #define CAVE_UNSAFE 0x2000 /* Might have trap */
350 #define CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */
351 
352 /* Types of conversions */
353 #define CONVERT_TYPE_FLOOR 0
354 #define CONVERT_TYPE_WALL 1
355 #define CONVERT_TYPE_INNER 2
356 #define CONVERT_TYPE_OUTER 3
357 #define CONVERT_TYPE_SOLID 4
358 #define CONVERT_TYPE_STREAM1 5
359 #define CONVERT_TYPE_STREAM2 6
360 
361 /* Externs */
362 
363 extern bool new_player_spot(player_type *creature_ptr);
364 
365 extern void place_random_door(POSITION y, POSITION x, bool room);
366 
367 /* Types of doors */
368 #define DOOR_DEFAULT -1
369 #define DOOR_DOOR 0
370 #define DOOR_GLASS_DOOR 1
371 #define DOOR_CURTAIN 2
372 
373 #define MAX_DOOR_TYPES 3
374 extern void place_closed_door(POSITION y, POSITION x, int type);
375 
376 
377 extern void try_door(POSITION y, POSITION x);
378 extern void place_floor(POSITION x1, POSITION x2, POSITION y1, POSITION y2, bool light);
379 extern void place_room(POSITION x1, POSITION x2, POSITION y1, POSITION y2, bool light);
380 extern void vault_objects(POSITION y, POSITION x, int num);
381 extern void vault_trap_aux(POSITION y, POSITION x, POSITION yd, POSITION xd);
382 extern void vault_traps(POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
383 
384 extern bool get_is_floor(POSITION x, POSITION y);
385 extern void set_floor(POSITION x, POSITION y);
386 extern void place_bound_perm_wall(grid_type *g_ptr);
387 
388 extern bool is_known_trap(grid_type *g_ptr);
389 extern bool is_hidden_door(grid_type *g_ptr);
390 extern bool is_mirror_grid(grid_type *g_ptr);
391 extern bool is_glyph_grid(grid_type *g_ptr);
392 extern bool is_explosive_rune_grid(grid_type *g_ptr);
393 
394 extern bool player_can_enter(FEAT_IDX feature, BIT_FLAGS16 mode);
395 
396 /*!
397  * マス構造体のspecial要素を利用する地形かどうかを判定するマクロ / Is this feature has special meaning (except floor_id) with g_ptr->special?
398  */
399 #define feat_uses_special(F) (have_flag(f_info[(F)].flags, FF_SPECIAL))
400 
401 /* grids.c */
402 extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
403 extern void update_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
404 extern bool player_can_see_bold(POSITION y, POSITION x);
405 extern bool no_lite(void);
406 extern void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp);
407 extern void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x);
408 extern void note_spot(POSITION y, POSITION x);
409 extern void lite_spot(POSITION y, POSITION x);
410 extern void delayed_visual_update(void);
411 extern void update_flow(void);
412 extern void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat);
413 extern FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat);
414 extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
415 extern void cave_alter_feat(POSITION y, POSITION x, int action);
416 extern void remove_mirror(POSITION y, POSITION x);
417 extern bool is_open(FEAT_IDX feat);
418 extern bool check_local_illumination(POSITION y, POSITION x);
419 
422 
423 
424 /*!
425  * モンスターにより照明が消されている地形か否かを判定する。 / Is this grid "darkened" by monster?
426  */
427 #define darkened_grid(C) \
428  ((((C)->info & (CAVE_VIEW | CAVE_LITE | CAVE_MNLT | CAVE_MNDK)) == (CAVE_VIEW | CAVE_MNDK)) && \
429  !p_ptr->see_nocto)
430 
431 /*
432  * Get feature mimic from f_info[] (applying "mimic" field)
433  */
434 #define get_feat_mimic(C) \
435  (f_info[(C)->mimic ? (C)->mimic : (C)->feat].mimic)
436 
437 /*
438  * This macro allows us to efficiently add a grid to the "lite" array,
439  * note that we are never called for illegal grids, or for grids which
440  * have already been placed into the "lite" array, and we are never
441  * called when the "lite" array is full.
442  */
443 #define cave_lite_hack(F, Y,X) \
444 {\
445  if (!((F)->grid_array[Y][X].info & (CAVE_LITE))) \
446  { \
447  (F)->grid_array[Y][X].info |= (CAVE_LITE); \
448  (F)->lite_y[p_ptr->current_floor_ptr->lite_n] = (Y); \
449  (F)->lite_x[p_ptr->current_floor_ptr->lite_n++] = (X); \
450  } \
451 }
452 
453 /*
454  * For delayed visual update
455  */
456 #define cave_note_and_redraw_later(C,Y,X) \
457 {\
458  (C)->info |= CAVE_NOTE; \
459  cave_redraw_later((C), (Y), (X)); \
460 }
461 
462 /*
463  * For delayed visual update
464  */
465 #define cave_redraw_later(C,Y,X) \
466 {\
467  if (!((C)->info & CAVE_REDRAW)) \
468  { \
469  (C)->info |= CAVE_REDRAW; \
470  p_ptr->current_floor_ptr->redraw_y[p_ptr->current_floor_ptr->redraw_n] = (Y); \
471  p_ptr->current_floor_ptr->redraw_x[p_ptr->current_floor_ptr->redraw_n++] = (X); \
472  } \
473 }
474 
475  /*
476  * This macro allows us to efficiently add a grid to the "view" array,
477  * note that we are never called for illegal grids, or for grids which
478  * have already been placed into the "view" array, and we are never
479  * called when the "view" array is full.
480  */
481 #define cave_view_hack(C,Y,X) \
482 {\
483  if (!((C)->info & (CAVE_VIEW))){\
484  (C)->info |= (CAVE_VIEW); \
485  p_ptr->current_floor_ptr->view_y[p_ptr->current_floor_ptr->view_n] = (Y); \
486  p_ptr->current_floor_ptr->view_x[p_ptr->current_floor_ptr->view_n] = (X); \
487  p_ptr->current_floor_ptr->view_n++;}\
488 }
489 
u16b occurrence
Definition: grid.h:79
s16b OBJECT_IDX
ゲーム中のアイテムID型を定義
Definition: h-type.h:140
FEAT_IDX feat
Definition: grid.h:76
bool is_glyph_grid(grid_type *g_ptr)
Definition: grid.c:1723
bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode)
指定されたマスにプレイヤーがテレポート可能かどうかを判定する。
Definition: grid.c:1782
s16b special
地形の特別な情報を保存する / Special p_ptr->current_floor_ptr->grid_array info 具体的な使用一覧はクエスト行き階段の移行先クエストID、 各ダンジョン...
Definition: grid.h:61
void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
Definition: grid.c:1468
void cave_alter_feat(POSITION y, POSITION x, int action)
Definition: grid.c:1629
void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
Mコマンドによる縮小マップの表示を行う / Extract the attr/char to display at the given (legal) map location
Definition: view-mainwindow.c:2873
void try_door(POSITION y, POSITION x)
ドアの設置を試みる / Places door at y, x position if at least 2 walls found
Definition: grid.c:460
MONSTER_IDX m_idx
Definition: grid.h:54
BIT_FLAGS info
Definition: grid.h:50
bool new_player_spot(player_type *creature_ptr)
新規フロアに入りたてのプレイヤーをランダムな場所に配置する / Returns random co-ordinates for player/monster/object
Definition: grid.c:182
void update_flow(void)
Definition: grid.c:1373
FEAT_IDX feat_state(FEAT_IDX feat, int action)
Definition: grid.c:1609
BIT_FLAGS info
Definition: grid.h:75
bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode)
指定されたマスがモンスターのテレポート可能先かどうかを判定する。
Definition: grid.c:1751
void place_floor(POSITION x1, POSITION x2, POSITION y1, POSITION y2, bool light)
長方形の空洞を生成する / Make an empty square floor, for the middle of rooms
Definition: grid.c:487
void place_closed_door(POSITION y, POSITION x, int type)
所定の位置に各種の閉じたドアを配置する / Place a random type of normal door at the given location.
Definition: grid.c:329
FEAT_IDX feat
Definition: grid.h:52
FEAT_IDX mimic
Definition: grid.h:63
int TERM_LEN
コンソール表示座標の型定義
Definition: h-type.h:236
u32b BIT_FLAGS
32ビットのフラグ配列の型定義
Definition: h-type.h:225
Definition: grid.h:73
unsigned short u16b
Definition: h-type.h:99
s32b POSITION
ゲーム中の座標型を定義
Definition: h-type.h:146
POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
2点間の距離をニュートン・ラプソン法で算出する / Distance between two points via Newton-Raphson technique
Definition: geometry.c:64
void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x)
Definition: grid.c:927
u16b BIT_FLAGS16
16ビットのフラグ配列の型定義
Definition: h-type.h:226
char SYMBOL_CODE
キャラの文字の型定義
Definition: h-type.h:238
bool get_is_floor(POSITION x, POSITION y)
指定のマスが床系地形であるかを返す / Function that sees if a square is a floor.
Definition: grid.c:663
bool check_local_illumination(POSITION y, POSITION x)
指定された座標のマスが現在照らされているかを返す。 / Check for "local" illumination
Definition: grid.c:769
bool player_can_enter(FEAT_IDX feature, BIT_FLAGS16 mode)
プレイヤーが地形踏破可能かを返す
Definition: grid.c:1838
void update_local_illumination(player_type *creature_ptr, POSITION y, POSITION x)
指定された座標の照明状態を更新する / Update "local" illumination
Definition: grid.c:821
void place_bound_perm_wall(grid_type *g_ptr)
マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall
Definition: grid.c:707
byte when
Definition: grid.h:67
void vault_trap_aux(POSITION y, POSITION x, POSITION yd, POSITION xd)
特殊な部屋向けに各種アイテムを配置する(vault_trapのサブセット) / Place a trap with a given displacement of point
Definition: grid.c:600
void note_spot(POSITION y, POSITION x)
Definition: grid.c:988
byte TERM_COLOR
テキスト表示色の型定義
Definition: h-type.h:237
FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat)
Definition: grid.c:1575
void vault_objects(POSITION y, POSITION x, int num)
特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates
Definition: grid.c:542
void place_room(POSITION x1, POSITION x2, POSITION y1, POSITION y2, bool light)
長方形の部屋を生成する / Make an empty square room, only floor and wall grids
Definition: grid.c:513
s16b special
Definition: grid.h:78
s16b MONSTER_IDX
ゲーム中のモンスター個体ID型を定義
Definition: h-type.h:129
bool is_explosive_rune_grid(grid_type *g_ptr)
Definition: grid.c:1735
bool player_can_see_bold(POSITION y, POSITION x)
指定された座標をプレイヤーが視覚に収められるかを返す。 / Can the player "see" the given grid in detail?
Definition: geometry.c:538
void remove_mirror(POSITION y, POSITION x)
Definition: grid.c:1685
bool no_lite(void)
指定された座標をプレイヤー収められていない状態かどうか / Returns true if the player's grid is dark
Definition: grid.c:919
void lite_spot(POSITION y, POSITION x)
Definition: grid.c:1079
Definition: player-status.h:86
bool is_mirror_grid(grid_type *g_ptr)
Definition: grid.c:1711
signed short s16b
Definition: h-type.h:98
void set_floor(POSITION x, POSITION y)
指定のマスを床地形に変える / Set a square to be floor.
Definition: grid.c:683
Definition: grid.h:48
FEAT_IDX mimic
Definition: grid.h:77
byte cost
Definition: grid.h:65
byte dist
Definition: grid.h:66
void delayed_visual_update(void)
Definition: grid.c:1317
bool is_open(FEAT_IDX feat)
地形は開くものであって、かつ開かれているかを返す / Attempt to open the given chest at the given location
Definition: grid.c:1827
bool is_hidden_door(grid_type *g_ptr)
マスに隠されたドアがあるかの判定を行う。 / Return TRUE if the given grid is a hidden closed door
Definition: grid.c:751
OBJECT_IDX o_idx
Definition: grid.h:53
void vault_traps(POSITION y, POSITION x, POSITION yd, POSITION xd, int num)
特殊な部屋向けに各種アイテムを配置する(メインルーチン) / Place some traps with a given displacement of given location
Definition: grid.c:647
bool is_known_trap(grid_type *g_ptr)
マスに看破済みの罠があるかの判定を行う。 / Return TRUE if the given grid is a known trap
Definition: grid.c:736
s16b FEAT_IDX
ゲーム中の地形ID型を定義
Definition: h-type.h:115
void place_random_door(POSITION y, POSITION x, bool room)
所定の位置にさまざまな状態や種類のドアを配置する / Place a random type of door at the given location
Definition: grid.c:245