#include "dungeon/dungeon.h"
#include "effect/effect-characteristics.h"
#include "floor/cave.h"
-#include "floor/floor.h"
+#include "floor/line-of-sight.h"
#include "grid/grid.h"
#include "main/sound-definitions-table.h"
#include "monster-race/monster-race.h"
#include "player/attack-defense-types.h"
#include "player/player-race.h"
#include "player/special-defense-types.h"
+#include "player/player-status-flags.h"
#include "realm/realm-song-numbers.h"
#include "spell/range-calc.h"
#include "spell/spell-types.h"
#include "system/floor-type-definition.h"
+#include "target/projection-path-calculator.h"
/*!
* @brief モンスターが敵対モンスターにビームを当てること可能かを判定する /
{
floor_type *floor_ptr = target_ptr->current_floor_ptr;
u16b grid_g[512];
- int grid_n = project_path(target_ptr, grid_g, get_max_range(target_ptr), y1, x1, y2, x2, PROJECT_THRU);
+ int grid_n = projection_path(target_ptr, grid_g, get_max_range(target_ptr), y1, x1, y2, x2, PROJECT_THRU);
if (!grid_n)
return FALSE;
POSITION y, x;
bool is_friend = is_pet(m_ptr);
for (int i = 0; i < grid_n; i++) {
- y = GRID_Y(grid_g[i]);
- x = GRID_X(grid_g[i]);
+ y = get_grid_y(grid_g[i]);
+ x = get_grid_x(grid_g[i]);
if (y == y2 && x == x2)
hit2 = TRUE;
}
u16b grid_g[512];
- int grid_n = project_path(master_ptr, grid_g, get_max_range(master_ptr), y1, x1, y2, x2, flg);
+ int grid_n = projection_path(master_ptr, grid_g, get_max_range(master_ptr), y1, x1, y2, x2, flg);
int i;
POSITION y = y1;
POSITION x = x1;
for (i = 0; i < grid_n; ++i) {
- int ny = GRID_Y(grid_g[i]);
- int nx = GRID_X(grid_g[i]);
+ int ny = get_grid_y(grid_g[i]);
+ int nx = get_grid_x(grid_g[i]);
if (flg & PROJECT_DISI) {
if (cave_stop_disintegration(master_ptr->current_floor_ptr, ny, nx))
if (!cave_los_bold(master_ptr->current_floor_ptr, ny, nx))
break;
} else {
- if (!cave_have_flag_bold(master_ptr->current_floor_ptr, ny, nx, FF_PROJECT))
+ if (!cave_has_flag_bold(master_ptr->current_floor_ptr, ny, nx, FF_PROJECT))
break;
}
void get_project_point(player_type *target_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg)
{
u16b path_g[128];
- int path_n = project_path(target_ptr, path_g, get_max_range(target_ptr), sy, sx, *ty, *tx, flg);
+ int path_n = projection_path(target_ptr, path_g, get_max_range(target_ptr), sy, sx, *ty, *tx, flg);
*ty = sy;
*tx = sx;
for (int i = 0; i < path_n; i++) {
- sy = GRID_Y(path_g[i]);
- sx = GRID_X(path_g[i]);
- if (!cave_have_flag_bold(target_ptr->current_floor_ptr, sy, sx, FF_PROJECT))
+ sy = get_grid_y(path_g[i]);
+ sx = get_grid_x(path_g[i]);
+ if (!cave_has_flag_bold(target_ptr->current_floor_ptr, sy, sx, FF_PROJECT))
break;
*ty = sy;
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (r_ptr->flags4 & RF4_BR_ACID) {
- if (!creature_ptr->immune_acid && (creature_ptr->oppose_acid || music_singing(creature_ptr, MUSIC_RESIST)))
+ if (!has_immune_acid(creature_ptr) && (creature_ptr->oppose_acid || music_singing(creature_ptr, MUSIC_RESIST)))
return TRUE;
if (creature_ptr->special_defense & DEFENSE_ACID)
if (r_ptr->flags4 & RF4_BR_FIRE) {
if (!((creature_ptr->prace == RACE_BALROG) && creature_ptr->lev > 44)) {
- if (!creature_ptr->immune_fire && (creature_ptr->oppose_fire || music_singing(creature_ptr, MUSIC_RESIST)))
+ if (!has_immune_fire(creature_ptr) && (creature_ptr->oppose_fire || music_singing(creature_ptr, MUSIC_RESIST)))
return TRUE;
if (creature_ptr->special_defense & DEFENSE_FIRE)
}
if (r_ptr->flags4 & RF4_BR_ELEC) {
- if (!creature_ptr->immune_elec && (creature_ptr->oppose_elec || music_singing(creature_ptr, MUSIC_RESIST)))
+ if (!has_immune_elec(creature_ptr) && (creature_ptr->oppose_elec || music_singing(creature_ptr, MUSIC_RESIST)))
return TRUE;
if (creature_ptr->special_defense & DEFENSE_ELEC)
}
if (r_ptr->flags4 & RF4_BR_COLD) {
- if (!creature_ptr->immune_cold && (creature_ptr->oppose_cold || music_singing(creature_ptr, MUSIC_RESIST)))
+ if (!has_immune_cold(creature_ptr) && (creature_ptr->oppose_cold || music_singing(creature_ptr, MUSIC_RESIST)))
return TRUE;
if (creature_ptr->special_defense & DEFENSE_COLD)