7 #include "inventory/floor-item-getter.h"
8 #include "core/stuff-handler.h"
9 #include "core/window-redrawer.h"
10 #include "floor/floor-object.h"
11 #include "floor/object-scanner.h"
12 #include "game-option/input-options.h"
13 #include "game-option/option-flags.h"
14 #include "game-option/text-display-options.h"
15 #include "inventory/inventory-slot-types.h"
16 #include "inventory/inventory-util.h"
17 #include "inventory/item-selection-util.h"
18 #include "io/command-repeater.h"
19 #include "io/input-key-acceptor.h"
20 #include "io/input-key-requester.h"
21 #include "main/sound-of-music.h"
22 #include "object/item-tester-hooker.h"
23 #include "object/item-use-flags.h"
24 #include "object/object-info.h"
25 #include "player/player-status-flags.h"
26 #include "system/floor-type-definition.h"
27 #include "system/grid-type-definition.h"
28 #include "system/object-type-definition.h"
29 #include "system/player-type-definition.h"
30 #include "term/gameterm.h"
31 #include "term/screen-processor.h"
32 #include "util/int-char-converter.h"
33 #include "view/display-inventory.h"
34 #include "view/display-messages.h"
35 #include "window/display-sub-windows.h"
38 * @brief 床上アイテムへにタグ付けがされているかの調査処理 (のはず)
39 * @param player_ptr プレイヤーへの参照ポインタ
40 * @param fis_ptr 床上アイテムへの参照ポインタ
41 * @param prev_tag 前回選択したアイテムのタグ (のはず)
42 * @return プレイヤーによりアイテムが選択されたならTRUEを返す
43 * @todo 適切な関数名をどうしても付けられなかったので暫定でauxとした
45 static bool check_floor_item_tag_aux(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester)
47 if (!fis_ptr->floor || (*fis_ptr->cp >= 0))
50 if (*prev_tag && command_cmd) {
52 = scan_floor_items(player_ptr, fis_ptr->floor_list, player_ptr->y, player_ptr->x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, item_tester);
53 if (get_tag_floor(player_ptr->current_floor_ptr, &fis_ptr->k, *prev_tag, fis_ptr->floor_list, fis_ptr->floor_num)) {
54 *fis_ptr->cp = 0 - fis_ptr->floor_list[fis_ptr->k];
63 if (!item_tester.okay(&player_ptr->current_floor_ptr->o_list[0 - (*fis_ptr->cp)]) && ((fis_ptr->mode & USE_FULL) == 0))
71 * @brief インベントリのアイテムにタグ付けを試みる
72 * @param player_ptr プレイヤーへの参照ポインタ
73 * @param fis_ptr 床上アイテムへの参照ポインタ
74 * @param prev_tag 前回選択したアイテムのタグ (のはず)
75 * @return プレイヤーによりアイテムが選択されたならTRUEを返す
77 static bool get_floor_item_tag_inventory(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester)
80 item_use_flag use_flag = (*fis_ptr->cp >= INVEN_MAIN_HAND) ? USE_EQUIP : USE_INVEN;
82 flag |= !get_tag(player_ptr, &fis_ptr->k, *prev_tag, use_flag, item_tester);
83 flag |= !get_item_okay(player_ptr, fis_ptr->k, item_tester);
85 if (fis_ptr->k < INVEN_MAIN_HAND)
86 flag |= !fis_ptr->inven;
88 flag |= !fis_ptr->equip;
95 *fis_ptr->cp = fis_ptr->k;
101 * @brief インベントリのアイテムにタグ付けがされているかの調査処理 (のはず)
102 * @param player_ptr プレイヤーへの参照ポインタ
103 * @param fis_ptr 床上アイテムへの参照ポインタ
104 * @param prev_tag 前回選択したアイテムのタグ (のはず)
105 * @return プレイヤーによりアイテムが選択されたならTRUEを返す
107 static bool check_floor_item_tag_inventory(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester)
109 if ((!fis_ptr->inven || (*fis_ptr->cp < 0) || (*fis_ptr->cp >= INVEN_PACK))
110 && (!fis_ptr->equip || (*fis_ptr->cp < INVEN_MAIN_HAND) || (*fis_ptr->cp >= INVEN_TOTAL)))
113 if ((*prev_tag != '\0') && command_cmd)
114 return get_floor_item_tag_inventory(player_ptr, fis_ptr, prev_tag, item_tester);
116 if (get_item_okay(player_ptr, *fis_ptr->cp, item_tester)) {
125 * @brief 床上アイテムにタグ付けがされているかの調査処理 (のはず)
126 * @param player_ptr プレイヤーへの参照ポインタ
127 * @param fis_ptr 床上アイテムへの参照ポインタ
128 * @param prev_tag 前回選択したアイテムのタグ (のはず)
129 * @return プレイヤーによりアイテムが選択されたならTRUEを返す
131 static bool check_floor_item_tag(PlayerType *player_ptr, fis_type *fis_ptr, char *prev_tag, const ItemTester& item_tester)
133 if (!repeat_pull(fis_ptr->cp))
136 if (fis_ptr->force && (*fis_ptr->cp == INVEN_FORCE)) {
141 if (check_floor_item_tag_aux(player_ptr, fis_ptr, prev_tag, item_tester))
144 return check_floor_item_tag_inventory(player_ptr, fis_ptr, prev_tag, item_tester);
148 * @brief インベントリ内のアイテムが妥当かを判定する
149 * @param player_ptr プレイヤーへの参照ポインタ
150 * @param fis_ptr 床上アイテムへの参照ポインタ
152 static void test_inventory_floor(PlayerType *player_ptr, fis_type *fis_ptr, const ItemTester& item_tester)
154 if (!fis_ptr->inven) {
162 for (int i = 0; i < INVEN_PACK; i++)
163 if (item_tester.okay(&player_ptr->inventory_list[i]) || (fis_ptr->mode & USE_FULL))
164 fis_ptr->max_inven++;
168 * @brief 装備品がが妥当かを判定する
169 * @param player_ptr プレイヤーへの参照ポインタ
170 * @param fis_ptr 床上アイテムへの参照ポインタ
172 static void test_equipment_floor(PlayerType *player_ptr, fis_type *fis_ptr, const ItemTester& item_tester)
174 if (!fis_ptr->equip) {
182 for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++)
183 if (player_ptr->select_ring_slot ? is_ring_slot(i)
184 : item_tester.okay(&player_ptr->inventory_list[i]) || (fis_ptr->mode & USE_FULL))
185 fis_ptr->max_equip++;
189 * @brief オブジェクト選択の汎用関数(床上アイテム用) /
190 * Let the user select an item, save its "index"
191 * @param cp 選択したオブジェクトのIDを返す。
192 * @param pmt 選択目的のメッセージ
193 * @param str 選択できるオブジェクトがない場合のキャンセルメッセージ
194 * @param mode オプションフラグ
195 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
197 bool get_item_floor(PlayerType *player_ptr, COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, const ItemTester& item_tester)
200 fis_type *fis_ptr = initialize_fis_type(&tmp_fis, cp, mode);
201 static char prev_tag = '\0';
202 if (check_floor_item_tag(player_ptr, fis_ptr, &prev_tag, item_tester))
206 handle_stuff(player_ptr);
207 test_inventory_floor(player_ptr, fis_ptr, item_tester);
208 fis_ptr->done = false;
209 fis_ptr->item = false;
211 fis_ptr->i2 = INVEN_PACK - 1;
212 while ((fis_ptr->i1 <= fis_ptr->i2) && (!get_item_okay(player_ptr, fis_ptr->i1, item_tester)))
215 while ((fis_ptr->i1 <= fis_ptr->i2) && (!get_item_okay(player_ptr, fis_ptr->i2, item_tester)))
218 fis_ptr->e1 = INVEN_MAIN_HAND;
219 fis_ptr->e2 = INVEN_TOTAL - 1;
220 test_equipment_floor(player_ptr, fis_ptr, item_tester);
221 if (has_two_handed_weapons(player_ptr) && !(fis_ptr->mode & IGNORE_BOTHHAND_SLOT))
222 fis_ptr->max_equip++;
224 while ((fis_ptr->e1 <= fis_ptr->e2) && (!get_item_okay(player_ptr, fis_ptr->e1, item_tester)))
227 while ((fis_ptr->e1 <= fis_ptr->e2) && (!get_item_okay(player_ptr, fis_ptr->e2, item_tester)))
230 if (fis_ptr->equip && has_two_handed_weapons(player_ptr) && !(fis_ptr->mode & IGNORE_BOTHHAND_SLOT)) {
231 if (can_attack_with_main_hand(player_ptr)) {
232 if (fis_ptr->e2 < INVEN_SUB_HAND)
233 fis_ptr->e2 = INVEN_SUB_HAND;
234 } else if (can_attack_with_sub_hand(player_ptr))
235 fis_ptr->e1 = INVEN_MAIN_HAND;
238 fis_ptr->floor_num = 0;
241 = scan_floor_items(player_ptr, fis_ptr->floor_list, player_ptr->y, player_ptr->x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, item_tester);
243 if ((mode & USE_INVEN) && (fis_ptr->i1 <= fis_ptr->i2))
244 fis_ptr->allow_inven = true;
246 if ((mode & USE_EQUIP) && (fis_ptr->e1 <= fis_ptr->e2))
247 fis_ptr->allow_equip = true;
249 if ((mode & USE_FLOOR) && (fis_ptr->floor_num))
250 fis_ptr->allow_floor = true;
252 if (!fis_ptr->allow_inven && !fis_ptr->allow_equip && !fis_ptr->allow_floor) {
254 fis_ptr->oops = true;
255 fis_ptr->done = true;
257 if (fis_ptr->force) {
259 fis_ptr->item = true;
262 if (command_see && (command_wrk == USE_EQUIP) && fis_ptr->allow_equip)
263 command_wrk = USE_EQUIP;
264 else if (fis_ptr->allow_inven)
265 command_wrk = USE_INVEN;
266 else if (fis_ptr->allow_equip)
267 command_wrk = USE_EQUIP;
268 else if (fis_ptr->allow_floor)
269 command_wrk = USE_FLOOR;
272 /* 追加オプション(always_show_list)が設定されている場合は常に一覧を表示する */
273 if (always_show_list || use_menu)
279 while (!fis_ptr->done) {
282 for (int i = 0; i < 8; i++) {
283 if (!angband_term[i])
286 if (window_flag[i] & PW_INVEN)
289 if (window_flag[i] & PW_EQUIP)
293 if ((command_wrk == (USE_EQUIP) && ni && !ne) || (command_wrk == (USE_INVEN) && !ni && ne)) {
294 toggle_inventory_equipment(player_ptr);
295 fis_ptr->toggle = !fis_ptr->toggle;
298 player_ptr->window_flags |= (PW_INVEN | PW_EQUIP);
299 handle_stuff(player_ptr);
300 COMMAND_CODE get_item_label = 0;
301 if (command_wrk == USE_INVEN) {
302 fis_ptr->n1 = I2A(fis_ptr->i1);
303 fis_ptr->n2 = I2A(fis_ptr->i2);
305 get_item_label = show_inventory(player_ptr, fis_ptr->menu_line, fis_ptr->mode, item_tester);
306 } else if (command_wrk == USE_EQUIP) {
307 fis_ptr->n1 = I2A(fis_ptr->e1 - INVEN_MAIN_HAND);
308 fis_ptr->n2 = I2A(fis_ptr->e2 - INVEN_MAIN_HAND);
310 get_item_label = show_equipment(player_ptr, fis_ptr->menu_line, mode, item_tester);
311 } else if (command_wrk == USE_FLOOR) {
312 int j = fis_ptr->floor_top;
313 fis_ptr->k = std::min(fis_ptr->floor_top + 23, fis_ptr->floor_num) - 1;
314 fis_ptr->n1 = I2A(j - fis_ptr->floor_top); // TODO: 常に'0'になる。どんな意図でこのようなコードになっているのか不明.
315 fis_ptr->n2 = I2A(fis_ptr->k - fis_ptr->floor_top);
317 get_item_label = show_floor_items(player_ptr, fis_ptr->menu_line, player_ptr->y, player_ptr->x, &fis_ptr->min_width, item_tester);
320 if (command_wrk == USE_INVEN) {
321 sprintf(fis_ptr->out_val, _("持ち物:", "Inven:"));
324 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(fis_ptr->i1), index_to_label(fis_ptr->i2));
325 strcat(fis_ptr->out_val, tmp_val);
328 if (!command_see && !use_menu)
329 strcat(fis_ptr->out_val, _(" '*'一覧,", " * to see,"));
331 if (fis_ptr->allow_equip) {
333 strcat(fis_ptr->out_val, _(" '/' 装備品,", " / for Equip,"));
334 else if (fis_ptr->allow_floor)
335 strcat(fis_ptr->out_val, _(" '6' 装備品,", " 6 for Equip,"));
337 strcat(fis_ptr->out_val, _(" '4'or'6' 装備品,", " 4 or 6 for Equip,"));
340 if (fis_ptr->allow_floor) {
342 strcat(fis_ptr->out_val, _(" '-'床上,", " - for floor,"));
343 else if (fis_ptr->allow_equip)
344 strcat(fis_ptr->out_val, _(" '4' 床上,", " 4 for floor,"));
346 strcat(fis_ptr->out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
348 } else if (command_wrk == (USE_EQUIP)) {
349 sprintf(fis_ptr->out_val, _("装備品:", "Equip:"));
352 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(fis_ptr->e1), index_to_label(fis_ptr->e2));
353 strcat(fis_ptr->out_val, tmp_val);
356 if (!command_see && !use_menu)
357 strcat(fis_ptr->out_val, _(" '*'一覧,", " * to see,"));
359 if (fis_ptr->allow_inven) {
361 strcat(fis_ptr->out_val, _(" '/' 持ち物,", " / for Inven,"));
362 else if (fis_ptr->allow_floor)
363 strcat(fis_ptr->out_val, _(" '4' 持ち物,", " 4 for Inven,"));
365 strcat(fis_ptr->out_val, _(" '4'or'6' 持ち物,", " 4 or 6 for Inven,"));
368 if (fis_ptr->allow_floor) {
370 strcat(fis_ptr->out_val, _(" '-'床上,", " - for floor,"));
371 else if (fis_ptr->allow_inven)
372 strcat(fis_ptr->out_val, _(" '6' 床上,", " 6 for floor,"));
374 strcat(fis_ptr->out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
376 } else if (command_wrk == USE_FLOOR) {
377 sprintf(fis_ptr->out_val, _("床上:", "Floor:"));
380 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), fis_ptr->n1, fis_ptr->n2);
381 strcat(fis_ptr->out_val, tmp_val);
384 if (!command_see && !use_menu)
385 strcat(fis_ptr->out_val, _(" '*'一覧,", " * to see,"));
388 if (fis_ptr->allow_inven && fis_ptr->allow_equip) {
389 strcat(fis_ptr->out_val, _(" '4' 装備品, '6' 持ち物,", " 4 for Equip, 6 for Inven,"));
390 } else if (fis_ptr->allow_inven) {
391 strcat(fis_ptr->out_val, _(" '4'or'6' 持ち物,", " 4 or 6 for Inven,"));
392 } else if (fis_ptr->allow_equip) {
393 strcat(fis_ptr->out_val, _(" '4'or'6' 装備品,", " 4 or 6 for Equip,"));
395 } else if (fis_ptr->allow_inven) {
396 strcat(fis_ptr->out_val, _(" '/' 持ち物,", " / for Inven,"));
397 } else if (fis_ptr->allow_equip) {
398 strcat(fis_ptr->out_val, _(" '/'装備品,", " / for Equip,"));
401 if (command_see && !use_menu) {
402 strcat(fis_ptr->out_val, _(" Enter 次,", " Enter for scroll down,"));
407 strcat(fis_ptr->out_val, _(" 'w'練気術,", " w for the Force,"));
409 strcat(fis_ptr->out_val, " ESC");
410 sprintf(fis_ptr->tmp_val, "(%s) %s", fis_ptr->out_val, pmt);
411 prt(fis_ptr->tmp_val, 0, 0);
412 fis_ptr->which = inkey();
415 if (command_wrk == USE_INVEN)
416 max_line = fis_ptr->max_inven;
417 else if (command_wrk == USE_EQUIP)
418 max_line = fis_ptr->max_equip;
419 else if (command_wrk == USE_FLOOR)
420 max_line = std::min(23, fis_ptr->floor_num);
421 switch (fis_ptr->which) {
426 fis_ptr->done = true;
432 fis_ptr->menu_line += (max_line - 1);
438 fis_ptr->menu_line++;
444 if (command_wrk == (USE_INVEN)) {
445 if (fis_ptr->allow_floor)
446 command_wrk = USE_FLOOR;
447 else if (fis_ptr->allow_equip)
448 command_wrk = USE_EQUIP;
453 } else if (command_wrk == (USE_EQUIP)) {
454 if (fis_ptr->allow_inven)
455 command_wrk = USE_INVEN;
456 else if (fis_ptr->allow_floor)
457 command_wrk = USE_FLOOR;
462 } else if (command_wrk == (USE_FLOOR)) {
463 if (fis_ptr->allow_equip)
464 command_wrk = USE_EQUIP;
465 else if (fis_ptr->allow_inven)
466 command_wrk = USE_INVEN;
481 if (command_wrk == USE_INVEN)
482 max_line = fis_ptr->max_inven;
483 else if (command_wrk == USE_EQUIP)
484 max_line = fis_ptr->max_equip;
485 else if (command_wrk == USE_FLOOR)
486 max_line = std::min(23, fis_ptr->floor_num);
488 if (fis_ptr->menu_line > max_line)
489 fis_ptr->menu_line = max_line;
496 if (command_wrk == (USE_INVEN)) {
497 if (fis_ptr->allow_equip)
498 command_wrk = USE_EQUIP;
499 else if (fis_ptr->allow_floor)
500 command_wrk = USE_FLOOR;
505 } else if (command_wrk == (USE_EQUIP)) {
506 if (fis_ptr->allow_floor)
507 command_wrk = USE_FLOOR;
508 else if (fis_ptr->allow_inven)
509 command_wrk = USE_INVEN;
514 } else if (command_wrk == (USE_FLOOR)) {
515 if (fis_ptr->allow_inven)
516 command_wrk = USE_INVEN;
517 else if (fis_ptr->allow_equip)
518 command_wrk = USE_EQUIP;
533 if (command_wrk == USE_INVEN)
534 max_line = fis_ptr->max_inven;
535 else if (command_wrk == USE_EQUIP)
536 max_line = fis_ptr->max_equip;
537 else if (command_wrk == USE_FLOOR)
538 max_line = std::min(23, fis_ptr->floor_num);
540 if (fis_ptr->menu_line > max_line)
541 fis_ptr->menu_line = max_line;
549 if (command_wrk == USE_FLOOR)
550 *cp = -get_item_label;
552 if (!get_item_okay(player_ptr, get_item_label, item_tester)) {
557 if (!get_item_allow(player_ptr, get_item_label)) {
558 fis_ptr->done = true;
562 *cp = get_item_label;
565 fis_ptr->item = true;
566 fis_ptr->done = true;
570 if (fis_ptr->force) {
572 fis_ptr->item = true;
573 fis_ptr->done = true;
579 if (fis_ptr->menu_line > max_line)
580 fis_ptr->menu_line -= max_line;
585 switch (fis_ptr->which) {
587 fis_ptr->done = true;
606 grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x];
607 if (command_wrk != (USE_FLOOR))
610 if (g_ptr->o_idx_list.size() < 2)
613 const auto next_o_idx = fis_ptr->floor_list[1];
614 while (g_ptr->o_idx_list.front() != next_o_idx)
615 g_ptr->o_idx_list.rotate(player_ptr->current_floor_ptr);
617 player_ptr->window_flags |= PW_FLOOR_ITEM_LIST;
618 window_stuff(player_ptr);
621 = scan_floor_items(player_ptr, fis_ptr->floor_list, player_ptr->y, player_ptr->x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, item_tester);
630 if (command_wrk == (USE_INVEN)) {
631 if (!fis_ptr->allow_equip) {
635 command_wrk = (USE_EQUIP);
636 } else if (command_wrk == (USE_EQUIP)) {
637 if (!fis_ptr->allow_inven) {
641 command_wrk = (USE_INVEN);
642 } else if (command_wrk == (USE_FLOOR)) {
643 if (fis_ptr->allow_inven) {
644 command_wrk = (USE_INVEN);
645 } else if (fis_ptr->allow_equip) {
646 command_wrk = (USE_EQUIP);
661 if (!fis_ptr->allow_floor) {
666 if (fis_ptr->floor_num == 1) {
667 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag)) {
668 fis_ptr->k = 0 - fis_ptr->floor_list[0];
669 if (!get_item_allow(player_ptr, fis_ptr->k)) {
670 fis_ptr->done = true;
675 fis_ptr->item = true;
676 fis_ptr->done = true;
686 command_wrk = (USE_FLOOR);
699 if (command_wrk != USE_FLOOR) {
700 if (!get_tag(player_ptr, &fis_ptr->k, fis_ptr->which, command_wrk, item_tester)) {
705 if ((fis_ptr->k < INVEN_MAIN_HAND) ? !fis_ptr->inven : !fis_ptr->equip) {
710 if (!get_item_okay(player_ptr, fis_ptr->k, item_tester)) {
715 if (get_tag_floor(player_ptr->current_floor_ptr, &fis_ptr->k, fis_ptr->which, fis_ptr->floor_list, fis_ptr->floor_num)) {
716 fis_ptr->k = 0 - fis_ptr->floor_list[fis_ptr->k];
723 if (!get_item_allow(player_ptr, fis_ptr->k)) {
724 fis_ptr->done = true;
729 fis_ptr->item = true;
730 fis_ptr->done = true;
731 fis_ptr->cur_tag = fis_ptr->which;
735 if (fis_ptr->force) {
737 fis_ptr->item = true;
738 fis_ptr->done = true;
744 bool tag_not_found = false;
746 if (command_wrk != USE_FLOOR) {
747 if (!get_tag(player_ptr, &fis_ptr->k, fis_ptr->which, command_wrk, item_tester))
748 tag_not_found = true;
749 else if ((fis_ptr->k < INVEN_MAIN_HAND) ? !fis_ptr->inven : !fis_ptr->equip)
750 tag_not_found = true;
753 fis_ptr->cur_tag = fis_ptr->which;
755 if (get_tag_floor(player_ptr->current_floor_ptr, &fis_ptr->k, fis_ptr->which, fis_ptr->floor_list, fis_ptr->floor_num)) {
756 fis_ptr->k = 0 - fis_ptr->floor_list[fis_ptr->k];
757 fis_ptr->cur_tag = fis_ptr->which;
759 tag_not_found = true;
763 auto which = (char)tolower(fis_ptr->which);
765 if (command_wrk == (USE_INVEN)) {
767 fis_ptr->k = fis_ptr->i1;
768 else if (which == ')')
769 fis_ptr->k = fis_ptr->i2;
771 fis_ptr->k = label_to_inventory(player_ptr, which);
772 } else if (command_wrk == (USE_EQUIP)) {
774 fis_ptr->k = fis_ptr->e1;
775 else if (which == ')')
776 fis_ptr->k = fis_ptr->e2;
778 fis_ptr->k = label_to_equipment(player_ptr, which);
779 } else if (command_wrk == USE_FLOOR) {
782 else if (which == ')')
783 fis_ptr->k = fis_ptr->floor_num - 1;
785 fis_ptr->k = islower(which) ? A2I(which) : -1;
786 if (fis_ptr->k < 0 || fis_ptr->k >= fis_ptr->floor_num || fis_ptr->k >= 23) {
791 fis_ptr->k = 0 - fis_ptr->floor_list[fis_ptr->k];
795 if ((command_wrk != USE_FLOOR) && !get_item_okay(player_ptr, fis_ptr->k, item_tester)) {
800 auto ver = tag_not_found && isupper(fis_ptr->which);
801 if (ver && !verify(player_ptr, _("本当に", "Try"), fis_ptr->k)) {
802 fis_ptr->done = true;
806 if (!get_item_allow(player_ptr, fis_ptr->k)) {
807 fis_ptr->done = true;
812 fis_ptr->item = true;
813 fis_ptr->done = true;
825 toggle_inventory_equipment(player_ptr);
827 player_ptr->window_flags |= (PW_INVEN | PW_EQUIP);
828 handle_stuff(player_ptr);
830 if (fis_ptr->oops && str)
836 prev_tag = fis_ptr->cur_tag;
840 return fis_ptr->item;