4 #include "player-inventory.h"
8 #include "objectkind.h"
9 #include "object-flavor.h"
10 #include "object-hook.h"
12 #include "player-move.h"
14 #include "view-mainwindow.h"
16 bool select_ring_slot;
19 * @brief プレイヤーの所持/装備オブジェクトIDが指輪枠かを返す /
20 * @param i プレイヤーの所持/装備オブジェクトID
21 * @return 指輪枠ならばTRUEを返す。
23 bool is_ring_slot(int i)
25 return (i == INVEN_RIGHT) || (i == INVEN_LEFT);
30 * @brief 選択アルファベットラベルからプレイヤーの装備オブジェクトIDを返す /
31 * @param player_ptr プレーヤーへの参照ポインタ
32 * Convert a label into the index of a item in the "equip"
33 * @return 対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item
35 static INVENTORY_IDX label_to_equip(int c)
40 i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1) + INVEN_RARM;
42 /* Verify the index */
43 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
45 if (select_ring_slot) return is_ring_slot(i) ? i : -1;
47 /* Empty slots can never be chosen */
48 if (!p_ptr->inventory_list[i].k_idx) return (-1);
50 /* Return the index */
55 * @brief 選択アルファベットラベルからプレイヤーの所持オブジェクトIDを返す /
56 * Convert a label into the index of an item in the "inven"
57 * @return 対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item
58 * @details Note that the label does NOT distinguish inven/equip.
60 static INVENTORY_IDX label_to_inven(int c)
65 i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1);
67 /* Verify the index */
68 if ((i < 0) || (i > INVEN_PACK)) return (-1);
70 /* Empty slots can never be chosen */
71 if (!p_ptr->inventory_list[i].k_idx) return (-1);
73 /* Return the index */
79 * @brief 所持/装備オブジェクトIDの部位表現を返す /
80 * Return a string mentioning how a given item is carried
81 * @param i 部位表現を求めるプレイヤーの所持/装備オブジェクトID
82 * @return 部位表現の文字列ポインタ
84 static concptr mention_use(player_type *creature_ptr, int i)
88 /* Examine the location */
92 case INVEN_RARM: p = creature_ptr->heavy_wield[0] ? "運搬中" : ((creature_ptr->ryoute && creature_ptr->migite) ? " 両手" : (left_hander ? " 左手" : " 右手")); break;
94 case INVEN_RARM: p = creature_ptr->heavy_wield[0] ? "Just lifting" : (creature_ptr->migite ? "Wielding" : "On arm"); break;
98 case INVEN_LARM: p = creature_ptr->heavy_wield[1] ? "運搬中" : ((creature_ptr->ryoute && creature_ptr->hidarite) ? " 両手" : (left_hander ? " 右手" : " 左手")); break;
100 case INVEN_LARM: p = creature_ptr->heavy_wield[1] ? "Just lifting" : (creature_ptr->hidarite ? "Wielding" : "On arm"); break;
103 case INVEN_BOW: p = (adj_str_hold[creature_ptr->stat_ind[A_STR]] < creature_ptr->inventory_list[i].weight / 10) ? _("運搬中", "Just holding") : _("射撃用", "Shooting"); break;
104 case INVEN_RIGHT: p = (left_hander ? _("左手指", "On left hand") : _("右手指", "On right hand")); break;
105 case INVEN_LEFT: p = (left_hander ? _("右手指", "On right hand") : _("左手指", "On left hand")); break;
106 case INVEN_NECK: p = _(" 首", "Around neck"); break;
107 case INVEN_LITE: p = _(" 光源", "Light source"); break;
108 case INVEN_BODY: p = _(" 体", "On body"); break;
109 case INVEN_OUTER: p = _("体の上", "About body"); break;
110 case INVEN_HEAD: p = _(" 頭", "On head"); break;
111 case INVEN_HANDS: p = _(" 手", "On hands"); break;
112 case INVEN_FEET: p = _(" 足", "On feet"); break;
113 default: p = _("ザック", "In pack"); break;
116 /* Return the result */
121 * @brief 装備アイテム一覧を表示する /
122 * Choice window "shadow" of the "show_equip()" function
125 void display_equip(player_type *creature_ptr, OBJECT_TYPE_VALUE tval)
129 TERM_COLOR attr = TERM_WHITE;
131 GAME_TEXT o_name[MAX_NLEN];
134 if (!creature_ptr || !creature_ptr->inventory_list) return;
136 Term_get_size(&wid, &hgt);
138 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
140 o_ptr = &creature_ptr->inventory_list[i];
141 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
142 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, tval))
144 tmp_val[0] = index_to_label(i);
148 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
149 if ((((i == INVEN_RARM) && creature_ptr->hidarite) || ((i == INVEN_LARM) && creature_ptr->migite)) && creature_ptr->ryoute)
151 strcpy(o_name, _("(武器を両手持ち)", "(wielding with two-hands)"));
156 object_desc(o_name, o_ptr, 0);
157 attr = tval_to_attr[o_ptr->tval % 128];
165 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
167 Term_erase(3 + n, i - INVEN_RARM, 255);
171 int wgt = o_ptr->weight * o_ptr->number;
173 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
175 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
178 prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
183 Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
184 prt(mention_use(creature_ptr, i), i - INVEN_RARM, wid - 15);
188 for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
190 Term_erase(0, i, 255);
195 * @brief サブウィンドウに所持品、装備品リストの表示を行う /
196 * Flip "inven" and "equip" in any sub-windows
199 void toggle_inven_equip(player_type *creature_ptr)
204 for (j = 0; j < 8; j++)
207 if (!angband_term[j]) continue;
209 /* Flip inven to equip */
210 if (window_flag[j] & (PW_INVEN))
213 window_flag[j] &= ~(PW_INVEN);
214 window_flag[j] |= (PW_EQUIP);
216 creature_ptr->window |= (PW_EQUIP);
219 /* Flip inven to equip */
220 else if (window_flag[j] & (PW_EQUIP))
223 window_flag[j] &= ~(PW_EQUIP);
224 window_flag[j] |= (PW_INVEN);
226 creature_ptr->window |= (PW_INVEN);
233 * @brief プレイヤーの所持/装備オブジェクトが正規のものかを返す /
234 * Auxiliary function for "get_item()" -- test an index
236 * @return 正規のIDならばTRUEを返す。
238 bool get_item_okay(OBJECT_IDX i)
241 if ((i < 0) || (i >= INVEN_TOTAL)) return FALSE;
243 if (select_ring_slot) return is_ring_slot(i);
245 /* Verify the item */
246 if (!item_tester_okay(&p_ptr->inventory_list[i], item_tester_tval)) return FALSE;
253 * @brief 規定の処理にできるアイテムがプレイヤーの利用可能範囲内にあるかどうかを返す /
254 * Determine whether get_item() can get some item or not
255 * @return アイテムを拾えるならばTRUEを返す。
256 * @details assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
258 bool can_get_item(OBJECT_TYPE_VALUE tval)
261 OBJECT_IDX floor_list[23];
262 ITEM_NUMBER floor_num = 0;
264 for (j = 0; j < INVEN_TOTAL; j++)
265 if (item_tester_okay(&p_ptr->inventory_list[j], tval))
268 floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
277 * @brief 床オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す /
278 * Find the "first" inventory object with the given "tag".
279 * @param cp 対応するタグIDを与える参照ポインタ
280 * @param tag 該当するオブジェクトがあるかを調べたいタグ
281 * @param floor_list 床上アイテムの配列
282 * @param floor_num 床上アイテムの配列ID
283 * @return タグに該当するオブジェクトがあるならTRUEを返す
285 * A "tag" is a numeral "n" appearing as "@n" anywhere in the\n
286 * inscription of an object. Alphabetical characters don't work as a\n
287 * tag in this form.\n
289 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
290 * and "x" is the "current" command_cmd code.\n
292 static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
297 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
299 /* Check every object in the grid */
300 for (i = 0; i < floor_num && i < 23; i++)
302 object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
304 /* Skip empty inscriptions */
305 if (!o_ptr->inscription) continue;
308 s = my_strchr(quark_str(o_ptr->inscription), '@');
310 /* Process all tags */
313 /* Check the special tags */
314 if ((s[1] == command_cmd) && (s[2] == tag))
316 /* Save the actual floor object ID */
323 /* Find another '@' */
324 s = my_strchr(s + 1, '@');
329 /**** Find a tag in the form of {@#} (allows only numerals) ***/
331 /* Don't allow {@#} with '#' being alphabet */
332 if (tag < '0' || '9' < tag)
338 /* Check every object in the grid */
339 for (i = 0; i < floor_num && i < 23; i++)
341 object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
343 /* Skip empty inscriptions */
344 if (!o_ptr->inscription) continue;
347 s = my_strchr(quark_str(o_ptr->inscription), '@');
349 /* Process all tags */
352 /* Check the normal tags */
355 /* Save the floor object ID */
362 /* Find another '@' */
363 s = my_strchr(s + 1, '@');
373 * @brief 所持/装備オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す /
374 * Find the "first" inventory object with the given "tag".
375 * @param cp 対応するタグIDを与える参照ポインタ
376 * @param tag 該当するオブジェクトがあるかを調べたいタグ
377 * @param mode 所持、装備の切り替え
378 * @return タグに該当するオブジェクトがあるならTRUEを返す
380 * A "tag" is a numeral "n" appearing as "@n" anywhere in the\n
381 * inscription of an object. Alphabetical characters don't work as a\n
382 * tag in this form.\n
384 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
385 * and "x" is the "current" command_cmd code.\n
387 static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
390 COMMAND_CODE start, end;
393 /* Extract index from mode */
398 end = INVEN_TOTAL - 1;
403 end = INVEN_PACK - 1;
410 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
412 for (i = start; i <= end; i++)
414 object_type *o_ptr = &p_ptr->inventory_list[i];
415 if (!o_ptr->k_idx) continue;
417 /* Skip empty inscriptions */
418 if (!o_ptr->inscription) continue;
420 /* Skip non-choice */
421 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
424 s = my_strchr(quark_str(o_ptr->inscription), '@');
426 /* Process all tags */
429 /* Check the special tags */
430 if ((s[1] == command_cmd) && (s[2] == tag))
438 /* Find another '@' */
439 s = my_strchr(s + 1, '@');
444 /**** Find a tag in the form of {@#} (allows only numerals) ***/
446 /* Don't allow {@#} with '#' being alphabet */
447 if (tag < '0' || '9' < tag)
453 /* Check every object */
454 for (i = start; i <= end; i++)
456 object_type *o_ptr = &p_ptr->inventory_list[i];
457 if (!o_ptr->k_idx) continue;
459 /* Skip empty inscriptions */
460 if (!o_ptr->inscription) continue;
462 /* Skip non-choice */
463 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
466 s = my_strchr(quark_str(o_ptr->inscription), '@');
468 /* Process all tags */
471 /* Check the normal tags */
480 /* Find another '@' */
481 s = my_strchr(s + 1, '@');
490 * @brief タグIDにあわせてタグアルファベットのリストを返す /
491 * Move around label characters with correspond tags
492 * @param label ラベルリストを取得する文字列参照ポインタ
493 * @param mode 所持品リストか装備品リストかの切り替え
496 void prepare_label_string(char *label, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
498 concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
499 int offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
502 /* Prepare normal labels */
503 strcpy(label, alphabet_chars);
505 /* Move each label */
506 for (i = 0; i < 52; i++)
509 SYMBOL_CODE c = alphabet_chars[i];
511 /* Find a tag with this label */
512 if (get_tag(&index, c, mode, tval))
514 /* Delete the overwritten label */
515 if (label[i] == c) label[i] = ' ';
517 /* Move the label to the place of corresponding tag */
518 label[index - offset] = c;
525 * @brief タグIDにあわせてタグアルファベットのリストを返す(床上アイテム用) /
526 * Move around label characters with correspond tags (floor version)
527 * @param label ラベルリストを取得する文字列参照ポインタ
528 * @param floor_list 床上アイテムの配列
529 * @param floor_num 床上アイテムの配列ID
534 static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
536 concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
539 /* Prepare normal labels */
540 strcpy(label, alphabet_chars);
542 /* Move each label */
543 for (i = 0; i < 52; i++)
546 SYMBOL_CODE c = alphabet_chars[i];
548 /* Find a tag with this label */
549 if (get_tag_floor(&index, c, floor_list, floor_num))
551 /* Delete the overwritten label */
552 if (label[i] == c) label[i] = ' ';
554 /* Move the label to the place of corresponding tag */
561 * @brief 所持アイテムの表示を行う /
562 * Display the inventory.
563 * @param target_item アイテムの選択処理を行うか否か。
564 * @return 選択したアイテムのタグ
566 * Hack -- do not display "trailing" empty slots
568 COMMAND_CODE show_inven(player_type *owner_ptr, int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
572 int col, cur_col, len;
574 GAME_TEXT o_name[MAX_NLEN];
576 COMMAND_CODE out_index[23];
577 TERM_COLOR out_color[23];
578 char out_desc[23][MAX_NLEN];
579 COMMAND_CODE target_item_label = 0;
581 char inven_label[52 + 1];
583 /* Starting column */
586 Term_get_size(&wid, &hgt);
588 /* Default "max-length" */
592 /* Find the "final" slot */
593 for (i = 0; i < INVEN_PACK; i++)
595 o_ptr = &owner_ptr->inventory_list[i];
596 if (!o_ptr->k_idx) continue;
602 prepare_label_string(inven_label, USE_INVEN, tval);
604 for (k = 0, i = 0; i < z; i++)
606 o_ptr = &owner_ptr->inventory_list[i];
608 /* Is this item acceptable? */
609 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
611 object_desc(o_name, o_ptr, 0);
613 /* Save the object index, color, and description */
615 out_color[k] = tval_to_attr[o_ptr->tval % 128];
617 /* Grey out charging items */
620 out_color[k] = TERM_L_DARK;
623 (void)strcpy(out_desc[k], o_name);
625 /* Find the predicted "line length" */
626 l = strlen(out_desc[k]) + 5;
628 /* Be sure to account for the weight */
629 if (show_weights) l += 9;
631 /* Account for icon if displayed */
635 if (use_bigtile) l++;
638 /* Maintain the maximum length */
639 if (l > len) len = l;
641 /* Advance to next "line" */
645 /* Find the column to start in */
646 col = (len > wid - 4) ? 0 : (wid - len - 1);
648 /* Output each entry */
649 for (j = 0; j < k; j++)
652 o_ptr = &owner_ptr->inventory_list[i];
655 prt("", j + 1, col ? col - 2 : col);
657 if (use_menu && target_item)
659 if (j == (target_item - 1))
661 strcpy(tmp_val, _("》", "> "));
662 target_item_label = i;
664 else strcpy(tmp_val, " ");
666 else if (i <= INVEN_PACK)
668 /* Prepare an index --(-- */
669 sprintf(tmp_val, "%c)", inven_label[i]);
673 /* Prepare an index --(-- */
674 sprintf(tmp_val, "%c)", index_to_label(i));
677 /* Clear the line with the (possibly indented) index */
678 put_str(tmp_val, j + 1, col);
682 /* Display graphics for object, if desired */
685 TERM_COLOR a = object_attr(o_ptr);
686 SYMBOL_CODE c = object_char(o_ptr);
687 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
688 if (use_bigtile) cur_col++;
694 /* Display the entry itself */
695 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
697 /* Display the weight if needed */
700 int wgt = o_ptr->weight * o_ptr->number;
702 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
704 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
707 prt(tmp_val, j + 1, wid - 9);
711 /* Make a "shadow" below the list (only if needed) */
712 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
714 /* Save the new column */
717 return target_item_label;
722 * @brief 選択したアイテムの確認処理の補助 /
723 * Verify the choice of an item.
724 * @param prompt メッセージ表示の一部
725 * @param item 選択アイテムID
726 * @return 確認がYesならTRUEを返す。
727 * @details The item can be negative to mean "item on floor".
729 static bool verify(concptr prompt, INVENTORY_IDX item)
731 GAME_TEXT o_name[MAX_NLEN];
732 char out_val[MAX_NLEN + 20];
739 o_ptr = &p_ptr->inventory_list[item];
745 o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item];
747 object_desc(o_name, o_ptr, 0);
750 (void)sprintf(out_val, _("%s%sですか? ", "%s %s? "), prompt, o_name);
753 return (get_check(out_val));
758 * @brief 選択したアイテムの確認処理のメインルーチン /
759 * @param item 選択アイテムID
760 * @return 確認がYesならTRUEを返す。
761 * @details The item can be negative to mean "item on floor".
762 * Hack -- allow user to "prevent" certain choices
764 static bool get_item_allow(INVENTORY_IDX item)
768 if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
773 o_ptr = &p_ptr->inventory_list[item];
779 o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item];
783 if (!o_ptr->inscription) return TRUE;
786 s = my_strchr(quark_str(o_ptr->inscription), '!');
788 /* Process preventions */
791 /* Check the "restriction" */
792 if ((s[1] == command_cmd) || (s[1] == '*'))
794 /* Verify the choice */
795 if (!verify(_("本当に", "Really try"), item)) return FALSE;
798 /* Find another '!' */
799 s = my_strchr(s + 1, '!');
808 * @brief オブジェクト選択の汎用関数 /
809 * Let the user select an item, save its "index"
810 * @param cp 選択したオブジェクトのIDを返す。
811 * @param pmt 選択目的のメッセージ
812 * @param str 選択できるオブジェクトがない場合のキャンセルメッセージ
813 * @param mode オプションフラグ
814 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
815 * Return TRUE only if an acceptable item was chosen by the user.\n
817 * The selected item must satisfy the "item_tester_hook()" function,\n
818 * if that hook is set, and the "item_tester_tval", if that value is set.\n
820 * All "item_tester" restrictions are cleared before this function returns.\n
822 * The user is allowed to choose acceptable items from the equipment,\n
823 * inventory, or floor, respectively, if the proper flag was given,\n
824 * and there are any acceptable items in that location.\n
826 * The equipment or inventory are displayed (even if no acceptable\n
827 * items are in that location) if the proper flag was given.\n
829 * If there are no acceptable items available anywhere, and "str" is\n
830 * not NULL, then it will be used as the text of a warning message\n
831 * before the function returns.\n
833 * Note that the user must press "-" to specify the item on the floor,\n
834 * and there is no way to "examine" the item on the floor, while the\n
835 * use of "capital" letters will "examine" an inventory/equipment item,\n
836 * and prompt for its use.\n
838 * If a legal item is selected from the inventory, we save it in "cp"\n
839 * directly (0 to 35), and return TRUE.\n
841 * If a legal item is selected from the floor, we save it in "cp" as\n
842 * a negative (-1 to -511), and return TRUE.\n
844 * If no item is available, we do nothing to "cp", and we display a\n
845 * warning message, using "str" if available, and return FALSE.\n
847 * If no item is selected, we do nothing to "cp", and return FALSE.\n
849 * Global "command_new" is used when viewing the inventory or equipment\n
850 * to allow the user to enter a command while viewing those screens, and\n
851 * also to induce "auto-enter" of stores, and other such stuff.\n
853 * Global "command_see" may be set before calling this function to start\n
854 * out in "browse" mode. It is cleared before this function returns.\n
856 * Global "command_wrk" is used to choose between equip/inven listings.\n
857 * If it is TRUE then we are viewing inventory, else equipment.\n
859 * We always erase the prompt when we are done, leaving a blank line,\n
860 * or a warning message, if appropriate, if no items are available.\n
862 bool get_item(player_type *owner_ptr, OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
864 OBJECT_IDX this_o_idx, next_o_idx = 0;
881 bool allow_floor = FALSE;
888 int menu_line = (use_menu ? 1 : 0);
892 static char prev_tag = '\0';
895 if (easy_floor || use_menu) return get_item_floor(owner_ptr, cp, pmt, str, mode, tval);
898 if (mode & USE_EQUIP) equip = TRUE;
899 if (mode & USE_INVEN) inven = TRUE;
900 if (mode & USE_FLOOR) floor = TRUE;
902 /* Get the item index */
906 if (mode & USE_FORCE && (*cp == INVEN_FORCE))
909 item_tester_hook = NULL;
910 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
915 else if (floor && (*cp < 0))
921 o_ptr = &owner_ptr->current_floor_ptr->o_list[k];
923 /* Validate the item */
924 if (item_tester_okay(o_ptr, tval) || (mode & USE_FULL))
926 /* Forget restrictions */
928 item_tester_hook = NULL;
929 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
936 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
937 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
939 if (prev_tag && command_cmd)
941 /* Look up the tag and validate the item */
942 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, tval)) /* Reject */;
943 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
944 else if (!get_item_okay(k)) /* Reject */;
947 /* Accept that choice */
950 /* Forget restrictions */
952 item_tester_hook = NULL;
953 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
959 prev_tag = '\0'; /* prev_tag is no longer effective */
962 /* Verify the item */
963 else if (get_item_okay(*cp))
965 /* Forget restrictions */
967 item_tester_hook = NULL;
968 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
980 /* No item selected */
989 for (j = 0; j < INVEN_PACK; j++)
990 if (item_tester_okay(&owner_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_inven++;
993 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
994 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
999 e2 = INVEN_TOTAL - 1;
1001 /* Forbid equipment */
1002 if (!equip) e2 = -1;
1005 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
1006 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&owner_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_equip++;
1007 if (owner_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
1010 /* Restrict equipment indexes */
1011 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
1012 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
1014 if (equip && owner_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT))
1016 if (owner_ptr->migite)
1018 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
1020 else if (owner_ptr->hidarite) e1 = INVEN_RARM;
1024 /* Restrict floor usage */
1027 /* Scan all objects in the grid */
1028 for (this_o_idx = owner_ptr->current_floor_ptr->grid_array[owner_ptr->y][owner_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
1031 o_ptr = &owner_ptr->current_floor_ptr->o_list[this_o_idx];
1032 next_o_idx = o_ptr->next_o_idx;
1034 /* Accept the item on the floor if legal */
1035 if ((item_tester_okay(o_ptr, tval) || (mode & USE_FULL)) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
1039 /* Require at least one legal choice */
1040 if (!allow_floor && (i1 > i2) && (e1 > e2))
1042 command_see = FALSE;
1046 if (mode & USE_FORCE) {
1052 /* Analyze choices */
1055 if (command_see && command_wrk && equip)
1062 command_wrk = FALSE;
1072 command_wrk = FALSE;
1078 * 追加オプション(always_show_list)が設定されている場合は常に一覧を表示する
1080 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
1082 /* Hack -- start out in "display" mode */
1089 /* Repeat until done */
1092 COMMAND_CODE get_item_label = 0;
1099 for (j = 0; j < 8; j++)
1102 if (!angband_term[j]) continue;
1104 /* Count windows displaying inven */
1105 if (window_flag[j] & (PW_INVEN)) ni++;
1107 /* Count windows displaying equip */
1108 if (window_flag[j] & (PW_EQUIP)) ne++;
1111 if ((command_wrk && ni && !ne) || (!command_wrk && !ni && ne))
1113 toggle_inven_equip(owner_ptr);
1117 owner_ptr->window |= (PW_INVEN | PW_EQUIP);
1118 handle_stuff(owner_ptr);
1120 /* Inventory screen */
1123 /* Redraw if needed */
1124 if (command_see) get_item_label = show_inven(owner_ptr, menu_line, mode, tval);
1127 /* Equipment screen */
1130 /* Redraw if needed */
1131 if (command_see) get_item_label = show_equip(owner_ptr, menu_line, mode, tval);
1136 /* Begin the prompt */
1137 sprintf(out_val, _("持ち物:", "Inven:"));
1139 /* Some legal items */
1140 if ((i1 <= i2) && !use_menu)
1142 /* Build the prompt */
1143 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
1144 index_to_label(i1), index_to_label(i2));
1147 strcat(out_val, tmp_val);
1150 /* Indicate ability to "view" */
1151 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
1154 if (equip) strcat(out_val, format(_(" %s 装備品,", " %s for Equip,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "/")));
1157 /* Viewing equipment */
1160 /* Begin the prompt */
1161 sprintf(out_val, _("装備品:", "Equip:"));
1163 /* Some legal items */
1164 if ((e1 <= e2) && !use_menu)
1166 /* Build the prompt */
1167 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
1168 index_to_label(e1), index_to_label(e2));
1171 strcat(out_val, tmp_val);
1174 /* Indicate ability to "view" */
1175 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
1178 if (inven) strcat(out_val, format(_(" %s 持ち物,", " %s for Inven,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "'/'")));
1181 /* Indicate legality of the "floor" item */
1182 if (allow_floor) strcat(out_val, _(" '-'床上,", " - for floor,"));
1183 if (mode & USE_FORCE) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
1185 /* Finish the prompt */
1186 strcat(out_val, " ESC");
1188 /* Build the prompt */
1189 sprintf(tmp_val, "(%s) %s", out_val, pmt);
1191 /* Show the prompt */
1199 int max_line = (command_wrk ? max_equip : max_inven);
1215 menu_line += (max_line - 1);
1234 /* Verify legality */
1235 if (!inven || !equip)
1241 /* Hack -- Fix screen */
1248 /* Switch inven/equip */
1249 command_wrk = !command_wrk;
1250 max_line = (command_wrk ? max_equip : max_inven);
1251 if (menu_line > max_line) menu_line = max_line;
1253 /* Need to redraw */
1262 if (command_wrk == USE_FLOOR)
1265 (*cp) = -get_item_label;
1269 /* Validate the item */
1270 if (!get_item_okay(get_item_label))
1276 /* Allow player to "refuse" certain actions */
1277 if (!get_item_allow(get_item_label))
1283 /* Accept that choice */
1284 (*cp) = get_item_label;
1293 if (mode & USE_FORCE) {
1301 if (menu_line > max_line) menu_line -= max_line;
1322 command_see = FALSE;
1339 /* Verify legality */
1340 if (!inven || !equip)
1346 /* Hack -- Fix screen */
1353 /* Switch inven/equip */
1354 command_wrk = !command_wrk;
1356 /* Need to redraw */
1362 /* Use floor item */
1365 /* Scan all objects in the grid */
1366 for (this_o_idx = owner_ptr->current_floor_ptr->grid_array[owner_ptr->y][owner_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
1369 o_ptr = &owner_ptr->current_floor_ptr->o_list[this_o_idx];
1370 next_o_idx = o_ptr->next_o_idx;
1372 /* Validate the item */
1373 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
1378 /* Verify the item (if required) */
1379 if (other_query_flag && !verify(_("本当に", "Try"), k)) continue;
1381 /* Allow player to "refuse" certain actions */
1382 if (!get_item_allow(k)) continue;
1384 /* Accept that choice */
1400 case '1': case '2': case '3':
1401 case '4': case '5': case '6':
1402 case '7': case '8': case '9':
1404 /* Look up the tag */
1405 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, tval))
1411 /* Hack -- Validate the item */
1412 if ((k < INVEN_RARM) ? !inven : !equip)
1418 /* Validate the item */
1419 if (!get_item_okay(k))
1425 /* Allow player to "refuse" certain actions */
1426 if (!get_item_allow(k))
1432 /* Accept that choice */
1446 k = ((i1 == i2) ? i1 : -1);
1449 /* Choose "default" equipment item */
1452 k = ((e1 == e2) ? e1 : -1);
1455 /* Validate the item */
1456 if (!get_item_okay(k))
1462 /* Allow player to "refuse" certain actions */
1463 if (!get_item_allow(k))
1469 /* Accept that choice */
1479 if (mode & USE_FORCE) {
1492 bool not_found = FALSE;
1494 /* Look up the alphabetical tag */
1495 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, tval))
1500 /* Hack -- Validate the item */
1501 else if ((k < INVEN_RARM) ? !inven : !equip)
1506 /* Validate the item */
1507 else if (!get_item_okay(k))
1514 /* Accept that choice */
1522 /* Extract "query" setting */
1523 ver = isupper(which);
1524 which = (char)tolower(which);
1528 if (which == '(') k = i1;
1529 else if (which == ')') k = i2;
1530 else k = label_to_inven(which);
1533 /* Convert letter to equipment index */
1536 if (which == '(') k = e1;
1537 else if (which == ')') k = e2;
1538 else k = label_to_equip(which);
1541 /* Validate the item */
1542 if (!get_item_okay(k))
1548 /* Verify the item */
1549 if (ver && !verify(_("本当に", "Try"), k))
1555 /* Allow player to "refuse" certain actions */
1556 if (!get_item_allow(k))
1562 /* Accept that choice */
1573 /* Fix the screen if necessary */
1578 /* Hack -- Cancel "display" */
1579 command_see = FALSE;
1583 /* Forget the tval restriction */
1586 /* Forget the item_tester_hook restriction */
1587 item_tester_hook = NULL;
1590 /* Clean up 'show choices' */
1591 if (toggle) toggle_inven_equip(owner_ptr);
1593 owner_ptr->window |= (PW_INVEN | PW_EQUIP);
1594 handle_stuff(owner_ptr);
1596 /* Clear the prompt line */
1599 /* Warning if needed */
1600 if (oops && str) msg_print(str);
1605 if (command_cmd) prev_tag = cur_tag;
1606 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1612 * Choose an item and get auto-picker entry from it.
1614 object_type *choose_object(player_type *creature_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval)
1617 if (!get_item(creature_ptr, &item, q, s, option, tval)) return NULL;
1618 if (idx) *idx = item;
1619 if (item == INVEN_FORCE) return NULL;
1620 return REF_ITEM(creature_ptr, creature_ptr->current_floor_ptr, item);
1625 * @brief 床下に落ちているオブジェクトの数を返す / scan_floor
1626 * @param items オブジェクトのIDリストを返すための配列参照ポインタ
1627 * @param y 走査するフロアのY座標
1628 * @param x 走査するフロアのX座標
1629 * @param mode オプションフラグ
1630 * @return 対象のマスに落ちているアイテム数
1632 * Return a list of o_list[] indexes of items at the given floor
1633 * location. Valid flags are:
1635 * mode & 0x01 -- Item tester
1636 * mode & 0x02 -- Marked items only
1637 * mode & 0x04 -- Stop after first
1639 ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode)
1641 OBJECT_IDX this_o_idx, next_o_idx;
1643 ITEM_NUMBER num = 0;
1646 if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return 0;
1648 /* Scan all objects in the grid */
1649 for (this_o_idx = p_ptr->current_floor_ptr->grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
1652 o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
1653 next_o_idx = o_ptr->next_o_idx;
1656 if ((mode & 0x01) && !item_tester_okay(o_ptr, item_tester_tval)) continue;
1659 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
1661 /* Accept this item */
1662 /* XXX Hack -- Enforce limit */
1664 items[num] = this_o_idx;
1669 if (mode & 0x04) break;
1676 * @brief 床下に落ちているアイテムの一覧を返す / Display a list of the items on the floor at the given location.
1677 * @param target_item カーソルの初期値
1678 * @param y 走査するフロアのY座標
1679 * @param x 走査するフロアのX座標
1680 * @param min_width 表示の長さ
1681 * @return 選択したアイテムの添え字
1684 COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_width)
1692 GAME_TEXT o_name[MAX_NLEN];
1695 COMMAND_CODE out_index[23];
1696 TERM_COLOR out_color[23];
1697 char out_desc[23][MAX_NLEN];
1698 COMMAND_CODE target_item_label = 0;
1700 OBJECT_IDX floor_list[23];
1701 ITEM_NUMBER floor_num;
1703 char floor_label[52 + 1];
1705 bool dont_need_to_show_weights = TRUE;
1707 Term_get_size(&wid, &hgt);
1709 /* Default length */
1710 len = MAX((*min_width), 20);
1712 /* Scan for objects in the grid, using item_tester_okay() */
1713 floor_num = scan_floor(floor_list, y, x, 0x03);
1715 /* Display the floor objects */
1716 for (k = 0, i = 0; i < floor_num && i < 23; i++)
1718 o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
1720 object_desc(o_name, o_ptr, 0);
1722 /* Save the index */
1725 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
1727 /* Save the object description */
1728 strcpy(out_desc[k], o_name);
1730 /* Find the predicted "line length" */
1731 l = strlen(out_desc[k]) + 5;
1733 /* Be sure to account for the weight */
1734 if (show_weights) l += 9;
1736 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
1738 /* Maintain the maximum length */
1739 if (l > len) len = l;
1741 /* Advance to next "line" */
1745 if (show_weights && dont_need_to_show_weights) len -= 9;
1750 /* Find the column to start in */
1751 col = (len > wid - 4) ? 0 : (wid - len - 1);
1753 prepare_label_string_floor(floor_label, floor_list, floor_num);
1755 /* Output each entry */
1756 for (j = 0; j < k; j++)
1758 m = floor_list[out_index[j]];
1759 o_ptr = &p_ptr->current_floor_ptr->o_list[m];
1761 /* Clear the line */
1762 prt("", j + 1, col ? col - 2 : col);
1764 if (use_menu && target_item)
1766 if (j == (target_item - 1))
1768 strcpy(tmp_val, _("》", "> "));
1769 target_item_label = m;
1771 else strcpy(tmp_val, " ");
1775 /* Prepare an index --(-- */
1776 sprintf(tmp_val, "%c)", floor_label[j]);
1779 /* Clear the line with the (possibly indented) index */
1780 put_str(tmp_val, j + 1, col);
1782 /* Display the entry itself */
1783 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
1785 /* Display the weight if needed */
1786 if (show_weights && (o_ptr->tval != TV_GOLD))
1788 int wgt = o_ptr->weight * o_ptr->number;
1790 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
1792 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
1795 prt(tmp_val, j + 1, wid - 9);
1799 /* Make a "shadow" below the list (only if needed) */
1800 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
1802 return target_item_label;
1806 * @brief オブジェクト選択の汎用関数(床上アイテム用) /
1807 * Let the user select an item, save its "index"
1808 * @param cp 選択したオブジェクトのIDを返す。
1809 * @param pmt 選択目的のメッセージ
1810 * @param str 選択できるオブジェクトがない場合のキャンセルメッセージ
1811 * @param mode オプションフラグ
1812 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
1814 bool get_item_floor(player_type *creature_ptr, COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
1816 char n1 = ' ', n2 = ' ', which = ' ';
1819 COMMAND_CODE i1, i2;
1820 COMMAND_CODE e1, e2;
1828 bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
1829 bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
1830 bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
1831 bool force = (mode & USE_FORCE) ? TRUE : FALSE;
1833 bool allow_equip = FALSE;
1834 bool allow_inven = FALSE;
1835 bool allow_floor = FALSE;
1837 bool toggle = FALSE;
1842 ITEM_NUMBER floor_num;
1843 OBJECT_IDX floor_list[23];
1845 TERM_LEN min_width = 0;
1847 int menu_line = (use_menu ? 1 : 0);
1851 static char prev_tag = '\0';
1852 char cur_tag = '\0';
1854 /* Get the item index */
1855 if (repeat_pull(cp))
1858 if (force && (*cp == INVEN_FORCE))
1861 item_tester_hook = NULL;
1862 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1867 else if (floor && (*cp < 0))
1869 if (prev_tag && command_cmd)
1871 /* Scan all objects in the grid */
1872 floor_num = scan_floor(floor_list, creature_ptr->y, creature_ptr->x, 0x03);
1874 /* Look up the tag */
1875 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
1877 /* Accept that choice */
1878 (*cp) = 0 - floor_list[k];
1880 /* Forget restrictions */
1882 item_tester_hook = NULL;
1883 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1889 prev_tag = '\0'; /* prev_tag is no longer effective */
1892 /* Validate the item */
1893 else if (item_tester_okay(&creature_ptr->current_floor_ptr->o_list[0 - (*cp)], tval) || (mode & USE_FULL))
1895 /* Forget restrictions */
1897 item_tester_hook = NULL;
1898 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1905 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
1906 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
1908 if (prev_tag && command_cmd)
1910 /* Look up the tag and validate the item */
1911 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, tval)) /* Reject */;
1912 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
1913 else if (!get_item_okay(k)) /* Reject */;
1916 /* Accept that choice */
1919 /* Forget restrictions */
1921 item_tester_hook = NULL;
1922 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1928 prev_tag = '\0'; /* prev_tag is no longer effective */
1931 /* Verify the item */
1932 else if (get_item_okay(*cp))
1934 /* Forget restrictions */
1936 item_tester_hook = NULL;
1937 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1951 /* No item selected */
1955 i2 = INVEN_PACK - 1;
1957 if (!inven) i2 = -1;
1960 for (j = 0; j < INVEN_PACK; j++)
1961 if (item_tester_okay(&creature_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_inven++;
1964 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
1965 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
1968 /* Full equipment */
1970 e2 = INVEN_TOTAL - 1;
1972 /* Forbid equipment */
1973 if (!equip) e2 = -1;
1976 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
1977 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&creature_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_equip++;
1978 if (creature_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
1981 /* Restrict equipment indexes */
1982 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
1983 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
1985 if (equip && creature_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT))
1987 if (creature_ptr->migite)
1989 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
1991 else if (creature_ptr->hidarite) e1 = INVEN_RARM;
1995 /* Count "okay" floor items */
1998 /* Restrict floor usage */
2001 /* Scan all objects in the grid */
2002 floor_num = scan_floor(floor_list, creature_ptr->y, creature_ptr->x, 0x03);
2005 if (i1 <= i2) allow_inven = TRUE;
2007 /* Accept equipment */
2008 if (e1 <= e2) allow_equip = TRUE;
2011 if (floor_num) allow_floor = TRUE;
2013 /* Require at least one legal choice */
2014 if (!allow_inven && !allow_equip && !allow_floor)
2016 command_see = FALSE;
2026 /* Analyze choices */
2029 /* Hack -- Start on equipment if requested */
2030 if (command_see && (command_wrk == (USE_EQUIP))
2033 command_wrk = (USE_EQUIP);
2036 else if (allow_inven)
2038 command_wrk = (USE_INVEN);
2041 /* Use equipment if allowed */
2042 else if (allow_equip)
2044 command_wrk = (USE_EQUIP);
2047 /* Use floor if allowed */
2048 else if (allow_floor)
2050 command_wrk = (USE_FLOOR);
2055 * 追加オプション(always_show_list)が設定されている場合は常に一覧を表示する
2057 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
2059 /* Hack -- start out in "display" mode */
2065 /* Repeat until done */
2068 COMMAND_CODE get_item_label = 0;
2075 for (j = 0; j < 8; j++)
2078 if (!angband_term[j]) continue;
2080 /* Count windows displaying inven */
2081 if (window_flag[j] & (PW_INVEN)) ni++;
2083 /* Count windows displaying equip */
2084 if (window_flag[j] & (PW_EQUIP)) ne++;
2087 /* Toggle if needed */
2088 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
2089 (command_wrk == (USE_INVEN) && !ni && ne))
2091 toggle_inven_equip(creature_ptr);
2095 creature_ptr->window |= (PW_INVEN | PW_EQUIP);
2096 handle_stuff(creature_ptr);
2098 /* Inventory screen */
2099 if (command_wrk == (USE_INVEN))
2101 /* Extract the legal requests */
2105 /* Redraw if needed */
2106 if (command_see) get_item_label = show_inven(creature_ptr, menu_line, mode, tval);
2109 /* Equipment screen */
2110 else if (command_wrk == (USE_EQUIP))
2112 /* Extract the legal requests */
2113 n1 = I2A(e1 - INVEN_RARM);
2114 n2 = I2A(e2 - INVEN_RARM);
2116 /* Redraw if needed */
2117 if (command_see) get_item_label = show_equip(creature_ptr, menu_line, mode, tval);
2121 else if (command_wrk == (USE_FLOOR))
2124 k = MIN(floor_top + 23, floor_num) - 1;
2126 /* Extract the legal requests */
2127 n1 = I2A(j - floor_top);
2128 n2 = I2A(k - floor_top);
2130 /* Redraw if needed */
2131 if (command_see) get_item_label = show_floor(menu_line, creature_ptr->y, creature_ptr->x, &min_width);
2134 if (command_wrk == (USE_INVEN))
2136 /* Begin the prompt */
2137 sprintf(out_val, _("持ち物:", "Inven:"));
2141 /* Build the prompt */
2142 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
2143 index_to_label(i1), index_to_label(i2));
2146 strcat(out_val, tmp_val);
2149 /* Indicate ability to "view" */
2150 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
2156 strcat(out_val, _(" '/' 装備品,", " / for Equip,"));
2157 else if (allow_floor)
2158 strcat(out_val, _(" '6' 装備品,", " 6 for Equip,"));
2160 strcat(out_val, _(" '4'or'6' 装備品,", " 4 or 6 for Equip,"));
2167 strcat(out_val, _(" '-'床上,", " - for floor,"));
2168 else if (allow_equip)
2169 strcat(out_val, _(" '4' 床上,", " 4 for floor,"));
2171 strcat(out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
2175 /* Viewing equipment */
2176 else if (command_wrk == (USE_EQUIP))
2178 /* Begin the prompt */
2179 sprintf(out_val, _("装備品:", "Equip:"));
2183 /* Build the prompt */
2184 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
2185 index_to_label(e1), index_to_label(e2));
2188 strcat(out_val, tmp_val);
2191 /* Indicate ability to "view" */
2192 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
2198 strcat(out_val, _(" '/' 持ち物,", " / for Inven,"));
2199 else if (allow_floor)
2200 strcat(out_val, _(" '4' 持ち物,", " 4 for Inven,"));
2202 strcat(out_val, _(" '4'or'6' 持ち物,", " 4 or 6 for Inven,"));
2209 strcat(out_val, _(" '-'床上,", " - for floor,"));
2210 else if (allow_inven)
2211 strcat(out_val, _(" '6' 床上,", " 6 for floor,"));
2213 strcat(out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
2218 else if (command_wrk == (USE_FLOOR))
2220 /* Begin the prompt */
2221 sprintf(out_val, _("床上:", "Floor:"));
2225 /* Build the prompt */
2226 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), n1, n2);
2229 strcat(out_val, tmp_val);
2232 /* Indicate ability to "view" */
2233 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
2237 if (allow_inven && allow_equip)
2239 strcat(out_val, _(" '4' 装備品, '6' 持ち物,", " 4 for Equip, 6 for Inven,"));
2241 else if (allow_inven)
2243 strcat(out_val, _(" '4'or'6' 持ち物,", " 4 or 6 for Inven,"));
2245 else if (allow_equip)
2247 strcat(out_val, _(" '4'or'6' 装備品,", " 4 or 6 for Equip,"));
2251 else if (allow_inven)
2253 strcat(out_val, _(" '/' 持ち物,", " / for Inven,"));
2255 else if (allow_equip)
2257 strcat(out_val, _(" '/'装備品,", " / for Equip,"));
2261 if (command_see && !use_menu)
2263 strcat(out_val, _(" Enter 次,", " Enter for scroll down,"));
2268 if (force) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
2270 /* Finish the prompt */
2271 strcat(out_val, " ESC");
2273 /* Build the prompt */
2274 sprintf(tmp_val, "(%s) %s", out_val, pmt);
2276 /* Show the prompt */
2285 if (command_wrk == USE_INVEN) max_line = max_inven;
2286 else if (command_wrk == USE_EQUIP) max_line = max_equip;
2287 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
2303 menu_line += (max_line - 1);
2319 /* Verify legality */
2320 if (command_wrk == (USE_INVEN))
2322 if (allow_floor) command_wrk = USE_FLOOR;
2323 else if (allow_equip) command_wrk = USE_EQUIP;
2330 else if (command_wrk == (USE_EQUIP))
2332 if (allow_inven) command_wrk = USE_INVEN;
2333 else if (allow_floor) command_wrk = USE_FLOOR;
2340 else if (command_wrk == (USE_FLOOR))
2342 if (allow_equip) command_wrk = USE_EQUIP;
2343 else if (allow_inven) command_wrk = USE_INVEN;
2356 /* Hack -- Fix screen */
2363 /* Switch inven/equip */
2364 if (command_wrk == USE_INVEN) max_line = max_inven;
2365 else if (command_wrk == USE_EQUIP) max_line = max_equip;
2366 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
2367 if (menu_line > max_line) menu_line = max_line;
2369 /* Need to redraw */
2377 /* Verify legality */
2378 if (command_wrk == (USE_INVEN))
2380 if (allow_equip) command_wrk = USE_EQUIP;
2381 else if (allow_floor) command_wrk = USE_FLOOR;
2388 else if (command_wrk == (USE_EQUIP))
2390 if (allow_floor) command_wrk = USE_FLOOR;
2391 else if (allow_inven) command_wrk = USE_INVEN;
2398 else if (command_wrk == (USE_FLOOR))
2400 if (allow_inven) command_wrk = USE_INVEN;
2401 else if (allow_equip) command_wrk = USE_EQUIP;
2414 /* Hack -- Fix screen */
2421 /* Switch inven/equip */
2422 if (command_wrk == USE_INVEN) max_line = max_inven;
2423 else if (command_wrk == USE_EQUIP) max_line = max_equip;
2424 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
2425 if (menu_line > max_line) menu_line = max_line;
2427 /* Need to redraw */
2436 if (command_wrk == USE_FLOOR)
2439 (*cp) = -get_item_label;
2443 /* Validate the item */
2444 if (!get_item_okay(get_item_label))
2450 /* Allow player to "refuse" certain actions */
2451 if (!get_item_allow(get_item_label))
2457 /* Accept that choice */
2458 (*cp) = get_item_label;
2475 if (menu_line > max_line) menu_line -= max_line;
2496 command_see = FALSE;
2517 grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
2519 if (command_wrk != (USE_FLOOR)) break;
2521 /* Get the object being moved. */
2522 o_idx = g_ptr->o_idx;
2524 /* Only rotate a pile of two or more objects. */
2525 if (!(o_idx && creature_ptr->current_floor_ptr->o_list[o_idx].next_o_idx)) break;
2527 /* Remove the first object from the list. */
2528 excise_object_idx(creature_ptr->current_floor_ptr, o_idx);
2530 /* Find end of the list. */
2532 while (creature_ptr->current_floor_ptr->o_list[i].next_o_idx)
2533 i = creature_ptr->current_floor_ptr->o_list[i].next_o_idx;
2535 /* Add after the last object. */
2536 creature_ptr->current_floor_ptr->o_list[i].next_o_idx = o_idx;
2538 /* Re-scan floor list */
2539 floor_num = scan_floor(floor_list, creature_ptr->y, creature_ptr->x, 0x03);
2541 /* Hack -- Fix screen */
2553 if (command_wrk == (USE_INVEN))
2560 command_wrk = (USE_EQUIP);
2562 else if (command_wrk == (USE_EQUIP))
2569 command_wrk = (USE_INVEN);
2571 else if (command_wrk == (USE_FLOOR))
2575 command_wrk = (USE_INVEN);
2577 else if (allow_equip)
2579 command_wrk = (USE_EQUIP);
2588 /* Hack -- Fix screen */
2595 /* Need to redraw */
2608 * If we are already examining the floor, and there
2609 * is only one item, we will always select it.
2610 * If we aren't examining the floor and there is only
2611 * one item, we will select it if floor_query_flag
2616 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
2619 k = 0 - floor_list[0];
2621 /* Allow player to "refuse" certain actions */
2622 if (!get_item_allow(k))
2628 /* Accept that choice */
2637 /* Hack -- Fix screen */
2644 command_wrk = (USE_FLOOR);
2650 case '1': case '2': case '3':
2651 case '4': case '5': case '6':
2652 case '7': case '8': case '9':
2654 if (command_wrk != USE_FLOOR)
2656 /* Look up the tag */
2657 if (!get_tag(&k, which, command_wrk, tval))
2663 /* Hack -- Validate the item */
2664 if ((k < INVEN_RARM) ? !inven : !equip)
2670 /* Validate the item */
2671 if (!get_item_okay(k))
2679 /* Look up the alphabetical tag */
2680 if (get_tag_floor(&k, which, floor_list, floor_num))
2683 k = 0 - floor_list[k];
2692 /* Allow player to "refuse" certain actions */
2693 if (!get_item_allow(k))
2699 /* Accept that choice */
2711 if (command_wrk == (USE_INVEN))
2713 k = ((i1 == i2) ? i1 : -1);
2716 /* Choose "default" equipment item */
2717 else if (command_wrk == (USE_EQUIP))
2719 k = ((e1 == e2) ? e1 : -1);
2722 /* Choose "default" floor item */
2723 else if (command_wrk == (USE_FLOOR))
2728 k = 0 - floor_list[0];
2730 /* Allow player to "refuse" certain actions */
2731 if (!get_item_allow(k))
2737 /* Accept that choice */
2745 /* Validate the item */
2746 if (!get_item_okay(k))
2752 /* Allow player to "refuse" certain actions */
2753 if (!get_item_allow(k))
2759 /* Accept that choice */
2783 if (command_wrk != USE_FLOOR)
2785 bool not_found = FALSE;
2787 /* Look up the alphabetical tag */
2788 if (!get_tag(&k, which, command_wrk, tval))
2793 /* Hack -- Validate the item */
2794 else if ((k < INVEN_RARM) ? !inven : !equip)
2799 /* Validate the item */
2800 else if (!get_item_okay(k))
2807 /* Accept that choice */
2817 /* Look up the alphabetical tag */
2818 if (get_tag_floor(&k, which, floor_list, floor_num))
2821 k = 0 - floor_list[k];
2823 /* Accept that choice */
2832 /* Extract "query" setting */
2833 ver = isupper(which);
2834 which = (char)tolower(which);
2836 if (command_wrk == (USE_INVEN))
2838 if (which == '(') k = i1;
2839 else if (which == ')') k = i2;
2840 else k = label_to_inven(which);
2843 /* Convert letter to equipment index */
2844 else if (command_wrk == (USE_EQUIP))
2846 if (which == '(') k = e1;
2847 else if (which == ')') k = e2;
2848 else k = label_to_equip(which);
2851 /* Convert letter to floor index */
2852 else if (command_wrk == USE_FLOOR)
2854 if (which == '(') k = 0;
2855 else if (which == ')') k = floor_num - 1;
2856 else k = islower(which) ? A2I(which) : -1;
2857 if (k < 0 || k >= floor_num || k >= 23)
2864 k = 0 - floor_list[k];
2867 /* Validate the item */
2868 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
2874 /* Verify the item */
2875 if (ver && !verify(_("本当に", "Try"), k))
2881 /* Allow player to "refuse" certain actions */
2882 if (!get_item_allow(k))
2888 /* Accept that choice */
2898 /* Fix the screen if necessary */
2903 /* Hack -- Cancel "display" */
2904 command_see = FALSE;
2908 /* Forget the tval restriction */
2911 /* Forget the item_tester_hook restriction */
2912 item_tester_hook = NULL;
2915 /* Clean up 'show choices' */
2916 if (toggle) toggle_inven_equip(creature_ptr);
2918 creature_ptr->window |= (PW_INVEN | PW_EQUIP);
2919 handle_stuff(creature_ptr);
2921 /* Clear the prompt line */
2924 /* Warning if needed */
2925 if (oops && str) msg_print(str);
2930 if (command_cmd) prev_tag = cur_tag;
2931 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
2937 * @brief 床上のアイテムを拾う選択用サブルーチン
2938 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。
2940 static bool py_pickup_floor_aux(void)
2942 OBJECT_IDX this_o_idx;
2946 /* Restrict the choices */
2947 item_tester_hook = inven_carry_okay;
2950 q = _("どれを拾いますか?", "Get which item? ");
2951 s = _("もうザックには床にあるどのアイテムも入らない。", "You no longer have any room for the objects on the floor.");
2953 if (choose_object(p_ptr, &item, q, s, (USE_FLOOR), 0))
2955 this_o_idx = 0 - item;
2962 /* Pick up the object */
2963 py_pickup_aux(p_ptr, this_o_idx);
2969 * @brief 床上のアイテムを拾うメイン処理
2970 * @param pickup FALSEなら金銭の自動拾いのみを行う/ FALSE then only gold will be picked up
2973 * This is called by py_pickup() when easy_floor is TRUE.
2975 void py_pickup_floor(player_type *creature_ptr, bool pickup)
2977 OBJECT_IDX this_o_idx, next_o_idx = 0;
2979 GAME_TEXT o_name[MAX_NLEN];
2983 OBJECT_IDX floor_o_idx = 0;
2987 /* Scan the pile of objects */
2988 for (this_o_idx = creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
2990 /* Access the object */
2991 o_ptr = &creature_ptr->current_floor_ptr->o_list[this_o_idx];
2993 object_desc(o_name, o_ptr, 0);
2995 /* Access the next object */
2996 next_o_idx = o_ptr->next_o_idx;
2998 disturb(creature_ptr, FALSE, FALSE);
3001 if (o_ptr->tval == TV_GOLD)
3004 msg_format(" $%ld の価値がある%sを見つけた。",
3005 (long)o_ptr->pval, o_name);
3007 msg_format("You have found %ld gold pieces worth of %s.",
3008 (long)o_ptr->pval, o_name);
3011 /* Collect the gold */
3012 creature_ptr->au += o_ptr->pval;
3015 creature_ptr->redraw |= (PR_GOLD);
3017 creature_ptr->window |= (PW_PLAYER);
3019 /* Delete the gold */
3020 delete_object_idx(creature_ptr->current_floor_ptr, this_o_idx);
3022 /* Check the next object */
3025 else if (o_ptr->marked & OM_NOMSG)
3027 /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
3028 * ignored. Otherwise, they are included in the prompt. */
3029 o_ptr->marked &= ~(OM_NOMSG);
3033 /* Count non-gold objects that can be picked up. */
3034 if (inven_carry_okay(o_ptr))
3039 /* Count non-gold objects */
3042 /* Remember this index */
3043 floor_o_idx = this_o_idx;
3046 /* There are no non-gold objects */
3050 /* Mention the number of objects */
3056 /* Access the object */
3057 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3059 #ifdef ALLOW_EASY_SENSE
3061 /* Option: Make object sensing easy */
3064 /* Sense the object */
3065 (void)sense_object(o_ptr);
3068 #endif /* ALLOW_EASY_SENSE */
3070 object_desc(o_name, o_ptr, 0);
3072 msg_format(_("%sがある。", "You see %s."), o_name);
3075 /* Multiple objects */
3078 msg_format(_("%d 個のアイテムの山がある。", "You see a pile of %d items."), floor_num);
3084 /* The player has no room for anything on the floor. */
3090 /* Access the object */
3091 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3093 #ifdef ALLOW_EASY_SENSE
3095 /* Option: Make object sensing easy */
3098 /* Sense the object */
3099 (void)sense_object(o_ptr);
3102 #endif /* ALLOW_EASY_SENSE */
3104 object_desc(o_name, o_ptr, 0);
3106 msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name);
3109 /* Multiple objects */
3112 msg_print(_("ザックには床にあるどのアイテムも入らない。", "You have no room for any of the objects on the floor."));
3122 /* Hack -- query every object */
3123 if (carry_query_flag)
3125 char out_val[MAX_NLEN + 20];
3127 /* Access the object */
3128 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3130 #ifdef ALLOW_EASY_SENSE
3132 /* Option: Make object sensing easy */
3135 /* Sense the object */
3136 (void)sense_object(o_ptr);
3139 #endif /* ALLOW_EASY_SENSE */
3141 object_desc(o_name, o_ptr, 0);
3143 (void)sprintf(out_val, _("%sを拾いますか? ", "Pick up %s? "), o_name);
3145 /* Ask the user to confirm */
3146 if (!get_check(out_val))
3152 /* Access the object */
3153 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3155 #ifdef ALLOW_EASY_SENSE
3157 /* Option: Make object sensing easy */
3160 /* Sense the object */
3161 (void)sense_object(o_ptr);
3164 #endif /* ALLOW_EASY_SENSE */
3166 /* Pick up the object */
3167 py_pickup_aux(creature_ptr, floor_o_idx);
3170 /* Allow the user to choose an object */
3173 while (can_pickup--)
3175 if (!py_pickup_floor_aux()) break;
3183 * @brief 所持アイテム一覧を表示する /
3184 * Choice window "shadow" of the "show_inven()" function
3187 void display_inven(player_type *creature_ptr, OBJECT_TYPE_VALUE tval)
3189 register int i, n, z = 0;
3191 TERM_COLOR attr = TERM_WHITE;
3193 GAME_TEXT o_name[MAX_NLEN];
3196 if (!creature_ptr || !creature_ptr->inventory_list) return;
3198 Term_get_size(&wid, &hgt);
3200 for (i = 0; i < INVEN_PACK; i++)
3202 o_ptr = &creature_ptr->inventory_list[i];
3203 if (!o_ptr->k_idx) continue;
3207 for (i = 0; i < z; i++)
3209 o_ptr = &creature_ptr->inventory_list[i];
3210 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
3211 if (item_tester_okay(o_ptr, tval))
3213 tmp_val[0] = index_to_label(i);
3217 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
3218 object_desc(o_name, o_ptr, 0);
3220 attr = tval_to_attr[o_ptr->tval % 128];
3226 Term_putstr(3, i, n, attr, o_name);
3227 Term_erase(3 + n, i, 255);
3231 int wgt = o_ptr->weight * o_ptr->number;
3233 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
3235 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3237 prt(tmp_val, i, wid - 9);
3241 for (i = z; i < hgt; i++)
3243 Term_erase(0, i, 255);
3249 * @brief 装備アイテムの表示を行う /
3250 * Display the equipment.
3251 * @param target_item アイテムの選択処理を行うか否か。
3252 * @return 選択したアイテムのタグ
3254 COMMAND_CODE show_equip(player_type *owner_ptr, int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
3258 int col, cur_col, len;
3261 GAME_TEXT o_name[MAX_NLEN];
3262 COMMAND_CODE out_index[23];
3263 TERM_COLOR out_color[23];
3264 char out_desc[23][MAX_NLEN];
3265 COMMAND_CODE target_item_label = 0;
3267 char equip_label[52 + 1];
3269 /* Starting column */
3272 Term_get_size(&wid, &hgt);
3274 /* Maximal length */
3275 len = wid - col - 1;
3278 /* Scan the equipment list */
3279 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3281 o_ptr = &owner_ptr->inventory_list[i];
3283 /* Is this item acceptable? */
3284 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, tval) || (mode & USE_FULL)) &&
3285 (!((((i == INVEN_RARM) && owner_ptr->hidarite) || ((i == INVEN_LARM) && owner_ptr->migite)) && owner_ptr->ryoute) ||
3286 (mode & IGNORE_BOTHHAND_SLOT))) continue;
3288 object_desc(o_name, o_ptr, 0);
3290 if ((((i == INVEN_RARM) && owner_ptr->hidarite) || ((i == INVEN_LARM) && owner_ptr->migite)) && owner_ptr->ryoute)
3292 (void)strcpy(out_desc[k], _("(武器を両手持ち)", "(wielding with two-hands)"));
3293 out_color[k] = TERM_WHITE;
3297 (void)strcpy(out_desc[k], o_name);
3298 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3302 /* Grey out charging items */
3305 out_color[k] = TERM_L_DARK;
3308 /* Extract the maximal length (see below) */
3310 l = strlen(out_desc[k]) + (2 + 1);
3312 l = strlen(out_desc[k]) + (2 + 3);
3316 /* Increase length for labels (if needed) */
3318 if (show_labels) l += (7 + 2);
3320 if (show_labels) l += (14 + 2);
3324 /* Increase length for weight (if needed) */
3325 if (show_weights) l += 9;
3327 if (show_item_graph) l += 2;
3329 /* Maintain the max-length */
3330 if (l > len) len = l;
3332 /* Advance the entry */
3336 /* Hack -- Find a column to start in */
3338 col = (len > wid - 6) ? 0 : (wid - len - 1);
3340 col = (len > wid - 4) ? 0 : (wid - len - 1);
3343 prepare_label_string(equip_label, USE_EQUIP, tval);
3345 /* Output each entry */
3346 for (j = 0; j < k; j++)
3349 o_ptr = &owner_ptr->inventory_list[i];
3351 /* Clear the line */
3352 prt("", j + 1, col ? col - 2 : col);
3354 if (use_menu && target_item)
3356 if (j == (target_item - 1))
3358 strcpy(tmp_val, _("》", "> "));
3359 target_item_label = i;
3361 else strcpy(tmp_val, " ");
3363 else if (i >= INVEN_RARM)
3365 /* Prepare an index --(-- */
3366 sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
3370 /* Prepare an index --(-- */
3371 sprintf(tmp_val, "%c)", index_to_label(i));
3374 /* Clear the line with the (possibly indented) index */
3375 put_str(tmp_val, j + 1, col);
3379 /* Display graphics for object, if desired */
3380 if (show_item_graph)
3382 TERM_COLOR a = object_attr(o_ptr);
3383 SYMBOL_CODE c = object_char(o_ptr);
3384 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3385 if (use_bigtile) cur_col++;
3393 /* Mention the use */
3394 (void)sprintf(tmp_val, _("%-7s: ", "%-14s: "), mention_use(owner_ptr, i));
3396 put_str(tmp_val, j + 1, cur_col);
3398 /* Display the entry itself */
3399 c_put_str(out_color[j], out_desc[j], j + 1, _(cur_col + 9, cur_col + 16));
3405 /* Display the entry itself */
3406 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
3409 /* Display the weight if needed */
3412 int wgt = o_ptr->weight * o_ptr->number;
3414 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
3416 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
3419 prt(tmp_val, j + 1, wid - 9);
3423 /* Make a "shadow" below the list (only if needed) */
3424 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3426 /* Save the new column */
3429 return target_item_label;
3434 * @brief 所持/装備オブジェクトIDの現在の扱い方の状態表現を返す /
3435 * Return a string describing how a given item is being worn.
3436 * @param i 状態表現を求めるプレイヤーの所持/装備オブジェクトID
3437 * @return 状態表現内容の文字列ポインタ
3439 * Currently, only used for items in the equipment, inventory.
3441 concptr describe_use(int i)
3448 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "運搬中の" : ((p_ptr->ryoute && p_ptr->migite) ? "両手に装備している" : (left_hander ? "左手に装備している" : "右手に装備している")); break;
3450 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
3454 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "運搬中の" : ((p_ptr->ryoute && p_ptr->hidarite) ? "両手に装備している" : (left_hander ? "右手に装備している" : "左手に装備している")); break;
3456 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
3459 case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < p_ptr->inventory_list[i].weight / 10) ? _("持つだけで精一杯の", "just holding") : _("射撃用に装備している", "shooting missiles with"); break;
3460 case INVEN_RIGHT: p = (left_hander ? _("左手の指にはめている", "wearing on your left hand") : _("右手の指にはめている", "wearing on your right hand")); break;
3461 case INVEN_LEFT: p = (left_hander ? _("右手の指にはめている", "wearing on your right hand") : _("左手の指にはめている", "wearing on your left hand")); break;
3462 case INVEN_NECK: p = _("首にかけている", "wearing around your neck"); break;
3463 case INVEN_LITE: p = _("光源にしている", "using to light the way"); break;
3464 case INVEN_BODY: p = _("体に着ている", "wearing on your body"); break;
3465 case INVEN_OUTER: p = _("身にまとっている", "wearing on your back"); break;
3466 case INVEN_HEAD: p = _("頭にかぶっている", "wearing on your head"); break;
3467 case INVEN_HANDS: p = _("手につけている", "wearing on your hands"); break;
3468 case INVEN_FEET: p = _("足にはいている", "wearing on your feet"); break;
3469 default: p = _("ザックに入っている", "carrying in your pack"); break;
3472 /* Return the result */