<ClCompile Include="..\..\src\game-option\runtime-arguments.c" />\r
<ClCompile Include="..\..\src\game-option\special-options.c" />\r
<ClCompile Include="..\..\src\game-option\text-display-options.c" />\r
+ <ClCompile Include="..\..\src\grid\door.c" />\r
<ClCompile Include="..\..\src\grid\feature-generator.c" />\r
<ClCompile Include="..\..\src\grid\lighting-colors-table.c" />\r
<ClCompile Include="..\..\src\info-reader\artifact-reader.c" />\r
<ClInclude Include="..\..\src\game-option\runtime-arguments.h" />\r
<ClInclude Include="..\..\src\game-option\special-options.h" />\r
<ClInclude Include="..\..\src\game-option\text-display-options.h" />\r
+ <ClInclude Include="..\..\src\grid\door.h" />\r
<ClInclude Include="..\..\src\grid\feature-flag-types.h" />\r
<ClInclude Include="..\..\src\grid\feature-generator.h" />\r
<ClInclude Include="..\..\src\grid\lighting-colors-table.h" />\r
<ClCompile Include="..\..\src\target\projection-path-calculator.c">
<Filter>target</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\grid\door.c">
+ <Filter>grid</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\combat\shoot.h">
<ClInclude Include="..\..\src\target\projection-path-calculator.h">
<Filter>target</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\grid\door.h">
+ <Filter>grid</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
game-option/special-options.c game-option/special-options.h \
game-option/text-display-options.c game-option/text-display-options.h \
\
+ grid/door.c grid/door.h \
grid/feature-flag-types.h \
grid/feature-generator.c grid/feature-generator.h \
grid/feature.c grid/feature.h \
#include "game-option/birth-options.h"
#include "game-option/cheat-options.h"
#include "game-option/map-screen-options.h"
+#include "grid/feature.h"
#include "grid/grid.h"
#include "grid/trap.h"
#include "mind/mind-ninja.h"
*/
floor_type floor_info;
-/*!
- * @brief 鍵のかかったドアを配置する
- * @param player_ptr プレーヤーへの参照ポインタ
- * @param y 配置したいフロアのY座標
- * @param x 配置したいフロアのX座標
- * @return なし
- */
-void place_locked_door(player_type *player_ptr, POSITION y, POSITION x)
-{
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS) {
- place_bold(player_ptr, y, x, GB_FLOOR);
- return;
- }
-
- set_cave_feat(floor_ptr, y, x, feat_locked_door_random((d_info[player_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
- floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
- delete_monster(player_ptr, y, x);
-}
-
-/*!
- * @brief 隠しドアを配置する
- * @param player_ptr プレーヤーへの参照ポインタ
- * @param y 配置したいフロアのY座標
- * @param x 配置したいフロアのX座標
- * @param type DOOR_DEFAULT / DOOR_DOOR / DOOR_GLASS_DOOR / DOOR_CURTAIN のいずれか
- * @return なし
- */
-void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type)
-{
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS) {
- place_bold(player_ptr, y, x, GB_FLOOR);
- return;
- }
-
- if (type == DOOR_DEFAULT) {
- type = ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_CURTAIN) && one_in_((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 16 : 256))
- ? DOOR_CURTAIN
- : ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR);
- }
-
- place_closed_door(player_ptr, y, x, type);
- grid_type *g_ptr = &floor_ptr->grid_array[y][x];
- if (type != DOOR_CURTAIN) {
- g_ptr->mimic = feat_wall_inner;
- if (feat_supports_los(g_ptr->mimic) && !feat_supports_los(g_ptr->feat)) {
- if (have_flag(f_info[g_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[g_ptr->mimic].flags, FF_CAN_FLY)) {
- g_ptr->feat = one_in_(2) ? g_ptr->mimic : feat_ground_type[randint0(100)];
- }
-
- g_ptr->mimic = 0;
- }
- }
-
- g_ptr->info &= ~(CAVE_FLOOR);
- delete_monster(player_ptr, y, x);
-}
-
static int scent_when = 0;
/*
}
}
-/*
- * Routine used by the random vault creators to add a door to a location
- * Note that range checking has to be done in the calling routine.
- *
- * The doors must be INSIDE the allocated region.
- */
-void add_door(player_type *player_ptr, POSITION x, POSITION y)
-{
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
- if (!is_outer_bold(floor_ptr, y, x))
- return;
-
- /* look at:
- * x#x
- * .#.
- * x#x
- *
- * where x=don't care
- * .=floor, #=wall
- */
-
- if (is_floor_bold(floor_ptr, y - 1, x) && is_floor_bold(floor_ptr, y + 1, x)
- && (is_outer_bold(floor_ptr, y, x - 1) && is_outer_bold(floor_ptr, y, x + 1))) {
- place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
- place_bold(player_ptr, y, x - 1, GB_SOLID);
- place_bold(player_ptr, y, x + 1, GB_SOLID);
- }
-
- /* look at:
- * x#x
- * .#.
- * x#x
- *
- * where x = don't care
- * .=floor, #=wall
- */
- if (is_outer_bold(floor_ptr, y - 1, x) && is_outer_bold(floor_ptr, y + 1, x) && is_floor_bold(floor_ptr, y, x - 1) && is_floor_bold(floor_ptr, y, x + 1)) {
- place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
- place_bold(player_ptr, y - 1, x, GB_SOLID);
- place_bold(player_ptr, y + 1, x, GB_SOLID);
- }
-}
-
/*!
* @brief 所定の位置に上り階段か下り階段を配置する / Place an up/down staircase at given location
* @param player_ptr プレーヤーへの参照ポインタ
((int)((G) % 256U))
void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
-void add_door(player_type *player_ptr, POSITION x, POSITION y);
-void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
-void place_locked_door(player_type *player_ptr, POSITION y, POSITION x);
void forget_flow(floor_type *floor_ptr);
void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x);
bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
--- /dev/null
+#include "grid/door.h"
+#include "dungeon/dungeon-flag-types.h"
+#include "dungeon/dungeon.h"
+#include "floor/cave.h"
+#include "floor/floor.h"
+#include "grid/feature.h"
+#include "grid/grid.h"
+#include "system/floor-type-definition.h"
+#include "util/bit-flags-calculator.h"
+
+/*
+ * Routine used by the random vault creators to add a door to a location
+ * Note that range checking has to be done in the calling routine.
+ *
+ * The doors must be INSIDE the allocated region.
+ */
+void add_door(player_type *player_ptr, POSITION x, POSITION y)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ if (!is_outer_bold(floor_ptr, y, x))
+ return;
+
+ /* look at:
+ * x#x
+ * .#.
+ * x#x
+ *
+ * where x=don't care
+ * .=floor, #=wall
+ */
+
+ if (is_floor_bold(floor_ptr, y - 1, x) && is_floor_bold(floor_ptr, y + 1, x)
+ && (is_outer_bold(floor_ptr, y, x - 1) && is_outer_bold(floor_ptr, y, x + 1))) {
+ place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
+ place_bold(player_ptr, y, x - 1, GB_SOLID);
+ place_bold(player_ptr, y, x + 1, GB_SOLID);
+ }
+
+ /* look at:
+ * x#x
+ * .#.
+ * x#x
+ *
+ * where x = don't care
+ * .=floor, #=wall
+ */
+ if (is_outer_bold(floor_ptr, y - 1, x) && is_outer_bold(floor_ptr, y + 1, x) && is_floor_bold(floor_ptr, y, x - 1) && is_floor_bold(floor_ptr, y, x + 1)) {
+ place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
+ place_bold(player_ptr, y - 1, x, GB_SOLID);
+ place_bold(player_ptr, y + 1, x, GB_SOLID);
+ }
+}
+
+/*!
+ * @brief \89B\82µ\83h\83A\82ð\94z\92u\82·\82é
+ * @param player_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param y \94z\92u\82µ\82½\82¢\83t\83\8d\83A\82ÌY\8dÀ\95W
+ * @param x \94z\92u\82µ\82½\82¢\83t\83\8d\83A\82ÌX\8dÀ\95W
+ * @param type DOOR_DEFAULT / DOOR_DOOR / DOOR_GLASS_DOOR / DOOR_CURTAIN \82Ì\82¢\82¸\82ê\82©
+ * @return \82È\82µ
+ */
+void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS) {
+ place_bold(player_ptr, y, x, GB_FLOOR);
+ return;
+ }
+
+ if (type == DOOR_DEFAULT) {
+ type = ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_CURTAIN) && one_in_((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 16 : 256))
+ ? DOOR_CURTAIN
+ : ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR);
+ }
+
+ place_closed_door(player_ptr, y, x, type);
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
+ if (type != DOOR_CURTAIN) {
+ g_ptr->mimic = feat_wall_inner;
+ if (feat_supports_los(g_ptr->mimic) && !feat_supports_los(g_ptr->feat)) {
+ if (have_flag(f_info[g_ptr->mimic].flags, FF_MOVE) || have_flag(f_info[g_ptr->mimic].flags, FF_CAN_FLY)) {
+ g_ptr->feat = one_in_(2) ? g_ptr->mimic : feat_ground_type[randint0(100)];
+ }
+
+ g_ptr->mimic = 0;
+ }
+ }
+
+ g_ptr->info &= ~(CAVE_FLOOR);
+ delete_monster(player_ptr, y, x);
+}
+
+/*!
+ * @brief \8c®\82Ì\82©\82©\82Á\82½\83h\83A\82ð\94z\92u\82·\82é
+ * @param player_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param y \94z\92u\82µ\82½\82¢\83t\83\8d\83A\82ÌY\8dÀ\95W
+ * @param x \94z\92u\82µ\82½\82¢\83t\83\8d\83A\82ÌX\8dÀ\95W
+ * @return \82È\82µ
+ */
+void place_locked_door(player_type *player_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS) {
+ place_bold(player_ptr, y, x, GB_FLOOR);
+ return;
+ }
+
+ set_cave_feat(floor_ptr, y, x, feat_locked_door_random((d_info[player_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
+ delete_monster(player_ptr, y, x);
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+void add_door(player_type *player_ptr, POSITION x, POSITION y);
+void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
+void place_locked_door(player_type *player_ptr, POSITION y, POSITION x);
#include "grid/feature.h"
#include "grid/lighting-colors-table.h"
+#include "room/door-definition.h"
#include "util/bit-flags-calculator.h"
/*** Terrain feature variables ***/
* Determine if a "feature" is "permanent wall"
*/
bool permanent_wall(feature_type *f_ptr) { return have_flag(f_ptr->flags, FF_WALL) && have_flag(f_ptr->flags, FF_PERMANENT); }
+
+FEAT_IDX feat_locked_door_random(int door_type)
+{
+ return feat_door[door_type].num_locked ? feat_door[door_type].locked[randint0(feat_door[door_type].num_locked)] : feat_none;
+}
+
+FEAT_IDX feat_jammed_door_random(int door_type)
+{
+ return feat_door[door_type].num_jammed ? feat_door[door_type].jammed[randint0(feat_door[door_type].num_jammed)] : feat_none;
+}
void apply_default_feat_lighting(TERM_COLOR *f_attr, SYMBOL_CODE *f_char);
bool is_ascii_graphics(char x);
bool permanent_wall(feature_type *f_ptr);
+FEAT_IDX feat_locked_door_random(int door_type);
+FEAT_IDX feat_jammed_door_random(int door_type);
u16b occurrence;
} grid_template_type;
-#define feat_locked_door_random(DOOR_TYPE) \
- (feat_door[(DOOR_TYPE)].num_locked ? \
- feat_door[(DOOR_TYPE)].locked[randint0(feat_door[(DOOR_TYPE)].num_locked)] : feat_none)
-
-#define feat_jammed_door_random(DOOR_TYPE) \
- (feat_door[(DOOR_TYPE)].num_jammed ? \
- feat_door[(DOOR_TYPE)].jammed[randint0(feat_door[(DOOR_TYPE)].num_jammed)] : feat_none)
-
/*!
* @brief 指定座標に瓦礫を配置する
* @param Y 指定Y座標
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "grid/door.h"
#include "grid/grid.h"
#include "room/cave-filler.h"
#include "room/lake-types.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "floor/floor.h"
+#include "grid/door.h"
#include "grid/grid.h"
#include "grid/trap.h"
#include "room/door-definition.h"
#include "room/rooms-pit-nest.h"
#include "dungeon/dungeon.h"
#include "floor/floor-generator.h"
-#include "floor/floor.h"
#include "game-option/cheat-options.h"
#include "game-option/cheat-types.h"
+#include "grid/door.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "monster-floor/monster-generator.h"
#include "floor/floor-generator.h"
#include "floor/floor.h"
#include "game-option/cheat-types.h"
+#include "grid/door.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "monster-race/monster-race-hook.h"
#include "floor/floor.h"
#include "floor/wild.h"
#include "game-option/cheat-types.h"
+#include "grid/door.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "grid/trap.h"