<ClCompile Include="..\..\src\mspell\improper-mspell-remover.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-attack-util.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-attack.c" />\r
+ <ClCompile Include="..\..\src\mspell\mspell-lite.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-selector.c" />\r
<ClCompile Include="..\..\src\mspell\smart-mspell-util.c" />\r
<ClCompile Include="..\..\src\mspell\specified-summon.c" />\r
<ClInclude Include="..\..\src\mspell\improper-mspell-remover.h" />\r
<ClInclude Include="..\..\src\mspell\mspell-attack-util.h" />\r
<ClInclude Include="..\..\src\mspell\mspell-attack.h" />\r
+ <ClInclude Include="..\..\src\mspell\mspell-lite.h" />\r
<ClInclude Include="..\..\src\mspell\mspell-selector.h" />\r
<ClInclude Include="..\..\src\mspell\smart-mspell-util.h" />\r
<ClInclude Include="..\..\src\mspell\specified-summon.h" />\r
<ClCompile Include="..\..\src\mspell\mspell-attack-util.c">
<Filter>mspell</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\mspell\mspell-lite.c">
+ <Filter>mspell</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\combat\shoot.h">
<ClInclude Include="..\..\src\mspell\mspell-attack-util.h">
<Filter>mspell</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\mspell\mspell-lite.h">
+ <Filter>mspell</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
mspell/mspell-curse.c mspell/mspell-curse.h \
mspell/mspell-dispel.c mspell/mspell-dispel.h \
mspell/mspell-judgement.c mspell/mspell-judgement.h \
+ mspell/mspell-lite.c mspell/mspell-lite.h \
mspell/mspell-summon.c mspell/mspell-summon.h \
mspell/mspell-util.c mspell/mspell-util.h \
mspell/mspell-type.h \
#include "action/tunnel-execution.h"
#include "core/player-update-types.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "main/sound-definitions-table.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
#include "flavor/flavor-describer.h"
+#include "floor/cave.h"
#include "floor/floor-events.h"
#include "floor/floor-town.h"
-#include "floor/floor.h"
#include "floor/wild.h"
#include "game-option/birth-options.h"
#include "game-option/input-options.h"
#include "store/store.h"
#include "system/floor-type-definition.h"
#include "term/screen-processor.h"
-#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "view/display-store.h"
#include "world/world.h"
bool feat_supports_los(FEAT_IDX f_idx) { return have_flag(f_info[f_idx].flags, FF_LOS); }
bool cave_los_grid(grid_type *grid_ptr) { return feat_supports_los(grid_ptr->feat); }
+
+bool cave_have_flag_grid(grid_type *grid_ptr, int feature_flags) { return have_flag(f_info[grid_ptr->feat].flags, feature_flags); }
bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x);
bool feat_supports_los(FEAT_IDX f_idx);
bool cave_los_grid(grid_type *grid_ptr);
+bool cave_have_flag_grid(grid_type *grid_ptr, int feature_flags);
((G) == &(C)->current_floor_ptr->grid_array[(C)->y][(C)->x])
-#define cave_have_flag_grid(C,INDEX) \
- (have_flag(f_info[(C)->feat].flags, (INDEX)))
-
-
/*
* Determine if a "legal" grid is a "clean" floor grid
* Determine if terrain-change spells are allowed in a grid.
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
+#include "floor/cave.h"
#include "floor/floor-town.h"
-#include "floor/floor.h"
#include "game-option/birth-options.h"
#include "game-option/map-screen-options.h"
#include "grid/feature.h"
#include "core/stuff-handler.h"
#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 "io/targeting.h"
#include "system/floor-type-definition.h"
#include "term/term-color-types.h"
-#include "util/bit-flags-calculator.h"
#include "view/display-map.h"
#include "window/main-window-util.h"
#include "world/world.h"
#include "mspell/mspell-attack-util.h"
#include "mspell/mspell-checker.h"
#include "mspell/mspell-judgement.h"
+#include "mspell/mspell-lite.h"
#include "mspell/mspell-mask-definitions.h"
#include "mspell/mspell-selector.h"
#include "mspell/mspell-util.h"
#include "monster/monster-description-types.h"
#endif
-/*!
- * @brief モンスターがプレイヤーにダメージを与えるための最適な座標を算出する /
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param m_ptr 技能を使用するモンスター構造体の参照ポインタ
- * @param yp 最適な目標地点のY座標を返す参照ポインタ
- * @param xp 最適な目標地点のX座標を返す参照ポインタ
- * @param f_flag 射線に入れるのを避ける地形の所持フラグ
- * @param path_check 射線を判定するための関数ポインタ
- * @return 有効な座標があった場合TRUEを返す
- */
-static bool adjacent_grid_check(player_type *target_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp, int f_flag,
- bool (*path_check)(player_type *, POSITION, POSITION, POSITION, POSITION))
-{
- static int tonari_y[4][8] = { { -1, -1, -1, 0, 0, 1, 1, 1 }, { -1, -1, -1, 0, 0, 1, 1, 1 }, { 1, 1, 1, 0, 0, -1, -1, -1 }, { 1, 1, 1, 0, 0, -1, -1, -1 } };
- static int tonari_x[4][8] = { { -1, 0, 1, -1, 1, -1, 0, 1 }, { 1, 0, -1, 1, -1, 1, 0, -1 }, { -1, 0, 1, -1, 1, -1, 0, 1 }, { 1, 0, -1, 1, -1, 1, 0, -1 } };
-
- int next;
- if (m_ptr->fy < target_ptr->y && m_ptr->fx < target_ptr->x)
- next = 0;
- else if (m_ptr->fy < target_ptr->y)
- next = 1;
- else if (m_ptr->fx < target_ptr->x)
- next = 2;
- else
- next = 3;
-
- floor_type *floor_ptr = target_ptr->current_floor_ptr;
- for (int i = 0; i < 8; i++) {
- int next_x = *xp + tonari_x[next][i];
- int next_y = *yp + tonari_y[next][i];
- grid_type *g_ptr;
- g_ptr = &floor_ptr->grid_array[next_y][next_x];
- if (!cave_have_flag_grid(g_ptr, f_flag))
- continue;
-
- if (path_check(target_ptr, m_ptr->fy, m_ptr->fx, next_y, next_x)) {
- *yp = next_y;
- *xp = next_x;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-static void decide_lite_range(player_type *target_ptr, msa_type *msa_ptr)
-{
- if ((msa_ptr->f4 & RF4_BR_LITE) == 0)
- return;
-
- msa_ptr->y_br_lite = msa_ptr->y;
- msa_ptr->x_br_lite = msa_ptr->x;
- if (los(target_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y_br_lite, msa_ptr->x_br_lite)) {
- feature_type *f_ptr = &f_info[target_ptr->current_floor_ptr->grid_array[msa_ptr->y_br_lite][msa_ptr->x_br_lite].feat];
- if (!have_flag(f_ptr->flags, FF_LOS) && have_flag(f_ptr->flags, FF_PROJECT) && one_in_(2))
- msa_ptr->f4 &= ~(RF4_BR_LITE);
- } else if (!adjacent_grid_check(target_ptr, msa_ptr->m_ptr, &msa_ptr->y_br_lite, &msa_ptr->x_br_lite, FF_LOS, los))
- msa_ptr->f4 &= ~(RF4_BR_LITE);
-
- if ((msa_ptr->f4 & RF4_BR_LITE) != 0)
- return;
-
- msa_ptr->y_br_lite = 0;
- msa_ptr->x_br_lite = 0;
-}
-
static void feature_projection(floor_type *floor_ptr, msa_type *msa_ptr)
{
feature_type *f_ptr = &f_info[floor_ptr->grid_array[msa_ptr->y][msa_ptr->x].feat];
--- /dev/null
+/*!
+ * @brief モンスターの魔法によってフロアを明るくする処理及びその判定
+ * @date 2020/07/23
+ * @author Hourier
+ */
+
+#include "mspell/mspell-lite.h"
+#include "floor/cave.h"
+#include "floor/floor.h"
+#include "grid/feature.h"
+#include "grid/grid.h"
+#include "monster-race/race-flags4.h"
+#include "mspell/mspell-attack-util.h"
+#include "system/floor-type-definition.h"
+#include "system/monster-type-definition.h"
+#include "util/bit-flags-calculator.h"
+
+/*!
+ * @brief モンスターがプレイヤーにダメージを与えるための最適な座標を算出する /
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param m_ptr 技能を使用するモンスター構造体の参照ポインタ
+ * @param yp 最適な目標地点のY座標を返す参照ポインタ
+ * @param xp 最適な目標地点のX座標を返す参照ポインタ
+ * @param f_flag 射線に入れるのを避ける地形の所持フラグ
+ * @param path_check 射線を判定するための関数ポインタ
+ * @return 有効な座標があった場合TRUEを返す
+ */
+bool adjacent_grid_check(player_type *target_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp, int f_flag, path_check_pf path_check)
+{
+ static int tonari_y[4][8] = { { -1, -1, -1, 0, 0, 1, 1, 1 }, { -1, -1, -1, 0, 0, 1, 1, 1 }, { 1, 1, 1, 0, 0, -1, -1, -1 }, { 1, 1, 1, 0, 0, -1, -1, -1 } };
+ static int tonari_x[4][8] = { { -1, 0, 1, -1, 1, -1, 0, 1 }, { 1, 0, -1, 1, -1, 1, 0, -1 }, { -1, 0, 1, -1, 1, -1, 0, 1 }, { 1, 0, -1, 1, -1, 1, 0, -1 } };
+
+ int next;
+ if (m_ptr->fy < target_ptr->y && m_ptr->fx < target_ptr->x)
+ next = 0;
+ else if (m_ptr->fy < target_ptr->y)
+ next = 1;
+ else if (m_ptr->fx < target_ptr->x)
+ next = 2;
+ else
+ next = 3;
+
+ for (int i = 0; i < 8; i++) {
+ int next_x = *xp + tonari_x[next][i];
+ int next_y = *yp + tonari_y[next][i];
+ grid_type *g_ptr;
+ g_ptr = &target_ptr->current_floor_ptr->grid_array[next_y][next_x];
+ if (!cave_have_flag_grid(g_ptr, f_flag))
+ continue;
+
+ if (path_check(target_ptr, m_ptr->fy, m_ptr->fx, next_y, next_x)) {
+ *yp = next_y;
+ *xp = next_x;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+void decide_lite_range(player_type *target_ptr, msa_type *msa_ptr)
+{
+ if ((msa_ptr->f4 & RF4_BR_LITE) == 0)
+ return;
+
+ msa_ptr->y_br_lite = msa_ptr->y;
+ msa_ptr->x_br_lite = msa_ptr->x;
+ if (los(target_ptr, msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx, msa_ptr->y_br_lite, msa_ptr->x_br_lite)) {
+ feature_type *f_ptr = &f_info[target_ptr->current_floor_ptr->grid_array[msa_ptr->y_br_lite][msa_ptr->x_br_lite].feat];
+ if (!have_flag(f_ptr->flags, FF_LOS) && have_flag(f_ptr->flags, FF_PROJECT) && one_in_(2))
+ msa_ptr->f4 &= ~(RF4_BR_LITE);
+ } else if (!adjacent_grid_check(target_ptr, msa_ptr->m_ptr, &msa_ptr->y_br_lite, &msa_ptr->x_br_lite, FF_LOS, los))
+ msa_ptr->f4 &= ~(RF4_BR_LITE);
+
+ if ((msa_ptr->f4 & RF4_BR_LITE) != 0)
+ return;
+
+ msa_ptr->y_br_lite = 0;
+ msa_ptr->x_br_lite = 0;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+typedef struct monster_type monster_type;
+typedef struct msa_type msa_type;
+typedef bool (*path_check_pf)(player_type *, POSITION, POSITION, POSITION, POSITION);
+bool adjacent_grid_check(player_type *target_ptr, monster_type *m_ptr, POSITION *yp, POSITION *xp, int f_flag, path_check_pf path_check);
+void decide_lite_range(player_type *target_ptr, msa_type *msa_ptr);
#include "core/player-update-types.h"
#include "core/stuff-handler.h"
#include "core/window-redrawer.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
#include "grid/feature.h"
#include "io/targeting.h"
#include "monster-race/monster-race.h"
#include "player/player-move.h"
#include "player/player-skill.h"
#include "system/floor-type-definition.h"
-#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
/*!
#include "core/window-redrawer.h"
#include "dungeon/dungeon-flag-types.h"
#include "dungeon/dungeon.h"
+#include "floor/cave.h"
#include "floor/floor-save.h"
-#include "floor/floor.h"
#include "grid/grid.h"
#include "grid/trap.h"
#include "monster-race/monster-race.h"
#include "realm/realm-song.h"
#include "system/floor-type-definition.h"
#include "system/object-type-definition.h"
-#include "util/bit-flags-calculator.h"
#include "util/string-processor.h"
#include "view/display-messages.h"
#include "core/window-redrawer.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
+#include "floor/cave.h"
#include "floor/floor-object.h"
-#include "floor/floor.h"
#include "game-option/disturbance-options.h"
#include "grid/feature.h"
#include "grid/grid.h"