#include "target/target-preparation.h"
#include "floor/cave.h"
-#include "floor/floor.h"
#include "game-option/input-options.h"
#include "grid/feature.h"
#include "grid/grid.h"
#include "object/object-mark-types.h"
#include "system/floor-type-definition.h"
#include "system/object-type-definition.h"
+#include "target/projection-path-calculator.h"
#include "target/target-types.h"
#include "util/bit-flags-calculator.h"
#include "util/sort.h"
if (g_ptr->info & CAVE_OBJECT)
return TRUE;
- if (have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_NOTICE))
+ if (has_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_NOTICE))
return TRUE;
}
}
if (mode & (TARGET_KILL)) {
- ang_sort(creature_ptr, tmp_pos.x, tmp_pos.y, tmp_pos.n, ang_sort_comp_distance, ang_sort_swap_distance);
+ ang_sort(creature_ptr, tmp_pos.x, tmp_pos.y, tmp_pos.n, ang_sort_comp_distance, ang_sort_swap_position);
} else {
- ang_sort(creature_ptr, tmp_pos.x, tmp_pos.y, tmp_pos.n, ang_sort_comp_importance, ang_sort_swap_distance);
+ ang_sort(creature_ptr, tmp_pos.x, tmp_pos.y, tmp_pos.n, ang_sort_comp_importance, ang_sort_swap_position);
}
if (creature_ptr->riding == 0 || !target_pet || (tmp_pos.n <= 1) || !(mode & (TARGET_KILL)))
tmp_pos.x[0] = tmp_pos.x[1];
tmp_pos.x[1] = tmp;
}
+
+void target_sensing_monsters_prepare(player_type *creature_ptr, pos_list* plist)
+{
+ plist->n = 0;
+
+ // 幻覚時は正常に感知できない
+ if (creature_ptr->image)
+ return;
+
+ for (int i = 1; i < creature_ptr->current_floor_ptr->m_max; i++) {
+ monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[i];
+ if (!monster_is_valid(m_ptr) || !m_ptr->ml || is_pet(m_ptr))
+ continue;
+
+ plist->x[plist->n] = m_ptr->fx;
+ plist->y[plist->n] = m_ptr->fy;
+ plist->n++;
+ }
+
+ ang_sort(creature_ptr, plist->x, plist->y, plist->n, ang_sort_comp_importance, ang_sort_swap_position);
+}