<ClCompile Include="..\..\src\floor\floor-generator.c" />\r
<ClCompile Include="..\..\src\floor\floor-save.c" />\r
<ClCompile Include="..\..\src\floor\floor-town.c" />\r
- <ClCompile Include="..\..\src\floor\floor.c" />\r
<ClCompile Include="..\..\src\floor\geometry.c" />\r
<ClCompile Include="..\..\src\birth\history.c" />\r
<ClCompile Include="..\..\src\monster\horror-descriptions.c" />\r
<ClInclude Include="..\..\src\floor\floor-generator.h" />\r
<ClInclude Include="..\..\src\floor\floor-save.h" />\r
<ClInclude Include="..\..\src\floor\floor-town.h" />\r
- <ClInclude Include="..\..\src\floor\floor.h" />\r
<ClInclude Include="..\..\src\system\gamevalue.h" />\r
<ClInclude Include="..\..\src\floor\geometry.h" />\r
<ClInclude Include="..\..\src\grid\grid.h" />\r
<ClCompile Include="..\..\src\core\game-play.c">
<Filter>core</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\floor\floor.c">
- <Filter>floor</Filter>
- </ClCompile>
<ClCompile Include="..\..\src\floor\floor-events.c">
<Filter>floor</Filter>
</ClCompile>
<ClInclude Include="..\..\src\core\game-play.h">
<Filter>core</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\floor\floor.h">
- <Filter>floor</Filter>
- </ClInclude>
<ClInclude Include="..\..\src\floor\floor-events.h">
<Filter>floor</Filter>
</ClInclude>
floor/cave-generator.c floor/cave-generator.h \
floor/dungeon-tunnel-util.c floor/dungeon-tunnel-util.h \
floor/fixed-map-generator.c floor/fixed-map-generator.h \
- floor/floor.c floor/floor.h \
floor/floor-allocation-types.h \
floor/floor-base-definitions.h \
floor/floor-changer.c floor/floor-changer.h \
#include "core/disturbance.h"
#include "core/player-update-types.h"
#include "core/stuff-handler.h"
-#include "floor/floor.h"
#include "floor/pattern-walk.h"
#include "game-option/input-options.h"
#include "grid/feature.h"
#include "action/movement-execution.h"
#include "core/disturbance.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/disturbance-options.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "info-reader/fixed-map-parser.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/birth-options.h"
#include "game-option/cheat-options.h"
#include "inventory/inventory-slot-types.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
#include "inventory/inventory-object.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
#include "core/player-update-types.h"
#include "core/window-redrawer.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
#include "game-option/disturbance-options.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
#include "core/player-update-types.h"
#include "core/window-redrawer.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
#include "game-option/disturbance-options.h"
#include "game-option/input-options.h"
#include "inventory/player-inventory.h"
#include "floor/floor-leaver.h"
#include "floor/floor-mode-changer.h"
#include "floor/floor-util.h"
-#include "floor/floor.h"
#include "floor/wild.h"
#include "game-option/cheat-options.h"
#include "game-option/input-options.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
#include "floor/floor-save-util.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "floor/wild.h"
#include "game-option/disturbance-options.h"
#include "game-option/map-screen-options.h"
#include "dungeon/quest.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "grid/feature-flag-types.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "floor/floor-events.h"
#include "floor/floor-mode-changer.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
#include "game-option/play-record-options.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "effect/effect-player.h"
#include "effect/spells-effect-util.h"
#include "floor/cave.h"
-#include "floor/floor.h"
#include "floor/line-of-sight.h"
#include "game-option/special-options.h"
#include "grid/feature-flag-types.h"
#include "floor/floor-object.h"
#include "floor/floor-save-util.h"
#include "floor/floor-save.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "floor/wild.h"
#include "game-option/birth-options.h"
#include "game-option/play-record-options.h"
#include "floor/cave-generator.h"
#include "floor/floor-events.h"
#include "floor/floor-save.h" // todo precalc_cur_num_of_pet() が依存している、違和感.
-#include "floor/floor.h" // todo wipe_o_list() が依存している、違和感.
+#include "floor/floor-util.h"
#include "floor/wild.h"
#include "game-option/birth-options.h"
#include "game-option/cheat-types.h"
-#include "floor/floor-util.h"
+/*!
+ * @brief フロア全体の処理に関するユーティリティ
+ * @date 2019/04/24
+ * @author deskull
+ */
+#include "floor/floor-util.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
+#include "effect/effect-characteristics.h"
+#include "floor/cave.h"
#include "floor/floor-town.h"
+#include "floor/line-of-sight.h"
+#include "game-option/birth-options.h"
+#include "grid/feature.h"
+#include "grid/grid.h"
+#include "object-hook/hook-checker.h"
+#include "object-hook/hook-enchant.h"
+#include "object/object-generator.h"
+#include "perception/object-perception.h"
+#include "system/artifact-type-definition.h"
#include "system/floor-type-definition.h"
+#include "target/projection-path-calculator.h"
+#include "world/world.h"
+
+/*
+ * The array of floor [MAX_WID][MAX_HGT].
+ * Not completely allocated, that would be inefficient
+ * Not completely hardcoded, that would overflow memory
+ */
+floor_type floor_info;
+
+static int scent_when = 0;
+
+/*
+ * Characters leave scent trails for perceptive monsters to track.
+ *
+ * Smell is rather more limited than sound. Many creatures cannot use
+ * it at all, it doesn't extend very far outwards from the character's
+ * current position, and monsters can use it to home in the character,
+ * but not to run away from him.
+ *
+ * Smell is valued according to age. When a character takes his turn,
+ * scent is aged by one, and new scent of the current age is laid down.
+ * Speedy characters leave more scent, true, but it also ages faster,
+ * which makes it harder to hunt them down.
+ *
+ * Whenever the age count loops, most of the scent trail is erased and
+ * the age of the remainder is recalculated.
+ */
+void update_smell(floor_type *floor_ptr, player_type *subject_ptr)
+{
+ /* Create a table that controls the spread of scent */
+ const int scent_adjust[5][5] = {
+ { -1, 0, 0, 0, -1 },
+ { 0, 1, 1, 1, 0 },
+ { 0, 1, 2, 1, 0 },
+ { 0, 1, 1, 1, 0 },
+ { -1, 0, 0, 0, -1 },
+ };
+
+ if (++scent_when == 254) {
+ for (POSITION y = 0; y < floor_ptr->height; y++) {
+ for (POSITION x = 0; x < floor_ptr->width; x++) {
+ int w = floor_ptr->grid_array[y][x].when;
+ floor_ptr->grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
+ }
+ }
+
+ scent_when = 126;
+ }
+
+ for (POSITION i = 0; i < 5; i++) {
+ for (POSITION j = 0; j < 5; j++) {
+ grid_type *g_ptr;
+ POSITION y = i + subject_ptr->y - 2;
+ POSITION x = j + subject_ptr->x - 2;
+ if (!in_bounds(floor_ptr, y, x))
+ continue;
+
+ g_ptr = &floor_ptr->grid_array[y][x];
+ if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(subject_ptr, g_ptr->feat))
+ continue;
+ if (!player_has_los_bold(subject_ptr, y, x))
+ continue;
+ if (scent_adjust[i][j] == -1)
+ continue;
+
+ g_ptr->when = scent_when + scent_adjust[i][j];
+ }
+ }
+}
+
+/*
+ * Hack -- forget the "flow" information
+ */
+void forget_flow(floor_type *floor_ptr)
+{
+ for (POSITION y = 0; y < floor_ptr->height; y++) {
+ for (POSITION x = 0; x < floor_ptr->width; x++) {
+ floor_ptr->grid_array[y][x].dist = 0;
+ floor_ptr->grid_array[y][x].cost = 0;
+ floor_ptr->grid_array[y][x].when = 0;
+ }
+ }
+}
+
+/*!
+ * @brief グローバルオブジェクト配列を初期化する /
+ * Delete all the items when player leaves the level
+ * @note we do NOT visually reflect these (irrelevant) changes
+ * @details
+ * Hack -- we clear the "g_ptr->o_idx" field for every grid,
+ * and the "m_ptr->next_o_idx" field for every monster, since
+ * we know we are clearing every object. Technically, we only
+ * clear those fields for grids/monsters containing objects,
+ * and we clear it once for every such object.
+ * @return なし
+ */
+void wipe_o_list(floor_type *floor_ptr)
+{
+ for (int i = 1; i < floor_ptr->o_max; i++) {
+ object_type *o_ptr = &floor_ptr->o_list[i];
+ if (!object_is_valid(o_ptr))
+ continue;
+
+ if (!current_world_ptr->character_dungeon || preserve_mode) {
+ if (object_is_fixed_artifact(o_ptr) && !object_is_known(o_ptr)) {
+ a_info[o_ptr->name1].cur_num = 0;
+ }
+ }
+
+ if (object_is_held_monster(o_ptr)) {
+ monster_type *m_ptr;
+ m_ptr = &floor_ptr->m_list[o_ptr->held_m_idx];
+ m_ptr->hold_o_idx = 0;
+ object_wipe(o_ptr);
+ continue;
+ }
+
+ grid_type *g_ptr;
+ POSITION y = o_ptr->iy;
+ POSITION x = o_ptr->ix;
+
+ g_ptr = &floor_ptr->grid_array[y][x];
+ g_ptr->o_idx = 0;
+ object_wipe(o_ptr);
+ }
+
+ floor_ptr->o_max = 1;
+ floor_ptr->o_cnt = 0;
+}
+
+/*
+ * Standard "find me a location" function
+ *
+ * Obtains a legal location within the given distance of the initial
+ * location, and with "los()" from the source to destination location.
+ *
+ * This function is often called from inside a loop which searches for
+ * locations while increasing the "d" distance.
+ *
+ * Currently the "m" parameter is unused.
+ */
+void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode)
+{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ POSITION nx, ny;
+ while (TRUE) {
+ ny = rand_spread(y, d);
+ nx = rand_spread(x, d);
+
+ if (!in_bounds(floor_ptr, ny, nx))
+ continue;
+ if ((d > 1) && (distance(y, x, ny, nx) > d))
+ continue;
+ if (mode & PROJECT_LOS) {
+ if (los(player_ptr, y, x, ny, nx))
+ break;
+ continue;
+ }
+
+ if (projectable(player_ptr, y, x, ny, nx))
+ break;
+ }
+
+ *yp = ny;
+ *xp = nx;
+}
/*!
* @brief 現在のマップ名を返す /
#include "system/angband.h"
+extern floor_type floor_info;
+
+void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
+void forget_flow(floor_type *floor_ptr);
+void wipe_o_list(floor_type *floor_ptr);
+void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
concptr map_name(player_type *creature_ptr);
+++ /dev/null
-#include "floor/floor.h"
-#include "effect/effect-characteristics.h"
-#include "floor/cave.h"
-#include "floor/line-of-sight.h"
-#include "game-option/birth-options.h"
-#include "grid/feature.h"
-#include "mind/mind-ninja.h"
-#include "object-hook/hook-checker.h"
-#include "object-hook/hook-enchant.h"
-#include "object/object-generator.h"
-#include "perception/object-perception.h"
-#include "system/artifact-type-definition.h"
-#include "system/floor-type-definition.h"
-#include "target/projection-path-calculator.h"
-#include "world/world.h"
-
-/*
- * The array of floor [MAX_WID][MAX_HGT].
- * Not completely allocated, that would be inefficient
- * Not completely hardcoded, that would overflow memory
- */
-floor_type floor_info;
-
-static int scent_when = 0;
-
-/*
- * Characters leave scent trails for perceptive monsters to track.
- *
- * Smell is rather more limited than sound. Many creatures cannot use
- * it at all, it doesn't extend very far outwards from the character's
- * current position, and monsters can use it to home in the character,
- * but not to run away from him.
- *
- * Smell is valued according to age. When a character takes his turn,
- * scent is aged by one, and new scent of the current age is laid down.
- * Speedy characters leave more scent, true, but it also ages faster,
- * which makes it harder to hunt them down.
- *
- * Whenever the age count loops, most of the scent trail is erased and
- * the age of the remainder is recalculated.
- */
-void update_smell(floor_type *floor_ptr, player_type *subject_ptr)
-{
- /* Create a table that controls the spread of scent */
- const int scent_adjust[5][5] = {
- { -1, 0, 0, 0, -1 },
- { 0, 1, 1, 1, 0 },
- { 0, 1, 2, 1, 0 },
- { 0, 1, 1, 1, 0 },
- { -1, 0, 0, 0, -1 },
- };
-
- if (++scent_when == 254) {
- for (POSITION y = 0; y < floor_ptr->height; y++) {
- for (POSITION x = 0; x < floor_ptr->width; x++) {
- int w = floor_ptr->grid_array[y][x].when;
- floor_ptr->grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
- }
- }
-
- scent_when = 126;
- }
-
- for (POSITION i = 0; i < 5; i++) {
- for (POSITION j = 0; j < 5; j++) {
- grid_type *g_ptr;
- POSITION y = i + subject_ptr->y - 2;
- POSITION x = j + subject_ptr->x - 2;
- if (!in_bounds(floor_ptr, y, x))
- continue;
-
- g_ptr = &floor_ptr->grid_array[y][x];
- if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(subject_ptr, g_ptr->feat))
- continue;
- if (!player_has_los_bold(subject_ptr, y, x))
- continue;
- if (scent_adjust[i][j] == -1)
- continue;
-
- g_ptr->when = scent_when + scent_adjust[i][j];
- }
- }
-}
-
-/*
- * Hack -- forget the "flow" information
- */
-void forget_flow(floor_type *floor_ptr)
-{
- for (POSITION y = 0; y < floor_ptr->height; y++) {
- for (POSITION x = 0; x < floor_ptr->width; x++) {
- floor_ptr->grid_array[y][x].dist = 0;
- floor_ptr->grid_array[y][x].cost = 0;
- floor_ptr->grid_array[y][x].when = 0;
- }
- }
-}
-
-/*!
- * @brief グローバルオブジェクト配列を初期化する /
- * Delete all the items when player leaves the level
- * @note we do NOT visually reflect these (irrelevant) changes
- * @details
- * Hack -- we clear the "g_ptr->o_idx" field for every grid,
- * and the "m_ptr->next_o_idx" field for every monster, since
- * we know we are clearing every object. Technically, we only
- * clear those fields for grids/monsters containing objects,
- * and we clear it once for every such object.
- * @return なし
- */
-void wipe_o_list(floor_type *floor_ptr)
-{
- for (int i = 1; i < floor_ptr->o_max; i++) {
- object_type *o_ptr = &floor_ptr->o_list[i];
- if (!object_is_valid(o_ptr))
- continue;
-
- if (!current_world_ptr->character_dungeon || preserve_mode) {
- if (object_is_fixed_artifact(o_ptr) && !object_is_known(o_ptr)) {
- a_info[o_ptr->name1].cur_num = 0;
- }
- }
-
- if (object_is_held_monster(o_ptr)) {
- monster_type *m_ptr;
- m_ptr = &floor_ptr->m_list[o_ptr->held_m_idx];
- m_ptr->hold_o_idx = 0;
- object_wipe(o_ptr);
- continue;
- }
-
- grid_type *g_ptr;
- POSITION y = o_ptr->iy;
- POSITION x = o_ptr->ix;
-
- g_ptr = &floor_ptr->grid_array[y][x];
- g_ptr->o_idx = 0;
- object_wipe(o_ptr);
- }
-
- floor_ptr->o_max = 1;
- floor_ptr->o_cnt = 0;
-}
-
-/*
- * Standard "find me a location" function
- *
- * Obtains a legal location within the given distance of the initial
- * location, and with "los()" from the source to destination location.
- *
- * This function is often called from inside a loop which searches for
- * locations while increasing the "d" distance.
- *
- * Currently the "m" parameter is unused.
- */
-void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode)
-{
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
- POSITION nx, ny;
- while (TRUE) {
- ny = rand_spread(y, d);
- nx = rand_spread(x, d);
-
- if (!in_bounds(floor_ptr, ny, nx))
- continue;
- if ((d > 1) && (distance(y, x, ny, nx) > d))
- continue;
- if (mode & PROJECT_LOS) {
- if (los(player_ptr, y, x, ny, nx))
- break;
- continue;
- }
-
- if (projectable(player_ptr, y, x, ny, nx))
- break;
- }
-
- *yp = ny;
- *xp = nx;
-}
+++ /dev/null
-#pragma once
-
-#include "system/angband.h"
-
-extern floor_type floor_info;
-
-void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
-void forget_flow(floor_type *floor_ptr);
-void wipe_o_list(floor_type *floor_ptr);
-void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
#include "effect/effect-characteristics.h"
#include "effect/spells-effect-util.h"
#include "floor/cave.h"
-#include "floor/floor.h"
#include "game-option/map-screen-options.h"
#include "game-option/special-options.h"
#include "grid/feature.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
#include "floor/floor-town.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "floor/wild.h"
#include "game-option/option-flags.h"
#include "game-option/option-types-table.h"
#include "effect/spells-effect-util.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/disturbance-options.h"
#include "grid/feature.h"
#include "inventory/inventory-slot-types.h"
#include "core/player-update-types.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#include "floor/floor.h"
#include "game-option/text-display-options.h"
#include "grid/grid.h"
#include "inventory/inventory-slot-types.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/birth-options.h"
#include "game-option/play-record-options.h"
#include "grid/grid.h"
#include "monster-floor/monster-generator.h"
#include "dungeon/dungeon.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/cheat-options.h"
#include "grid/grid.h"
#include "monster-floor/one-monster-placer.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
#include "monster-race/monster-race.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "grid/feature-flag-types.h"
#include "spell-kind/spells-launcher.h"
#include "spell-kind/spells-specific-bolt.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/disturbance-options.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "floor/floor-events.h"
#include "floor/floor-leaver.h"
#include "floor/floor-save.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/birth-options.h"
#include "grid/feature.h"
#include "inventory/inventory-object.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
#include "player/player-class.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "floor/floor-generator.h"
-#include "floor/floor.h"
#include "game-option/cheat-types.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "room/vault-builder.h"
#include "floor/cave.h"
#include "floor/floor-generator-util.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/cheat-options.h"
#include "grid/feature-flag-types.h"
#include "grid/grid.h"
#include "floor/cave.h"
#include "floor/floor-object.h"
#include "floor/floor-save.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/birth-options.h"
#include "game-option/cheat-options.h"
#include "game-option/map-screen-options.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "game-option/map-screen-options.h"
#include "grid/grid.h"
#include "mind/mind-ninja.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "grid/feature-flag-types.h"
#include "grid/grid.h"
#include "spell-kind/earthquake.h"
#include "blue-magic/blue-magic-checker.h"
#include "core/asking-player.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/floor-util.h"
#include "mind/mind-blue-mage.h"
#include "monster-floor/monster-generator.h"
#include "monster-floor/monster-summon.h"
#include "world/world-object.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
-#include "floor/floor.h"
#include "object-enchant/item-apply-magic.h"
#include "object/object-kind.h"
#include "system/alloc-entries.h"