OSDN Git Service

[Refactor] #40577 Changed macro function cave_clean_bold() to normal function and...
[hengband/hengband.git] / src / floor / floor.h
1 #pragma once
2
3 #include "system/angband.h"
4
5 extern floor_type floor_info;
6
7 /*
8  * Grid based version of "creature_bold()"
9  */
10 #define player_grid(C, G) \
11         ((G) == &(C)->current_floor_ptr->grid_array[(C)->y][(C)->x])
12
13
14 /*
15  * Determine if an object can be dropped on a "legal" grid
16  *
17  * Line 1 -- forbid non-drops
18  * Line 2 -- forbid object terrains
19  */
20 #define cave_drop_bold(F,Y,X) \
21         (cave_have_flag_bold((F), (Y), (X), FF_DROP) && \
22          !((F)->grid_array[Y][X].info & CAVE_OBJECT))
23
24
25 /*
26  * Determine if a "legal" grid is "permanent"
27  *
28  * Line 1 -- permanent flag
29  */
30 #define cave_perma_bold(F,Y,X) \
31         (cave_have_flag_bold((F), (Y), (X), FF_PERMANENT))
32
33
34 /*
35  * Grid based version of "cave_perma_bold()"
36  */
37 #define cave_perma_grid(C) \
38         (cave_have_flag_grid((C), FF_PERMANENT))
39
40
41 /*
42  * Determine if a "legal" grid is within "los" of the player
43  *
44  * Note the use of comparison to zero to force a "boolean" result
45  */
46 #define player_has_los_grid(C) \
47     (((C)->info & (CAVE_VIEW)) != 0)
48
49 /*
50  * Convert a "location" (Y,X) into a "grid" (G)
51  */
52 #define GRID(Y,X) \
53         (256 * (Y) + (X))
54
55 /*
56  * Convert a "grid" (G) into a "location" (Y)
57  */
58 #define GRID_Y(G) \
59         ((int)((G) / 256U))
60
61 /*
62  * Convert a "grid" (G) into a "location" (X)
63  */
64 #define GRID_X(G) \
65         ((int)((G) % 256U))
66
67 bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x);
68 void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
69 void add_door(player_type *player_ptr, POSITION x, POSITION y);
70 void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
71 void place_locked_door(player_type *player_ptr, POSITION y, POSITION x);
72 void forget_flow(floor_type *floor_ptr);
73 void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x);
74 bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
75 int get_max_range(player_type *creature_ptr);
76 bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
77 void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num);
78 bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x);
79 void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat);
80 void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room);
81 void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type);
82 void wipe_o_list(floor_type *floor_ptr);
83 bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y);
84 void try_door(player_type *player_ptr, POSITION y, POSITION x);
85 FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat);
86 void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num);
87 int project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
88 void set_floor(player_type *player_ptr, POSITION x, POSITION y);
89 void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
90 void place_gold(player_type *player_ptr, POSITION y, POSITION x);
91 void delete_monster(player_type *player_ptr, POSITION y, POSITION x);
92 void compact_objects(player_type *owner_ptr, int size);
93 void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
94 void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);