<ClCompile Include="..\..\src\store\sell-order.c" />\r
<ClCompile Include="..\..\src\store\service-checker.c" />\r
<ClCompile Include="..\..\src\system\dungeon-data-definition.c" />\r
+ <ClCompile Include="..\..\src\target\grid-selector.c" />\r
<ClCompile Include="..\..\src\target\target-describer.c" />\r
<ClCompile Include="..\..\src\target\target-preparation.c" />\r
<ClCompile Include="..\..\src\view\display-inventory.c" />\r
<ClInclude Include="..\..\src\system\alloc-entries.h" />\r
<ClInclude Include="..\..\src\system\dungeon-data-definition.h" />\r
<ClInclude Include="..\..\src\system\floor-type-definition.h" />\r
+ <ClInclude Include="..\..\src\target\grid-selector.h" />\r
<ClInclude Include="..\..\src\target\target-describer.h" />\r
<ClInclude Include="..\..\src\target\target-preparation.h" />\r
<ClInclude Include="..\..\src\target\target-types.h" />\r
<ClCompile Include="..\..\src\target\target-preparation.c">
<Filter>target</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\target\grid-selector.c">
+ <Filter>target</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\combat\shoot.h">
<ClInclude Include="..\..\src\target\target-preparation.h">
<Filter>target</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\target\grid-selector.h">
+ <Filter>target</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
system/system-variables.c system/system-variables.h \
system/gamevalue.h \
\
+ target/grid-selector.c target/grid-selector.h \
target/target-describer.c target/target-describer.h \
target/target-preparation.c target/target-preparation.h \
target/target-types.h \
#include "grid/grid.h"
#include "player/player-move.h"
#include "system/floor-type-definition.h"
-#include "target/targeting.h"
+#include "target/grid-selector.h"
#include "view/display-messages.h"
#include "util/bit-flags-calculator.h"
#include "spell/process-effect.h"
#include "spell/spell-types.h"
#include "system/floor-type-definition.h"
+#include "target/grid-selector.h"
#include "target/target-preparation.h"
-#include "target/targeting.h"
#include "term/gameterm.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "spell/technic-info-table.h"
#include "status/action-setter.h"
#include "system/floor-type-definition.h"
+#include "target/grid-selector.h"
#include "target/targeting.h"
#include "term/screen-processor.h"
#include "util/bit-flags-calculator.h"
#include "spell/technic-info-table.h"
#include "status/bad-status-setter.h"
#include "system/floor-type-definition.h"
+#include "target/grid-selector.h"
#include "target/targeting.h"
#include "term/screen-processor.h"
#include "util/bit-flags-calculator.h"
#include "spell-kind/spells-launcher.h"
#include "spell/spell-types.h"
#include "system/floor-type-definition.h"
+#include "target/grid-selector.h"
#include "target/targeting.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
--- /dev/null
+#include "target/grid-selector.h"
+#include "core/player-redraw-types.h"
+#include "core/player-update-types.h"
+#include "core/window-redrawer.h"
+#include "core/stuff-handler.h"
+#include "floor/cave.h"
+#include "game-option/game-play-options.h"
+#include "game-option/keymap-directory-getter.h"
+#include "grid/feature-flag-types.h"
+#include "grid/grid.h"
+#include "io/cursor.h"
+#include "io/input-key-acceptor.h"
+#include "io/screen-util.h"
+#include "system/floor-type-definition.h"
+#include "target/targeting.h"
+#include "term/screen-processor.h"
+#include "util/int-char-converter.h"
+#include "util/sort.h"
+#include "view/display-messages.h"
+#include "window/main-window-util.h"
+
+/*
+ * XAngband: determine if a given location is "interesting"
+ * based on target_set_accept function.
+ */
+static bool tgt_pt_accept(player_type *creature_ptr, POSITION y, POSITION x)
+{
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ if (!(in_bounds(floor_ptr, y, x)))
+ return FALSE;
+
+ if ((y == creature_ptr->y) && (x == creature_ptr->x))
+ return TRUE;
+
+ if (creature_ptr->image)
+ return FALSE;
+
+ grid_type *g_ptr;
+ g_ptr = &floor_ptr->grid_array[y][x];
+ if (!(g_ptr->info & (CAVE_MARK)))
+ return FALSE;
+
+ if (cave_have_flag_grid(g_ptr, FF_LESS) || cave_have_flag_grid(g_ptr, FF_MORE) || cave_have_flag_grid(g_ptr, FF_QUEST_ENTER)
+ || cave_have_flag_grid(g_ptr, FF_QUEST_EXIT))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*
+ * XAngband: Prepare the "temp" array for "tget_pt"
+ * based on target_set_prepare funciton.
+ */
+static void tgt_pt_prepare(player_type *creature_ptr)
+{
+ tmp_pos.n = 0;
+ if (!expand_list)
+ return;
+
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ for (POSITION y = 1; y < floor_ptr->height; y++) {
+ for (POSITION x = 1; x < floor_ptr->width; x++) {
+ if (!tgt_pt_accept(creature_ptr, y, x))
+ continue;
+
+ tmp_pos.x[tmp_pos.n] = x;
+ tmp_pos.y[tmp_pos.n] = y;
+ tmp_pos.n++;
+ }
+ }
+
+ ang_sort(creature_ptr, tmp_pos.x, tmp_pos.y, tmp_pos.n, ang_sort_comp_distance, ang_sort_swap_distance);
+}
+
+/*
+ * old -- from PsiAngband.
+ */
+bool tgt_pt(player_type *creature_ptr, POSITION *x_ptr, POSITION *y_ptr)
+{
+ TERM_LEN wid, hgt;
+ get_screen_size(&wid, &hgt);
+
+ POSITION x = creature_ptr->x;
+ POSITION y = creature_ptr->y;
+ if (expand_list)
+ tgt_pt_prepare(creature_ptr);
+
+ msg_print(_("場所を選んでスペースキーを押して下さい。", "Select a point and press space."));
+ msg_flag = FALSE;
+
+ char ch = 0;
+ int n = 0;
+ bool success = FALSE;
+ while ((ch != ESCAPE) && !success) {
+ bool move_fast = FALSE;
+ move_cursor_relative(y, x);
+ ch = inkey();
+ switch (ch) {
+ case ESCAPE:
+ break;
+ case ' ':
+ case 't':
+ case '.':
+ case '5':
+ case '0':
+ if (player_bold(creature_ptr, y, x))
+ ch = 0;
+ else
+ success = TRUE;
+
+ break;
+ case '>':
+ case '<': {
+ if (!expand_list || !tmp_pos.n)
+ break;
+
+ int dx, dy;
+ int cx = (panel_col_min + panel_col_max) / 2;
+ int cy = (panel_row_min + panel_row_max) / 2;
+ n++;
+ for (; n < tmp_pos.n; ++n) {
+ grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[tmp_pos.y[n]][tmp_pos.x[n]];
+ if (cave_have_flag_grid(g_ptr, FF_STAIRS) && cave_have_flag_grid(g_ptr, ch == '>' ? FF_MORE : FF_LESS))
+ break;
+ }
+
+ if (n == tmp_pos.n) {
+ n = 0;
+ y = creature_ptr->y;
+ x = creature_ptr->x;
+ verify_panel(creature_ptr);
+ creature_ptr->update |= PU_MONSTERS;
+ creature_ptr->redraw |= PR_MAP;
+ creature_ptr->window |= PW_OVERHEAD;
+ handle_stuff(creature_ptr);
+ } else {
+ y = tmp_pos.y[n];
+ x = tmp_pos.x[n];
+ dy = 2 * (y - cy) / hgt;
+ dx = 2 * (x - cx) / wid;
+ if (dy || dx)
+ change_panel(creature_ptr, dy, dx);
+ }
+
+ break;
+ }
+ default: {
+ int d = get_keymap_dir(ch);
+ if (isupper(ch))
+ move_fast = TRUE;
+
+ if (d == 0)
+ break;
+
+ int dx = ddx[d];
+ int dy = ddy[d];
+ if (move_fast) {
+ int mag = MIN(wid / 2, hgt / 2);
+ x += dx * mag;
+ y += dy * mag;
+ } else {
+ x += dx;
+ y += dy;
+ }
+
+ if (((x < panel_col_min + wid / 2) && (dx > 0)) || ((x > panel_col_min + wid / 2) && (dx < 0)))
+ dx = 0;
+
+ if (((y < panel_row_min + hgt / 2) && (dy > 0)) || ((y > panel_row_min + hgt / 2) && (dy < 0)))
+ dy = 0;
+
+ if ((y >= panel_row_min + hgt) || (y < panel_row_min) || (x >= panel_col_min + wid) || (x < panel_col_min))
+ change_panel(creature_ptr, dy, dx);
+
+ if (x >= creature_ptr->current_floor_ptr->width - 1)
+ x = creature_ptr->current_floor_ptr->width - 2;
+ else if (x <= 0)
+ x = 1;
+
+ if (y >= creature_ptr->current_floor_ptr->height - 1)
+ y = creature_ptr->current_floor_ptr->height - 2;
+ else if (y <= 0)
+ y = 1;
+
+ break;
+ }
+ }
+ }
+
+ prt("", 0, 0);
+ verify_panel(creature_ptr);
+ creature_ptr->update |= PU_MONSTERS;
+ creature_ptr->redraw |= PR_MAP;
+ creature_ptr->window |= PW_OVERHEAD;
+ handle_stuff(creature_ptr);
+ *x_ptr = x;
+ *y_ptr = y;
+ return success;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+bool tgt_pt(player_type *creature_ptr, POSITION *x, POSITION *y);
repeat_push((COMMAND_CODE)command_dir);
return TRUE;
}
-
-/*
- * XAngband: determine if a given location is "interesting"
- * based on target_set_accept function.
- */
-static bool tgt_pt_accept(player_type *creature_ptr, POSITION y, POSITION x)
-{
- floor_type *floor_ptr = creature_ptr->current_floor_ptr;
- if (!(in_bounds(floor_ptr, y, x)))
- return FALSE;
-
- if ((y == creature_ptr->y) && (x == creature_ptr->x))
- return TRUE;
-
- if (creature_ptr->image)
- return FALSE;
-
- grid_type *g_ptr;
- g_ptr = &floor_ptr->grid_array[y][x];
- if (!(g_ptr->info & (CAVE_MARK)))
- return FALSE;
-
- if (cave_have_flag_grid(g_ptr, FF_LESS) || cave_have_flag_grid(g_ptr, FF_MORE) || cave_have_flag_grid(g_ptr, FF_QUEST_ENTER)
- || cave_have_flag_grid(g_ptr, FF_QUEST_EXIT))
- return TRUE;
-
- return FALSE;
-}
-
-/*
- * XAngband: Prepare the "temp" array for "tget_pt"
- * based on target_set_prepare funciton.
- */
-static void tgt_pt_prepare(player_type *creature_ptr)
-{
- tmp_pos.n = 0;
- if (!expand_list)
- return;
-
- floor_type *floor_ptr = creature_ptr->current_floor_ptr;
- for (POSITION y = 1; y < floor_ptr->height; y++) {
- for (POSITION x = 1; x < floor_ptr->width; x++) {
- if (!tgt_pt_accept(creature_ptr, y, x))
- continue;
-
- tmp_pos.x[tmp_pos.n] = x;
- tmp_pos.y[tmp_pos.n] = y;
- tmp_pos.n++;
- }
- }
-
- ang_sort(creature_ptr, tmp_pos.x, tmp_pos.y, tmp_pos.n, ang_sort_comp_distance, ang_sort_swap_distance);
-}
-
-/*
- * old -- from PsiAngband.
- */
-bool tgt_pt(player_type *creature_ptr, POSITION *x_ptr, POSITION *y_ptr)
-{
- TERM_LEN wid, hgt;
- get_screen_size(&wid, &hgt);
-
- POSITION x = creature_ptr->x;
- POSITION y = creature_ptr->y;
- if (expand_list)
- tgt_pt_prepare(creature_ptr);
-
- msg_print(_("場所を選んでスペースキーを押して下さい。", "Select a point and press space."));
- msg_flag = FALSE;
-
- char ch = 0;
- int n = 0;
- bool success = FALSE;
- while ((ch != ESCAPE) && !success) {
- bool move_fast = FALSE;
- move_cursor_relative(y, x);
- ch = inkey();
- switch (ch) {
- case ESCAPE:
- break;
- case ' ':
- case 't':
- case '.':
- case '5':
- case '0':
- if (player_bold(creature_ptr, y, x))
- ch = 0;
- else
- success = TRUE;
-
- break;
- case '>':
- case '<': {
- if (!expand_list || !tmp_pos.n)
- break;
-
- int dx, dy;
- int cx = (panel_col_min + panel_col_max) / 2;
- int cy = (panel_row_min + panel_row_max) / 2;
- n++;
- for (; n < tmp_pos.n; ++n) {
- grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[tmp_pos.y[n]][tmp_pos.x[n]];
- if (cave_have_flag_grid(g_ptr, FF_STAIRS) && cave_have_flag_grid(g_ptr, ch == '>' ? FF_MORE : FF_LESS))
- break;
- }
-
- if (n == tmp_pos.n) {
- n = 0;
- y = creature_ptr->y;
- x = creature_ptr->x;
- verify_panel(creature_ptr);
- creature_ptr->update |= PU_MONSTERS;
- creature_ptr->redraw |= PR_MAP;
- creature_ptr->window |= PW_OVERHEAD;
- handle_stuff(creature_ptr);
- } else {
- y = tmp_pos.y[n];
- x = tmp_pos.x[n];
- dy = 2 * (y - cy) / hgt;
- dx = 2 * (x - cx) / wid;
- if (dy || dx)
- change_panel(creature_ptr, dy, dx);
- }
-
- break;
- }
- default: {
- int d = get_keymap_dir(ch);
- if (isupper(ch))
- move_fast = TRUE;
-
- if (d == 0)
- break;
-
- int dx = ddx[d];
- int dy = ddy[d];
- if (move_fast) {
- int mag = MIN(wid / 2, hgt / 2);
- x += dx * mag;
- y += dy * mag;
- } else {
- x += dx;
- y += dy;
- }
-
- if (((x < panel_col_min + wid / 2) && (dx > 0)) || ((x > panel_col_min + wid / 2) && (dx < 0)))
- dx = 0;
-
- if (((y < panel_row_min + hgt / 2) && (dy > 0)) || ((y > panel_row_min + hgt / 2) && (dy < 0)))
- dy = 0;
-
- if ((y >= panel_row_min + hgt) || (y < panel_row_min) || (x >= panel_col_min + wid) || (x < panel_col_min))
- change_panel(creature_ptr, dy, dx);
-
- if (x >= creature_ptr->current_floor_ptr->width - 1)
- x = creature_ptr->current_floor_ptr->width - 2;
- else if (x <= 0)
- x = 1;
-
- if (y >= creature_ptr->current_floor_ptr->height - 1)
- y = creature_ptr->current_floor_ptr->height - 2;
- else if (y <= 0)
- y = 1;
-
- break;
- }
- }
- }
-
- prt("", 0, 0);
- verify_panel(creature_ptr);
- creature_ptr->update |= (PU_MONSTERS);
- creature_ptr->redraw |= (PR_MAP);
- creature_ptr->window |= (PW_OVERHEAD);
- handle_stuff(creature_ptr);
- *x_ptr = x;
- *y_ptr = y;
- return success;
-}
bool get_aim_dir(player_type *creature_ptr, DIRECTION *dp);
bool get_direction(player_type *creature_ptr, DIRECTION *dp, bool allow_under, bool with_steed);
bool get_rep_dir(player_type *creature_ptr, DIRECTION *dp, bool under);
-bool tgt_pt(player_type *creature_ptr, POSITION *x, POSITION *y);
#include "system/angband-version.h"
#include "system/artifact-type-definition.h"
#include "system/floor-type-definition.h"
-#include "target/targeting.h"
+#include "target/grid-selector.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "util/angband-files.h"
#include "spell-realm/spells-chaos.h"
#include "spell/spells-status.h"
#include "system/floor-type-definition.h"
+#include "target/grid-selector.h"
#include "target/targeting.h"
#include "view/display-messages.h"