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 * Convert a label into the index of a item in the "equip"
32 * @return 対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item
34 static INVENTORY_IDX label_to_equip(int c)
39 i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1) + INVEN_RARM;
41 /* Verify the index */
42 if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1);
44 if (select_ring_slot) return is_ring_slot(i) ? i : -1;
46 /* Empty slots can never be chosen */
47 if (!p_ptr->inventory_list[i].k_idx) return (-1);
49 /* Return the index */
54 * @brief 選択アルファベットラベルからプレイヤーの所持オブジェクトIDを返す /
55 * Convert a label into the index of an item in the "inven"
56 * @return 対応するID。該当スロットにオブジェクトが存在しなかった場合-1を返す / Return "-1" if the label does not indicate a real item
57 * @details Note that the label does NOT distinguish inven/equip.
59 static INVENTORY_IDX label_to_inven(int c)
64 i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1);
66 /* Verify the index */
67 if ((i < 0) || (i > INVEN_PACK)) return (-1);
69 /* Empty slots can never be chosen */
70 if (!p_ptr->inventory_list[i].k_idx) return (-1);
72 /* Return the index */
78 * @brief 所持/装備オブジェクトIDの部位表現を返す /
79 * Return a string mentioning how a given item is carried
80 * @param i 部位表現を求めるプレイヤーの所持/装備オブジェクトID
81 * @return 部位表現の文字列ポインタ
83 static concptr mention_use(player_type *creature_ptr, int i)
87 /* Examine the location */
91 case INVEN_RARM: p = creature_ptr->heavy_wield[0] ? "運搬中" : ((creature_ptr->ryoute && creature_ptr->migite) ? " 両手" : (left_hander ? " 左手" : " 右手")); break;
93 case INVEN_RARM: p = creature_ptr->heavy_wield[0] ? "Just lifting" : (creature_ptr->migite ? "Wielding" : "On arm"); break;
97 case INVEN_LARM: p = creature_ptr->heavy_wield[1] ? "運搬中" : ((creature_ptr->ryoute && creature_ptr->hidarite) ? " 両手" : (left_hander ? " 右手" : " 左手")); break;
99 case INVEN_LARM: p = creature_ptr->heavy_wield[1] ? "Just lifting" : (creature_ptr->hidarite ? "Wielding" : "On arm"); break;
102 case INVEN_BOW: p = (adj_str_hold[creature_ptr->stat_ind[A_STR]] < creature_ptr->inventory_list[i].weight / 10) ? _("運搬中", "Just holding") : _("射撃用", "Shooting"); break;
103 case INVEN_RIGHT: p = (left_hander ? _("左手指", "On left hand") : _("右手指", "On right hand")); break;
104 case INVEN_LEFT: p = (left_hander ? _("右手指", "On right hand") : _("左手指", "On left hand")); break;
105 case INVEN_NECK: p = _(" 首", "Around neck"); break;
106 case INVEN_LITE: p = _(" 光源", "Light source"); break;
107 case INVEN_BODY: p = _(" 体", "On body"); break;
108 case INVEN_OUTER: p = _("体の上", "About body"); break;
109 case INVEN_HEAD: p = _(" 頭", "On head"); break;
110 case INVEN_HANDS: p = _(" 手", "On hands"); break;
111 case INVEN_FEET: p = _(" 足", "On feet"); break;
112 default: p = _("ザック", "In pack"); break;
115 /* Return the result */
120 * @brief 装備アイテム一覧を表示する /
121 * Choice window "shadow" of the "show_equip()" function
124 void display_equip(player_type *creature_ptr, OBJECT_TYPE_VALUE tval)
128 TERM_COLOR attr = TERM_WHITE;
130 GAME_TEXT o_name[MAX_NLEN];
133 if (!creature_ptr || !creature_ptr->inventory_list) return;
135 Term_get_size(&wid, &hgt);
137 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
139 o_ptr = &creature_ptr->inventory_list[i];
140 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
141 if (select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, tval))
143 tmp_val[0] = index_to_label(i);
147 Term_putstr(0, i - INVEN_RARM, 3, TERM_WHITE, tmp_val);
148 if ((((i == INVEN_RARM) && creature_ptr->hidarite) || ((i == INVEN_LARM) && creature_ptr->migite)) && creature_ptr->ryoute)
150 strcpy(o_name, _("(武器を両手持ち)", "(wielding with two-hands)"));
155 object_desc(o_name, o_ptr, 0);
156 attr = tval_to_attr[o_ptr->tval % 128];
164 Term_putstr(3, i - INVEN_RARM, n, attr, o_name);
166 Term_erase(3 + n, i - INVEN_RARM, 255);
170 int wgt = o_ptr->weight * o_ptr->number;
172 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
174 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
177 prt(tmp_val, i - INVEN_RARM, wid - (show_labels ? 28 : 9));
182 Term_putstr(wid - 20, i - INVEN_RARM, -1, TERM_WHITE, " <-- ");
183 prt(mention_use(creature_ptr, i), i - INVEN_RARM, wid - 15);
187 for (i = INVEN_TOTAL - INVEN_RARM; i < hgt; i++)
189 Term_erase(0, i, 255);
194 * @brief サブウィンドウに所持品、装備品リストの表示を行う /
195 * Flip "inven" and "equip" in any sub-windows
198 void toggle_inven_equip(player_type *creature_ptr)
203 for (j = 0; j < 8; j++)
206 if (!angband_term[j]) continue;
208 /* Flip inven to equip */
209 if (window_flag[j] & (PW_INVEN))
212 window_flag[j] &= ~(PW_INVEN);
213 window_flag[j] |= (PW_EQUIP);
215 creature_ptr->window |= (PW_EQUIP);
218 /* Flip inven to equip */
219 else if (window_flag[j] & (PW_EQUIP))
222 window_flag[j] &= ~(PW_EQUIP);
223 window_flag[j] |= (PW_INVEN);
225 creature_ptr->window |= (PW_INVEN);
232 * @brief プレイヤーの所持/装備オブジェクトが正規のものかを返す /
233 * Auxiliary function for "get_item()" -- test an index
235 * @return 正規のIDならばTRUEを返す。
237 bool get_item_okay(OBJECT_IDX i)
240 if ((i < 0) || (i >= INVEN_TOTAL)) return (FALSE);
242 if (select_ring_slot) return is_ring_slot(i);
244 /* Verify the item */
245 if (!item_tester_okay(&p_ptr->inventory_list[i], item_tester_tval)) return (FALSE);
252 * @brief 規定の処理にできるアイテムがプレイヤーの利用可能範囲内にあるかどうかを返す /
253 * Determine whether get_item() can get some item or not
254 * @return アイテムを拾えるならばTRUEを返す。
255 * @details assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
257 bool can_get_item(OBJECT_TYPE_VALUE tval)
260 OBJECT_IDX floor_list[23];
261 ITEM_NUMBER floor_num = 0;
263 for (j = 0; j < INVEN_TOTAL; j++)
264 if (item_tester_okay(&p_ptr->inventory_list[j], tval))
267 floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
276 * @brief 床オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す /
277 * Find the "first" inventory object with the given "tag".
278 * @param cp 対応するタグIDを与える参照ポインタ
279 * @param tag 該当するオブジェクトがあるかを調べたいタグ
280 * @param floor_list 床上アイテムの配列
281 * @param floor_num 床上アイテムの配列ID
282 * @return タグに該当するオブジェクトがあるならTRUEを返す
284 * A "tag" is a numeral "n" appearing as "@n" anywhere in the\n
285 * inscription of an object. Alphabetical characters don't work as a\n
286 * tag in this form.\n
288 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
289 * and "x" is the "current" command_cmd code.\n
291 static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
296 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
298 /* Check every object in the grid */
299 for (i = 0; i < floor_num && i < 23; i++)
301 object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
303 /* Skip empty inscriptions */
304 if (!o_ptr->inscription) continue;
307 s = my_strchr(quark_str(o_ptr->inscription), '@');
309 /* Process all tags */
312 /* Check the special tags */
313 if ((s[1] == command_cmd) && (s[2] == tag))
315 /* Save the actual floor object ID */
322 /* Find another '@' */
323 s = my_strchr(s + 1, '@');
328 /**** Find a tag in the form of {@#} (allows only numerals) ***/
330 /* Don't allow {@#} with '#' being alphabet */
331 if (tag < '0' || '9' < tag)
337 /* Check every object in the grid */
338 for (i = 0; i < floor_num && i < 23; i++)
340 object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
342 /* Skip empty inscriptions */
343 if (!o_ptr->inscription) continue;
346 s = my_strchr(quark_str(o_ptr->inscription), '@');
348 /* Process all tags */
351 /* Check the normal tags */
354 /* Save the floor object ID */
361 /* Find another '@' */
362 s = my_strchr(s + 1, '@');
372 * @brief 所持/装備オブジェクトに選択タグを与える/タグに該当するオブジェクトがあるかを返す /
373 * Find the "first" inventory object with the given "tag".
374 * @param cp 対応するタグIDを与える参照ポインタ
375 * @param tag 該当するオブジェクトがあるかを調べたいタグ
376 * @param mode 所持、装備の切り替え
377 * @return タグに該当するオブジェクトがあるならTRUEを返す
379 * A "tag" is a numeral "n" appearing as "@n" anywhere in the\n
380 * inscription of an object. Alphabetical characters don't work as a\n
381 * tag in this form.\n
383 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
384 * and "x" is the "current" command_cmd code.\n
386 static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
389 COMMAND_CODE start, end;
392 /* Extract index from mode */
397 end = INVEN_TOTAL - 1;
402 end = INVEN_PACK - 1;
409 /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
411 for (i = start; i <= end; i++)
413 object_type *o_ptr = &p_ptr->inventory_list[i];
414 if (!o_ptr->k_idx) continue;
416 /* Skip empty inscriptions */
417 if (!o_ptr->inscription) continue;
419 /* Skip non-choice */
420 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
423 s = my_strchr(quark_str(o_ptr->inscription), '@');
425 /* Process all tags */
428 /* Check the special tags */
429 if ((s[1] == command_cmd) && (s[2] == tag))
437 /* Find another '@' */
438 s = my_strchr(s + 1, '@');
443 /**** Find a tag in the form of {@#} (allows only numerals) ***/
445 /* Don't allow {@#} with '#' being alphabet */
446 if (tag < '0' || '9' < tag)
452 /* Check every object */
453 for (i = start; i <= end; i++)
455 object_type *o_ptr = &p_ptr->inventory_list[i];
456 if (!o_ptr->k_idx) continue;
458 /* Skip empty inscriptions */
459 if (!o_ptr->inscription) continue;
461 /* Skip non-choice */
462 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
465 s = my_strchr(quark_str(o_ptr->inscription), '@');
467 /* Process all tags */
470 /* Check the normal tags */
479 /* Find another '@' */
480 s = my_strchr(s + 1, '@');
489 * @brief タグIDにあわせてタグアルファベットのリストを返す /
490 * Move around label characters with correspond tags
491 * @param label ラベルリストを取得する文字列参照ポインタ
492 * @param mode 所持品リストか装備品リストかの切り替え
495 void prepare_label_string(char *label, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
497 concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
498 int offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
501 /* Prepare normal labels */
502 strcpy(label, alphabet_chars);
504 /* Move each label */
505 for (i = 0; i < 52; i++)
508 SYMBOL_CODE c = alphabet_chars[i];
510 /* Find a tag with this label */
511 if (get_tag(&index, c, mode, tval))
513 /* Delete the overwritten label */
514 if (label[i] == c) label[i] = ' ';
516 /* Move the label to the place of corresponding tag */
517 label[index - offset] = c;
524 * @brief タグIDにあわせてタグアルファベットのリストを返す(床上アイテム用) /
525 * Move around label characters with correspond tags (floor version)
526 * @param label ラベルリストを取得する文字列参照ポインタ
527 * @param floor_list 床上アイテムの配列
528 * @param floor_num 床上アイテムの配列ID
533 static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
535 concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
538 /* Prepare normal labels */
539 strcpy(label, alphabet_chars);
541 /* Move each label */
542 for (i = 0; i < 52; i++)
545 SYMBOL_CODE c = alphabet_chars[i];
547 /* Find a tag with this label */
548 if (get_tag_floor(&index, c, floor_list, floor_num))
550 /* Delete the overwritten label */
551 if (label[i] == c) label[i] = ' ';
553 /* Move the label to the place of corresponding tag */
560 * @brief 所持アイテムの表示を行う /
561 * Display the inventory.
562 * @param target_item アイテムの選択処理を行うか否か。
563 * @return 選択したアイテムのタグ
565 * Hack -- do not display "trailing" empty slots
567 COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
571 int col, cur_col, len;
573 GAME_TEXT o_name[MAX_NLEN];
575 COMMAND_CODE out_index[23];
576 TERM_COLOR out_color[23];
577 char out_desc[23][MAX_NLEN];
578 COMMAND_CODE target_item_label = 0;
580 char inven_label[52 + 1];
582 /* Starting column */
585 Term_get_size(&wid, &hgt);
587 /* Default "max-length" */
591 /* Find the "final" slot */
592 for (i = 0; i < INVEN_PACK; i++)
594 o_ptr = &p_ptr->inventory_list[i];
595 if (!o_ptr->k_idx) continue;
601 prepare_label_string(inven_label, USE_INVEN, tval);
603 for (k = 0, i = 0; i < z; i++)
605 o_ptr = &p_ptr->inventory_list[i];
607 /* Is this item acceptable? */
608 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
610 object_desc(o_name, o_ptr, 0);
612 /* Save the object index, color, and description */
614 out_color[k] = tval_to_attr[o_ptr->tval % 128];
616 /* Grey out charging items */
619 out_color[k] = TERM_L_DARK;
622 (void)strcpy(out_desc[k], o_name);
624 /* Find the predicted "line length" */
625 l = strlen(out_desc[k]) + 5;
627 /* Be sure to account for the weight */
628 if (show_weights) l += 9;
630 /* Account for icon if displayed */
634 if (use_bigtile) l++;
637 /* Maintain the maximum length */
638 if (l > len) len = l;
640 /* Advance to next "line" */
644 /* Find the column to start in */
645 col = (len > wid - 4) ? 0 : (wid - len - 1);
647 /* Output each entry */
648 for (j = 0; j < k; j++)
651 o_ptr = &p_ptr->inventory_list[i];
654 prt("", j + 1, col ? col - 2 : col);
656 if (use_menu && target_item)
658 if (j == (target_item - 1))
660 strcpy(tmp_val, _("》", "> "));
661 target_item_label = i;
663 else strcpy(tmp_val, " ");
665 else if (i <= INVEN_PACK)
667 /* Prepare an index --(-- */
668 sprintf(tmp_val, "%c)", inven_label[i]);
672 /* Prepare an index --(-- */
673 sprintf(tmp_val, "%c)", index_to_label(i));
676 /* Clear the line with the (possibly indented) index */
677 put_str(tmp_val, j + 1, col);
681 /* Display graphics for object, if desired */
684 TERM_COLOR a = object_attr(o_ptr);
685 SYMBOL_CODE c = object_char(o_ptr);
686 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
687 if (use_bigtile) cur_col++;
693 /* Display the entry itself */
694 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
696 /* Display the weight if needed */
699 int wgt = o_ptr->weight * o_ptr->number;
701 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
703 (void)sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
706 prt(tmp_val, j + 1, wid - 9);
710 /* Make a "shadow" below the list (only if needed) */
711 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
713 /* Save the new column */
716 return target_item_label;
721 * @brief 選択したアイテムの確認処理の補助 /
722 * Verify the choice of an item.
723 * @param prompt メッセージ表示の一部
724 * @param item 選択アイテムID
725 * @return 確認がYesならTRUEを返す。
726 * @details The item can be negative to mean "item on floor".
728 static bool verify(concptr prompt, INVENTORY_IDX item)
730 GAME_TEXT o_name[MAX_NLEN];
731 char out_val[MAX_NLEN + 20];
738 o_ptr = &p_ptr->inventory_list[item];
744 o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item];
746 object_desc(o_name, o_ptr, 0);
749 (void)sprintf(out_val, _("%s%sですか? ", "%s %s? "), prompt, o_name);
752 return (get_check(out_val));
757 * @brief 選択したアイテムの確認処理のメインルーチン /
758 * @param item 選択アイテムID
759 * @return 確認がYesならTRUEを返す。
760 * @details The item can be negative to mean "item on floor".
761 * Hack -- allow user to "prevent" certain choices
763 static bool get_item_allow(INVENTORY_IDX item)
767 if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
772 o_ptr = &p_ptr->inventory_list[item];
778 o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item];
782 if (!o_ptr->inscription) return (TRUE);
785 s = my_strchr(quark_str(o_ptr->inscription), '!');
787 /* Process preventions */
790 /* Check the "restriction" */
791 if ((s[1] == command_cmd) || (s[1] == '*'))
793 /* Verify the choice */
794 if (!verify(_("本当に", "Really try"), item)) return (FALSE);
797 /* Find another '!' */
798 s = my_strchr(s + 1, '!');
807 * @brief オブジェクト選択の汎用関数 /
808 * Let the user select an item, save its "index"
809 * @param cp 選択したオブジェクトのIDを返す。
810 * @param pmt 選択目的のメッセージ
811 * @param str 選択できるオブジェクトがない場合のキャンセルメッセージ
812 * @param mode オプションフラグ
813 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
814 * Return TRUE only if an acceptable item was chosen by the user.\n
816 * The selected item must satisfy the "item_tester_hook()" function,\n
817 * if that hook is set, and the "item_tester_tval", if that value is set.\n
819 * All "item_tester" restrictions are cleared before this function returns.\n
821 * The user is allowed to choose acceptable items from the equipment,\n
822 * inventory, or floor, respectively, if the proper flag was given,\n
823 * and there are any acceptable items in that location.\n
825 * The equipment or inventory are displayed (even if no acceptable\n
826 * items are in that location) if the proper flag was given.\n
828 * If there are no acceptable items available anywhere, and "str" is\n
829 * not NULL, then it will be used as the text of a warning message\n
830 * before the function returns.\n
832 * Note that the user must press "-" to specify the item on the floor,\n
833 * and there is no way to "examine" the item on the floor, while the\n
834 * use of "capital" letters will "examine" an inventory/equipment item,\n
835 * and prompt for its use.\n
837 * If a legal item is selected from the inventory, we save it in "cp"\n
838 * directly (0 to 35), and return TRUE.\n
840 * If a legal item is selected from the floor, we save it in "cp" as\n
841 * a negative (-1 to -511), and return TRUE.\n
843 * If no item is available, we do nothing to "cp", and we display a\n
844 * warning message, using "str" if available, and return FALSE.\n
846 * If no item is selected, we do nothing to "cp", and return FALSE.\n
848 * Global "command_new" is used when viewing the inventory or equipment\n
849 * to allow the user to enter a command while viewing those screens, and\n
850 * also to induce "auto-enter" of stores, and other such stuff.\n
852 * Global "command_see" may be set before calling this function to start\n
853 * out in "browse" mode. It is cleared before this function returns.\n
855 * Global "command_wrk" is used to choose between equip/inven listings.\n
856 * If it is TRUE then we are viewing inventory, else equipment.\n
858 * We always erase the prompt when we are done, leaving a blank line,\n
859 * or a warning message, if appropriate, if no items are available.\n
861 bool get_item(player_type *owner_ptr, OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
863 OBJECT_IDX this_o_idx, next_o_idx = 0;
880 bool allow_floor = FALSE;
887 int menu_line = (use_menu ? 1 : 0);
891 static char prev_tag = '\0';
894 if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode, tval);
897 if (mode & USE_EQUIP) equip = TRUE;
898 if (mode & USE_INVEN) inven = TRUE;
899 if (mode & USE_FLOOR) floor = TRUE;
901 /* Get the item index */
905 if (mode & USE_FORCE && (*cp == INVEN_FORCE))
908 item_tester_hook = NULL;
909 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
914 else if (floor && (*cp < 0))
920 o_ptr = &owner_ptr->current_floor_ptr->o_list[k];
922 /* Validate the item */
923 if (item_tester_okay(o_ptr, tval) || (mode & USE_FULL))
925 /* Forget restrictions */
927 item_tester_hook = NULL;
928 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
935 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
936 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
938 if (prev_tag && command_cmd)
940 /* Look up the tag and validate the item */
941 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, tval)) /* Reject */;
942 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
943 else if (!get_item_okay(k)) /* Reject */;
946 /* Accept that choice */
949 /* Forget restrictions */
951 item_tester_hook = NULL;
952 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
958 prev_tag = '\0'; /* prev_tag is no longer effective */
961 /* Verify the item */
962 else if (get_item_okay(*cp))
964 /* Forget restrictions */
966 item_tester_hook = NULL;
967 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
979 /* No item selected */
988 for (j = 0; j < INVEN_PACK; j++)
989 if (item_tester_okay(&owner_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_inven++;
992 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
993 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
998 e2 = INVEN_TOTAL - 1;
1000 /* Forbid equipment */
1001 if (!equip) e2 = -1;
1004 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
1005 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&owner_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_equip++;
1006 if (owner_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
1009 /* Restrict equipment indexes */
1010 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
1011 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
1013 if (equip && owner_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT))
1015 if (owner_ptr->migite)
1017 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
1019 else if (owner_ptr->hidarite) e1 = INVEN_RARM;
1023 /* Restrict floor usage */
1026 /* Scan all objects in the grid */
1027 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)
1030 o_ptr = &owner_ptr->current_floor_ptr->o_list[this_o_idx];
1031 next_o_idx = o_ptr->next_o_idx;
1033 /* Accept the item on the floor if legal */
1034 if ((item_tester_okay(o_ptr, tval) || (mode & USE_FULL)) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
1038 /* Require at least one legal choice */
1039 if (!allow_floor && (i1 > i2) && (e1 > e2))
1041 command_see = FALSE;
1045 if (mode & USE_FORCE) {
1051 /* Analyze choices */
1054 if (command_see && command_wrk && equip)
1061 command_wrk = FALSE;
1071 command_wrk = FALSE;
1077 * 追加オプション(always_show_list)が設定されている場合は常に一覧を表示する
1079 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
1081 /* Hack -- start out in "display" mode */
1088 /* Repeat until done */
1091 COMMAND_CODE get_item_label = 0;
1098 for (j = 0; j < 8; j++)
1101 if (!angband_term[j]) continue;
1103 /* Count windows displaying inven */
1104 if (window_flag[j] & (PW_INVEN)) ni++;
1106 /* Count windows displaying equip */
1107 if (window_flag[j] & (PW_EQUIP)) ne++;
1110 if ((command_wrk && ni && !ne) || (!command_wrk && !ni && ne))
1112 toggle_inven_equip(owner_ptr);
1116 owner_ptr->window |= (PW_INVEN | PW_EQUIP);
1119 /* Inventory screen */
1122 /* Redraw if needed */
1123 if (command_see) get_item_label = show_inven(menu_line, mode, tval);
1126 /* Equipment screen */
1129 /* Redraw if needed */
1130 if (command_see) get_item_label = show_equip(menu_line, mode, tval);
1135 /* Begin the prompt */
1136 sprintf(out_val, _("持ち物:", "Inven:"));
1138 /* Some legal items */
1139 if ((i1 <= i2) && !use_menu)
1141 /* Build the prompt */
1142 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
1143 index_to_label(i1), index_to_label(i2));
1146 strcat(out_val, tmp_val);
1149 /* Indicate ability to "view" */
1150 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
1153 if (equip) strcat(out_val, format(_(" %s 装備品,", " %s for Equip,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "/")));
1156 /* Viewing equipment */
1159 /* Begin the prompt */
1160 sprintf(out_val, _("装備品:", "Equip:"));
1162 /* Some legal items */
1163 if ((e1 <= e2) && !use_menu)
1165 /* Build the prompt */
1166 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
1167 index_to_label(e1), index_to_label(e2));
1170 strcat(out_val, tmp_val);
1173 /* Indicate ability to "view" */
1174 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
1177 if (inven) strcat(out_val, format(_(" %s 持ち物,", " %s for Inven,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "'/'")));
1180 /* Indicate legality of the "floor" item */
1181 if (allow_floor) strcat(out_val, _(" '-'床上,", " - for floor,"));
1182 if (mode & USE_FORCE) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
1184 /* Finish the prompt */
1185 strcat(out_val, " ESC");
1187 /* Build the prompt */
1188 sprintf(tmp_val, "(%s) %s", out_val, pmt);
1190 /* Show the prompt */
1198 int max_line = (command_wrk ? max_equip : max_inven);
1214 menu_line += (max_line - 1);
1233 /* Verify legality */
1234 if (!inven || !equip)
1240 /* Hack -- Fix screen */
1247 /* Switch inven/equip */
1248 command_wrk = !command_wrk;
1249 max_line = (command_wrk ? max_equip : max_inven);
1250 if (menu_line > max_line) menu_line = max_line;
1252 /* Need to redraw */
1261 if (command_wrk == USE_FLOOR)
1264 (*cp) = -get_item_label;
1268 /* Validate the item */
1269 if (!get_item_okay(get_item_label))
1275 /* Allow player to "refuse" certain actions */
1276 if (!get_item_allow(get_item_label))
1282 /* Accept that choice */
1283 (*cp) = get_item_label;
1292 if (mode & USE_FORCE) {
1300 if (menu_line > max_line) menu_line -= max_line;
1321 command_see = FALSE;
1338 /* Verify legality */
1339 if (!inven || !equip)
1345 /* Hack -- Fix screen */
1352 /* Switch inven/equip */
1353 command_wrk = !command_wrk;
1355 /* Need to redraw */
1361 /* Use floor item */
1364 /* Scan all objects in the grid */
1365 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)
1368 o_ptr = &owner_ptr->current_floor_ptr->o_list[this_o_idx];
1369 next_o_idx = o_ptr->next_o_idx;
1371 /* Validate the item */
1372 if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
1377 /* Verify the item (if required) */
1378 if (other_query_flag && !verify(_("本当に", "Try"), k)) continue;
1380 /* Allow player to "refuse" certain actions */
1381 if (!get_item_allow(k)) continue;
1383 /* Accept that choice */
1399 case '1': case '2': case '3':
1400 case '4': case '5': case '6':
1401 case '7': case '8': case '9':
1403 /* Look up the tag */
1404 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, tval))
1410 /* Hack -- Validate the item */
1411 if ((k < INVEN_RARM) ? !inven : !equip)
1417 /* Validate the item */
1418 if (!get_item_okay(k))
1424 /* Allow player to "refuse" certain actions */
1425 if (!get_item_allow(k))
1431 /* Accept that choice */
1445 k = ((i1 == i2) ? i1 : -1);
1448 /* Choose "default" equipment item */
1451 k = ((e1 == e2) ? e1 : -1);
1454 /* Validate the item */
1455 if (!get_item_okay(k))
1461 /* Allow player to "refuse" certain actions */
1462 if (!get_item_allow(k))
1468 /* Accept that choice */
1478 if (mode & USE_FORCE) {
1491 bool not_found = FALSE;
1493 /* Look up the alphabetical tag */
1494 if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, tval))
1499 /* Hack -- Validate the item */
1500 else if ((k < INVEN_RARM) ? !inven : !equip)
1505 /* Validate the item */
1506 else if (!get_item_okay(k))
1513 /* Accept that choice */
1521 /* Extract "query" setting */
1522 ver = isupper(which);
1523 which = (char)tolower(which);
1527 if (which == '(') k = i1;
1528 else if (which == ')') k = i2;
1529 else k = label_to_inven(which);
1532 /* Convert letter to equipment index */
1535 if (which == '(') k = e1;
1536 else if (which == ')') k = e2;
1537 else k = label_to_equip(which);
1540 /* Validate the item */
1541 if (!get_item_okay(k))
1547 /* Verify the item */
1548 if (ver && !verify(_("本当に", "Try"), k))
1554 /* Allow player to "refuse" certain actions */
1555 if (!get_item_allow(k))
1561 /* Accept that choice */
1572 /* Fix the screen if necessary */
1577 /* Hack -- Cancel "display" */
1578 command_see = FALSE;
1582 /* Forget the tval restriction */
1585 /* Forget the item_tester_hook restriction */
1586 item_tester_hook = NULL;
1589 /* Clean up 'show choices' */
1590 if (toggle) toggle_inven_equip(owner_ptr);
1592 owner_ptr->window |= (PW_INVEN | PW_EQUIP);
1595 /* Clear the prompt line */
1598 /* Warning if needed */
1599 if (oops && str) msg_print(str);
1604 if (command_cmd) prev_tag = cur_tag;
1605 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1611 * Choose an item and get auto-picker entry from it.
1613 object_type *choose_object(player_type *creature_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval)
1616 if (!get_item(creature_ptr, &item, q, s, option, tval)) return NULL;
1617 if (idx) *idx = item;
1618 if (item == INVEN_FORCE) return NULL;
1619 return REF_ITEM(creature_ptr, creature_ptr->current_floor_ptr, item);
1624 * @brief 床下に落ちているオブジェクトの数を返す / scan_floor
1625 * @param items オブジェクトのIDリストを返すための配列参照ポインタ
1626 * @param y 走査するフロアのY座標
1627 * @param x 走査するフロアのX座標
1628 * @param mode オプションフラグ
1629 * @return 対象のマスに落ちているアイテム数
1631 * Return a list of o_list[] indexes of items at the given floor
1632 * location. Valid flags are:
1634 * mode & 0x01 -- Item tester
1635 * mode & 0x02 -- Marked items only
1636 * mode & 0x04 -- Stop after first
1638 ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode)
1640 OBJECT_IDX this_o_idx, next_o_idx;
1642 ITEM_NUMBER num = 0;
1645 if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return 0;
1647 /* Scan all objects in the grid */
1648 for (this_o_idx = p_ptr->current_floor_ptr->grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
1651 o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
1652 next_o_idx = o_ptr->next_o_idx;
1655 if ((mode & 0x01) && !item_tester_okay(o_ptr, item_tester_tval)) continue;
1658 if ((mode & 0x02) && !(o_ptr->marked & OM_FOUND)) continue;
1660 /* Accept this item */
1661 /* XXX Hack -- Enforce limit */
1663 items[num] = this_o_idx;
1668 if (mode & 0x04) break;
1675 * @brief 床下に落ちているアイテムの一覧を返す / Display a list of the items on the floor at the given location.
1676 * @param target_item カーソルの初期値
1677 * @param y 走査するフロアのY座標
1678 * @param x 走査するフロアのX座標
1679 * @param min_width 表示の長さ
1680 * @return 選択したアイテムの添え字
1683 COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_width)
1691 GAME_TEXT o_name[MAX_NLEN];
1694 COMMAND_CODE out_index[23];
1695 TERM_COLOR out_color[23];
1696 char out_desc[23][MAX_NLEN];
1697 COMMAND_CODE target_item_label = 0;
1699 OBJECT_IDX floor_list[23];
1700 ITEM_NUMBER floor_num;
1702 char floor_label[52 + 1];
1704 bool dont_need_to_show_weights = TRUE;
1706 Term_get_size(&wid, &hgt);
1708 /* Default length */
1709 len = MAX((*min_width), 20);
1711 /* Scan for objects in the grid, using item_tester_okay() */
1712 floor_num = scan_floor(floor_list, y, x, 0x03);
1714 /* Display the floor objects */
1715 for (k = 0, i = 0; i < floor_num && i < 23; i++)
1717 o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
1719 object_desc(o_name, o_ptr, 0);
1721 /* Save the index */
1724 out_color[k] = tval_to_attr[o_ptr->tval & 0x7F];
1726 /* Save the object description */
1727 strcpy(out_desc[k], o_name);
1729 /* Find the predicted "line length" */
1730 l = strlen(out_desc[k]) + 5;
1732 /* Be sure to account for the weight */
1733 if (show_weights) l += 9;
1735 if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
1737 /* Maintain the maximum length */
1738 if (l > len) len = l;
1740 /* Advance to next "line" */
1744 if (show_weights && dont_need_to_show_weights) len -= 9;
1749 /* Find the column to start in */
1750 col = (len > wid - 4) ? 0 : (wid - len - 1);
1752 prepare_label_string_floor(floor_label, floor_list, floor_num);
1754 /* Output each entry */
1755 for (j = 0; j < k; j++)
1757 m = floor_list[out_index[j]];
1758 o_ptr = &p_ptr->current_floor_ptr->o_list[m];
1760 /* Clear the line */
1761 prt("", j + 1, col ? col - 2 : col);
1763 if (use_menu && target_item)
1765 if (j == (target_item - 1))
1767 strcpy(tmp_val, _("》", "> "));
1768 target_item_label = m;
1770 else strcpy(tmp_val, " ");
1774 /* Prepare an index --(-- */
1775 sprintf(tmp_val, "%c)", floor_label[j]);
1778 /* Clear the line with the (possibly indented) index */
1779 put_str(tmp_val, j + 1, col);
1781 /* Display the entry itself */
1782 c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
1784 /* Display the weight if needed */
1785 if (show_weights && (o_ptr->tval != TV_GOLD))
1787 int wgt = o_ptr->weight * o_ptr->number;
1789 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
1791 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
1794 prt(tmp_val, j + 1, wid - 9);
1798 /* Make a "shadow" below the list (only if needed) */
1799 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
1801 return target_item_label;
1805 * @brief オブジェクト選択の汎用関数(床上アイテム用) /
1806 * Let the user select an item, save its "index"
1807 * @param cp 選択したオブジェクトのIDを返す。
1808 * @param pmt 選択目的のメッセージ
1809 * @param str 選択できるオブジェクトがない場合のキャンセルメッセージ
1810 * @param mode オプションフラグ
1811 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
1813 bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
1815 char n1 = ' ', n2 = ' ', which = ' ';
1818 COMMAND_CODE i1, i2;
1819 COMMAND_CODE e1, e2;
1827 bool equip = (mode & USE_EQUIP) ? TRUE : FALSE;
1828 bool inven = (mode & USE_INVEN) ? TRUE : FALSE;
1829 bool floor = (mode & USE_FLOOR) ? TRUE : FALSE;
1830 bool force = (mode & USE_FORCE) ? TRUE : FALSE;
1832 bool allow_equip = FALSE;
1833 bool allow_inven = FALSE;
1834 bool allow_floor = FALSE;
1836 bool toggle = FALSE;
1841 ITEM_NUMBER floor_num;
1842 OBJECT_IDX floor_list[23];
1844 TERM_LEN min_width = 0;
1846 int menu_line = (use_menu ? 1 : 0);
1850 static char prev_tag = '\0';
1851 char cur_tag = '\0';
1853 /* Get the item index */
1854 if (repeat_pull(cp))
1857 if (force && (*cp == INVEN_FORCE))
1860 item_tester_hook = NULL;
1861 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1866 else if (floor && (*cp < 0))
1868 if (prev_tag && command_cmd)
1870 /* Scan all objects in the grid */
1871 floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
1873 /* Look up the tag */
1874 if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
1876 /* Accept that choice */
1877 (*cp) = 0 - floor_list[k];
1879 /* Forget restrictions */
1881 item_tester_hook = NULL;
1882 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1888 prev_tag = '\0'; /* prev_tag is no longer effective */
1891 /* Validate the item */
1892 else if (item_tester_okay(&p_ptr->current_floor_ptr->o_list[0 - (*cp)], tval) || (mode & USE_FULL))
1894 /* Forget restrictions */
1896 item_tester_hook = NULL;
1897 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1904 else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
1905 (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
1907 if (prev_tag && command_cmd)
1909 /* Look up the tag and validate the item */
1910 if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, tval)) /* Reject */;
1911 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
1912 else if (!get_item_okay(k)) /* Reject */;
1915 /* Accept that choice */
1918 /* Forget restrictions */
1920 item_tester_hook = NULL;
1921 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1927 prev_tag = '\0'; /* prev_tag is no longer effective */
1930 /* Verify the item */
1931 else if (get_item_okay(*cp))
1933 /* Forget restrictions */
1935 item_tester_hook = NULL;
1936 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
1950 /* No item selected */
1954 i2 = INVEN_PACK - 1;
1956 if (!inven) i2 = -1;
1959 for (j = 0; j < INVEN_PACK; j++)
1960 if (item_tester_okay(&p_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_inven++;
1963 while ((i1 <= i2) && (!get_item_okay(i1))) i1++;
1964 while ((i1 <= i2) && (!get_item_okay(i2))) i2--;
1967 /* Full equipment */
1969 e2 = INVEN_TOTAL - 1;
1971 /* Forbid equipment */
1972 if (!equip) e2 = -1;
1975 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
1976 if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&p_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_equip++;
1977 if (p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
1980 /* Restrict equipment indexes */
1981 while ((e1 <= e2) && (!get_item_okay(e1))) e1++;
1982 while ((e1 <= e2) && (!get_item_okay(e2))) e2--;
1984 if (equip && p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT))
1988 if (e2 < INVEN_LARM) e2 = INVEN_LARM;
1990 else if (p_ptr->hidarite) e1 = INVEN_RARM;
1994 /* Count "okay" floor items */
1997 /* Restrict floor usage */
2000 /* Scan all objects in the grid */
2001 floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
2004 if (i1 <= i2) allow_inven = TRUE;
2006 /* Accept equipment */
2007 if (e1 <= e2) allow_equip = TRUE;
2010 if (floor_num) allow_floor = TRUE;
2012 /* Require at least one legal choice */
2013 if (!allow_inven && !allow_equip && !allow_floor)
2015 command_see = FALSE;
2025 /* Analyze choices */
2028 /* Hack -- Start on equipment if requested */
2029 if (command_see && (command_wrk == (USE_EQUIP))
2032 command_wrk = (USE_EQUIP);
2035 else if (allow_inven)
2037 command_wrk = (USE_INVEN);
2040 /* Use equipment if allowed */
2041 else if (allow_equip)
2043 command_wrk = (USE_EQUIP);
2046 /* Use floor if allowed */
2047 else if (allow_floor)
2049 command_wrk = (USE_FLOOR);
2054 * 追加オプション(always_show_list)が設定されている場合は常に一覧を表示する
2056 if ((always_show_list == TRUE) || use_menu) command_see = TRUE;
2058 /* Hack -- start out in "display" mode */
2064 /* Repeat until done */
2067 COMMAND_CODE get_item_label = 0;
2074 for (j = 0; j < 8; j++)
2077 if (!angband_term[j]) continue;
2079 /* Count windows displaying inven */
2080 if (window_flag[j] & (PW_INVEN)) ni++;
2082 /* Count windows displaying equip */
2083 if (window_flag[j] & (PW_EQUIP)) ne++;
2086 /* Toggle if needed */
2087 if ((command_wrk == (USE_EQUIP) && ni && !ne) ||
2088 (command_wrk == (USE_INVEN) && !ni && ne))
2090 toggle_inven_equip(p_ptr);
2094 p_ptr->window |= (PW_INVEN | PW_EQUIP);
2097 /* Inventory screen */
2098 if (command_wrk == (USE_INVEN))
2100 /* Extract the legal requests */
2104 /* Redraw if needed */
2105 if (command_see) get_item_label = show_inven(menu_line, mode, tval);
2108 /* Equipment screen */
2109 else if (command_wrk == (USE_EQUIP))
2111 /* Extract the legal requests */
2112 n1 = I2A(e1 - INVEN_RARM);
2113 n2 = I2A(e2 - INVEN_RARM);
2115 /* Redraw if needed */
2116 if (command_see) get_item_label = show_equip(menu_line, mode, tval);
2120 else if (command_wrk == (USE_FLOOR))
2123 k = MIN(floor_top + 23, floor_num) - 1;
2125 /* Extract the legal requests */
2126 n1 = I2A(j - floor_top);
2127 n2 = I2A(k - floor_top);
2129 /* Redraw if needed */
2130 if (command_see) get_item_label = show_floor(menu_line, p_ptr->y, p_ptr->x, &min_width);
2133 if (command_wrk == (USE_INVEN))
2135 /* Begin the prompt */
2136 sprintf(out_val, _("持ち物:", "Inven:"));
2140 /* Build the prompt */
2141 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
2142 index_to_label(i1), index_to_label(i2));
2145 strcat(out_val, tmp_val);
2148 /* Indicate ability to "view" */
2149 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
2155 strcat(out_val, _(" '/' 装備品,", " / for Equip,"));
2156 else if (allow_floor)
2157 strcat(out_val, _(" '6' 装備品,", " 6 for Equip,"));
2159 strcat(out_val, _(" '4'or'6' 装備品,", " 4 or 6 for Equip,"));
2166 strcat(out_val, _(" '-'床上,", " - for floor,"));
2167 else if (allow_equip)
2168 strcat(out_val, _(" '4' 床上,", " 4 for floor,"));
2170 strcat(out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
2174 /* Viewing equipment */
2175 else if (command_wrk == (USE_EQUIP))
2177 /* Begin the prompt */
2178 sprintf(out_val, _("装備品:", "Equip:"));
2182 /* Build the prompt */
2183 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"),
2184 index_to_label(e1), index_to_label(e2));
2187 strcat(out_val, tmp_val);
2190 /* Indicate ability to "view" */
2191 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
2197 strcat(out_val, _(" '/' 持ち物,", " / for Inven,"));
2198 else if (allow_floor)
2199 strcat(out_val, _(" '4' 持ち物,", " 4 for Inven,"));
2201 strcat(out_val, _(" '4'or'6' 持ち物,", " 4 or 6 for Inven,"));
2208 strcat(out_val, _(" '-'床上,", " - for floor,"));
2209 else if (allow_inven)
2210 strcat(out_val, _(" '6' 床上,", " 6 for floor,"));
2212 strcat(out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
2217 else if (command_wrk == (USE_FLOOR))
2219 /* Begin the prompt */
2220 sprintf(out_val, _("床上:", "Floor:"));
2224 /* Build the prompt */
2225 sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), n1, n2);
2228 strcat(out_val, tmp_val);
2231 /* Indicate ability to "view" */
2232 if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
2236 if (allow_inven && allow_equip)
2238 strcat(out_val, _(" '4' 装備品, '6' 持ち物,", " 4 for Equip, 6 for Inven,"));
2240 else if (allow_inven)
2242 strcat(out_val, _(" '4'or'6' 持ち物,", " 4 or 6 for Inven,"));
2244 else if (allow_equip)
2246 strcat(out_val, _(" '4'or'6' 装備品,", " 4 or 6 for Equip,"));
2250 else if (allow_inven)
2252 strcat(out_val, _(" '/' 持ち物,", " / for Inven,"));
2254 else if (allow_equip)
2256 strcat(out_val, _(" '/'装備品,", " / for Equip,"));
2260 if (command_see && !use_menu)
2262 strcat(out_val, _(" Enter 次,", " Enter for scroll down,"));
2267 if (force) strcat(out_val, _(" 'w'練気術,", " w for the Force,"));
2269 /* Finish the prompt */
2270 strcat(out_val, " ESC");
2272 /* Build the prompt */
2273 sprintf(tmp_val, "(%s) %s", out_val, pmt);
2275 /* Show the prompt */
2284 if (command_wrk == USE_INVEN) max_line = max_inven;
2285 else if (command_wrk == USE_EQUIP) max_line = max_equip;
2286 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
2302 menu_line += (max_line - 1);
2318 /* Verify legality */
2319 if (command_wrk == (USE_INVEN))
2321 if (allow_floor) command_wrk = USE_FLOOR;
2322 else if (allow_equip) command_wrk = USE_EQUIP;
2329 else if (command_wrk == (USE_EQUIP))
2331 if (allow_inven) command_wrk = USE_INVEN;
2332 else if (allow_floor) command_wrk = USE_FLOOR;
2339 else if (command_wrk == (USE_FLOOR))
2341 if (allow_equip) command_wrk = USE_EQUIP;
2342 else if (allow_inven) command_wrk = USE_INVEN;
2355 /* Hack -- Fix screen */
2362 /* Switch inven/equip */
2363 if (command_wrk == USE_INVEN) max_line = max_inven;
2364 else if (command_wrk == USE_EQUIP) max_line = max_equip;
2365 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
2366 if (menu_line > max_line) menu_line = max_line;
2368 /* Need to redraw */
2376 /* Verify legality */
2377 if (command_wrk == (USE_INVEN))
2379 if (allow_equip) command_wrk = USE_EQUIP;
2380 else if (allow_floor) command_wrk = USE_FLOOR;
2387 else if (command_wrk == (USE_EQUIP))
2389 if (allow_floor) command_wrk = USE_FLOOR;
2390 else if (allow_inven) command_wrk = USE_INVEN;
2397 else if (command_wrk == (USE_FLOOR))
2399 if (allow_inven) command_wrk = USE_INVEN;
2400 else if (allow_equip) command_wrk = USE_EQUIP;
2413 /* Hack -- Fix screen */
2420 /* Switch inven/equip */
2421 if (command_wrk == USE_INVEN) max_line = max_inven;
2422 else if (command_wrk == USE_EQUIP) max_line = max_equip;
2423 else if (command_wrk == USE_FLOOR) max_line = MIN(23, floor_num);
2424 if (menu_line > max_line) menu_line = max_line;
2426 /* Need to redraw */
2435 if (command_wrk == USE_FLOOR)
2438 (*cp) = -get_item_label;
2442 /* Validate the item */
2443 if (!get_item_okay(get_item_label))
2449 /* Allow player to "refuse" certain actions */
2450 if (!get_item_allow(get_item_label))
2456 /* Accept that choice */
2457 (*cp) = get_item_label;
2474 if (menu_line > max_line) menu_line -= max_line;
2495 command_see = FALSE;
2516 grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
2518 if (command_wrk != (USE_FLOOR)) break;
2520 /* Get the object being moved. */
2521 o_idx = g_ptr->o_idx;
2523 /* Only rotate a pile of two or more objects. */
2524 if (!(o_idx && p_ptr->current_floor_ptr->o_list[o_idx].next_o_idx)) break;
2526 /* Remove the first object from the list. */
2527 excise_object_idx(o_idx);
2529 /* Find end of the list. */
2531 while (p_ptr->current_floor_ptr->o_list[i].next_o_idx)
2532 i = p_ptr->current_floor_ptr->o_list[i].next_o_idx;
2534 /* Add after the last object. */
2535 p_ptr->current_floor_ptr->o_list[i].next_o_idx = o_idx;
2537 /* Re-scan floor list */
2538 floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
2540 /* Hack -- Fix screen */
2552 if (command_wrk == (USE_INVEN))
2559 command_wrk = (USE_EQUIP);
2561 else if (command_wrk == (USE_EQUIP))
2568 command_wrk = (USE_INVEN);
2570 else if (command_wrk == (USE_FLOOR))
2574 command_wrk = (USE_INVEN);
2576 else if (allow_equip)
2578 command_wrk = (USE_EQUIP);
2587 /* Hack -- Fix screen */
2594 /* Need to redraw */
2607 * If we are already examining the floor, and there
2608 * is only one item, we will always select it.
2609 * If we aren't examining the floor and there is only
2610 * one item, we will select it if floor_query_flag
2615 if ((command_wrk == (USE_FLOOR)) || (!carry_query_flag))
2618 k = 0 - floor_list[0];
2620 /* Allow player to "refuse" certain actions */
2621 if (!get_item_allow(k))
2627 /* Accept that choice */
2636 /* Hack -- Fix screen */
2643 command_wrk = (USE_FLOOR);
2649 case '1': case '2': case '3':
2650 case '4': case '5': case '6':
2651 case '7': case '8': case '9':
2653 if (command_wrk != USE_FLOOR)
2655 /* Look up the tag */
2656 if (!get_tag(&k, which, command_wrk, tval))
2662 /* Hack -- Validate the item */
2663 if ((k < INVEN_RARM) ? !inven : !equip)
2669 /* Validate the item */
2670 if (!get_item_okay(k))
2678 /* Look up the alphabetical tag */
2679 if (get_tag_floor(&k, which, floor_list, floor_num))
2682 k = 0 - floor_list[k];
2691 /* Allow player to "refuse" certain actions */
2692 if (!get_item_allow(k))
2698 /* Accept that choice */
2710 if (command_wrk == (USE_INVEN))
2712 k = ((i1 == i2) ? i1 : -1);
2715 /* Choose "default" equipment item */
2716 else if (command_wrk == (USE_EQUIP))
2718 k = ((e1 == e2) ? e1 : -1);
2721 /* Choose "default" floor item */
2722 else if (command_wrk == (USE_FLOOR))
2727 k = 0 - floor_list[0];
2729 /* Allow player to "refuse" certain actions */
2730 if (!get_item_allow(k))
2736 /* Accept that choice */
2744 /* Validate the item */
2745 if (!get_item_okay(k))
2751 /* Allow player to "refuse" certain actions */
2752 if (!get_item_allow(k))
2758 /* Accept that choice */
2782 if (command_wrk != USE_FLOOR)
2784 bool not_found = FALSE;
2786 /* Look up the alphabetical tag */
2787 if (!get_tag(&k, which, command_wrk, tval))
2792 /* Hack -- Validate the item */
2793 else if ((k < INVEN_RARM) ? !inven : !equip)
2798 /* Validate the item */
2799 else if (!get_item_okay(k))
2806 /* Accept that choice */
2816 /* Look up the alphabetical tag */
2817 if (get_tag_floor(&k, which, floor_list, floor_num))
2820 k = 0 - floor_list[k];
2822 /* Accept that choice */
2831 /* Extract "query" setting */
2832 ver = isupper(which);
2833 which = (char)tolower(which);
2835 if (command_wrk == (USE_INVEN))
2837 if (which == '(') k = i1;
2838 else if (which == ')') k = i2;
2839 else k = label_to_inven(which);
2842 /* Convert letter to equipment index */
2843 else if (command_wrk == (USE_EQUIP))
2845 if (which == '(') k = e1;
2846 else if (which == ')') k = e2;
2847 else k = label_to_equip(which);
2850 /* Convert letter to floor index */
2851 else if (command_wrk == USE_FLOOR)
2853 if (which == '(') k = 0;
2854 else if (which == ')') k = floor_num - 1;
2855 else k = islower(which) ? A2I(which) : -1;
2856 if (k < 0 || k >= floor_num || k >= 23)
2863 k = 0 - floor_list[k];
2866 /* Validate the item */
2867 if ((command_wrk != USE_FLOOR) && !get_item_okay(k))
2873 /* Verify the item */
2874 if (ver && !verify(_("本当に", "Try"), k))
2880 /* Allow player to "refuse" certain actions */
2881 if (!get_item_allow(k))
2887 /* Accept that choice */
2897 /* Fix the screen if necessary */
2902 /* Hack -- Cancel "display" */
2903 command_see = FALSE;
2907 /* Forget the tval restriction */
2910 /* Forget the item_tester_hook restriction */
2911 item_tester_hook = NULL;
2914 /* Clean up 'show choices' */
2915 if (toggle) toggle_inven_equip(p_ptr);
2917 p_ptr->window |= (PW_INVEN | PW_EQUIP);
2920 /* Clear the prompt line */
2923 /* Warning if needed */
2924 if (oops && str) msg_print(str);
2929 if (command_cmd) prev_tag = cur_tag;
2930 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
2936 * @brief 床上のアイテムを拾う選択用サブルーチン
2937 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。
2939 static bool py_pickup_floor_aux(void)
2941 OBJECT_IDX this_o_idx;
2945 /* Restrict the choices */
2946 item_tester_hook = inven_carry_okay;
2949 q = _("どれを拾いますか?", "Get which item? ");
2950 s = _("もうザックには床にあるどのアイテムも入らない。", "You no longer have any room for the objects on the floor.");
2952 if (choose_object(p_ptr, &item, q, s, (USE_FLOOR), 0))
2954 this_o_idx = 0 - item;
2961 /* Pick up the object */
2962 py_pickup_aux(this_o_idx);
2968 * @brief 床上のアイテムを拾うメイン処理
2969 * @param pickup FALSEなら金銭の自動拾いのみを行う/ FALSE then only gold will be picked up
2972 * This is called by py_pickup() when easy_floor is TRUE.
2974 void py_pickup_floor(player_type *creature_ptr, bool pickup)
2976 OBJECT_IDX this_o_idx, next_o_idx = 0;
2978 GAME_TEXT o_name[MAX_NLEN];
2982 OBJECT_IDX floor_o_idx = 0;
2986 /* Scan the pile of objects */
2987 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)
2989 /* Access the object */
2990 o_ptr = &creature_ptr->current_floor_ptr->o_list[this_o_idx];
2992 object_desc(o_name, o_ptr, 0);
2994 /* Access the next object */
2995 next_o_idx = o_ptr->next_o_idx;
2997 disturb(creature_ptr, FALSE, FALSE);
3000 if (o_ptr->tval == TV_GOLD)
3003 msg_format(" $%ld の価値がある%sを見つけた。",
3004 (long)o_ptr->pval, o_name);
3006 msg_format("You have found %ld gold pieces worth of %s.",
3007 (long)o_ptr->pval, o_name);
3010 /* Collect the gold */
3011 creature_ptr->au += o_ptr->pval;
3014 creature_ptr->redraw |= (PR_GOLD);
3016 creature_ptr->window |= (PW_PLAYER);
3018 /* Delete the gold */
3019 delete_object_idx(this_o_idx);
3021 /* Check the next object */
3024 else if (o_ptr->marked & OM_NOMSG)
3026 /* If 0 or 1 non-NOMSG items are in the pile, the NOMSG ones are
3027 * ignored. Otherwise, they are included in the prompt. */
3028 o_ptr->marked &= ~(OM_NOMSG);
3032 /* Count non-gold objects that can be picked up. */
3033 if (inven_carry_okay(o_ptr))
3038 /* Count non-gold objects */
3041 /* Remember this index */
3042 floor_o_idx = this_o_idx;
3045 /* There are no non-gold objects */
3049 /* Mention the number of objects */
3055 /* Access the object */
3056 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3058 #ifdef ALLOW_EASY_SENSE
3060 /* Option: Make object sensing easy */
3063 /* Sense the object */
3064 (void)sense_object(o_ptr);
3067 #endif /* ALLOW_EASY_SENSE */
3069 object_desc(o_name, o_ptr, 0);
3071 msg_format(_("%sがある。", "You see %s."), o_name);
3074 /* Multiple objects */
3077 msg_format(_("%d 個のアイテムの山がある。", "You see a pile of %d items."), floor_num);
3083 /* The player has no room for anything on the floor. */
3089 /* Access the object */
3090 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3092 #ifdef ALLOW_EASY_SENSE
3094 /* Option: Make object sensing easy */
3097 /* Sense the object */
3098 (void)sense_object(o_ptr);
3101 #endif /* ALLOW_EASY_SENSE */
3103 object_desc(o_name, o_ptr, 0);
3105 msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name);
3108 /* Multiple objects */
3111 msg_print(_("ザックには床にあるどのアイテムも入らない。", "You have no room for any of the objects on the floor."));
3121 /* Hack -- query every object */
3122 if (carry_query_flag)
3124 char out_val[MAX_NLEN + 20];
3126 /* Access the object */
3127 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3129 #ifdef ALLOW_EASY_SENSE
3131 /* Option: Make object sensing easy */
3134 /* Sense the object */
3135 (void)sense_object(o_ptr);
3138 #endif /* ALLOW_EASY_SENSE */
3140 object_desc(o_name, o_ptr, 0);
3142 (void)sprintf(out_val, _("%sを拾いますか? ", "Pick up %s? "), o_name);
3144 /* Ask the user to confirm */
3145 if (!get_check(out_val))
3151 /* Access the object */
3152 o_ptr = &creature_ptr->current_floor_ptr->o_list[floor_o_idx];
3154 #ifdef ALLOW_EASY_SENSE
3156 /* Option: Make object sensing easy */
3159 /* Sense the object */
3160 (void)sense_object(o_ptr);
3163 #endif /* ALLOW_EASY_SENSE */
3165 /* Pick up the object */
3166 py_pickup_aux(floor_o_idx);
3169 /* Allow the user to choose an object */
3172 while (can_pickup--)
3174 if (!py_pickup_floor_aux()) break;
3182 * @brief 所持アイテム一覧を表示する /
3183 * Choice window "shadow" of the "show_inven()" function
3186 void display_inven(player_type *creature_ptr, OBJECT_TYPE_VALUE tval)
3188 register int i, n, z = 0;
3190 TERM_COLOR attr = TERM_WHITE;
3192 GAME_TEXT o_name[MAX_NLEN];
3195 if (!creature_ptr || !creature_ptr->inventory_list) return;
3197 Term_get_size(&wid, &hgt);
3199 for (i = 0; i < INVEN_PACK; i++)
3201 o_ptr = &creature_ptr->inventory_list[i];
3202 if (!o_ptr->k_idx) continue;
3206 for (i = 0; i < z; i++)
3208 o_ptr = &creature_ptr->inventory_list[i];
3209 tmp_val[0] = tmp_val[1] = tmp_val[2] = ' ';
3210 if (item_tester_okay(o_ptr, tval))
3212 tmp_val[0] = index_to_label(i);
3216 Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
3217 object_desc(o_name, o_ptr, 0);
3219 attr = tval_to_attr[o_ptr->tval % 128];
3225 Term_putstr(3, i, n, attr, o_name);
3226 Term_erase(3 + n, i, 255);
3230 int wgt = o_ptr->weight * o_ptr->number;
3232 sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
3234 sprintf(tmp_val, "%3d.%1d lb", wgt / 10, wgt % 10);
3236 prt(tmp_val, i, wid - 9);
3240 for (i = z; i < hgt; i++)
3242 Term_erase(0, i, 255);
3248 * @brief 装備アイテムの表示を行う /
3249 * Display the equipment.
3250 * @param target_item アイテムの選択処理を行うか否か。
3251 * @return 選択したアイテムのタグ
3253 COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
3257 int col, cur_col, len;
3260 GAME_TEXT o_name[MAX_NLEN];
3261 COMMAND_CODE out_index[23];
3262 TERM_COLOR out_color[23];
3263 char out_desc[23][MAX_NLEN];
3264 COMMAND_CODE target_item_label = 0;
3266 char equip_label[52 + 1];
3268 /* Starting column */
3271 Term_get_size(&wid, &hgt);
3273 /* Maximal length */
3274 len = wid - col - 1;
3277 /* Scan the equipment list */
3278 for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3280 o_ptr = &p_ptr->inventory_list[i];
3282 /* Is this item acceptable? */
3283 if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, tval) || (mode & USE_FULL)) &&
3284 (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
3285 (mode & IGNORE_BOTHHAND_SLOT))) continue;
3287 object_desc(o_name, o_ptr, 0);
3289 if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
3291 (void)strcpy(out_desc[k], _("(武器を両手持ち)", "(wielding with two-hands)"));
3292 out_color[k] = TERM_WHITE;
3296 (void)strcpy(out_desc[k], o_name);
3297 out_color[k] = tval_to_attr[o_ptr->tval % 128];
3301 /* Grey out charging items */
3304 out_color[k] = TERM_L_DARK;
3307 /* Extract the maximal length (see below) */
3309 l = strlen(out_desc[k]) + (2 + 1);
3311 l = strlen(out_desc[k]) + (2 + 3);
3315 /* Increase length for labels (if needed) */
3317 if (show_labels) l += (7 + 2);
3319 if (show_labels) l += (14 + 2);
3323 /* Increase length for weight (if needed) */
3324 if (show_weights) l += 9;
3326 if (show_item_graph) l += 2;
3328 /* Maintain the max-length */
3329 if (l > len) len = l;
3331 /* Advance the entry */
3335 /* Hack -- Find a column to start in */
3337 col = (len > wid - 6) ? 0 : (wid - len - 1);
3339 col = (len > wid - 4) ? 0 : (wid - len - 1);
3342 prepare_label_string(equip_label, USE_EQUIP, tval);
3344 /* Output each entry */
3345 for (j = 0; j < k; j++)
3348 o_ptr = &p_ptr->inventory_list[i];
3350 /* Clear the line */
3351 prt("", j + 1, col ? col - 2 : col);
3353 if (use_menu && target_item)
3355 if (j == (target_item - 1))
3357 strcpy(tmp_val, _("》", "> "));
3358 target_item_label = i;
3360 else strcpy(tmp_val, " ");
3362 else if (i >= INVEN_RARM)
3364 /* Prepare an index --(-- */
3365 sprintf(tmp_val, "%c)", equip_label[i - INVEN_RARM]);
3369 /* Prepare an index --(-- */
3370 sprintf(tmp_val, "%c)", index_to_label(i));
3373 /* Clear the line with the (possibly indented) index */
3374 put_str(tmp_val, j + 1, col);
3378 /* Display graphics for object, if desired */
3379 if (show_item_graph)
3381 TERM_COLOR a = object_attr(o_ptr);
3382 SYMBOL_CODE c = object_char(o_ptr);
3383 Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
3384 if (use_bigtile) cur_col++;
3392 /* Mention the use */
3393 (void)sprintf(tmp_val, _("%-7s: ", "%-14s: "), mention_use(p_ptr, i));
3395 put_str(tmp_val, j + 1, cur_col);
3397 /* Display the entry itself */
3398 c_put_str(out_color[j], out_desc[j], j + 1, _(cur_col + 9, cur_col + 16));
3404 /* Display the entry itself */
3405 c_put_str(out_color[j], out_desc[j], j + 1, cur_col);
3408 /* Display the weight if needed */
3411 int wgt = o_ptr->weight * o_ptr->number;
3413 (void)sprintf(tmp_val, "%3d.%1d kg", lbtokg1(wgt), lbtokg2(wgt));
3415 (void)sprintf(tmp_val, "%3d.%d lb", wgt / 10, wgt % 10);
3418 prt(tmp_val, j + 1, wid - 9);
3422 /* Make a "shadow" below the list (only if needed) */
3423 if (j && (j < 23)) prt("", j + 1, col ? col - 2 : col);
3425 /* Save the new column */
3428 return target_item_label;
3433 * @brief 所持/装備オブジェクトIDの現在の扱い方の状態表現を返す /
3434 * Return a string describing how a given item is being worn.
3435 * @param i 状態表現を求めるプレイヤーの所持/装備オブジェクトID
3436 * @return 状態表現内容の文字列ポインタ
3438 * Currently, only used for items in the equipment, inventory.
3440 concptr describe_use(int i)
3447 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "運搬中の" : ((p_ptr->ryoute && p_ptr->migite) ? "両手に装備している" : (left_hander ? "左手に装備している" : "右手に装備している")); break;
3449 case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "just lifting" : (p_ptr->migite ? "attacking monsters with" : "wearing on your arm"); break;
3453 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "運搬中の" : ((p_ptr->ryoute && p_ptr->hidarite) ? "両手に装備している" : (left_hander ? "右手に装備している" : "左手に装備している")); break;
3455 case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "just lifting" : (p_ptr->hidarite ? "attacking monsters with" : "wearing on your arm"); break;
3458 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;
3459 case INVEN_RIGHT: p = (left_hander ? _("左手の指にはめている", "wearing on your left hand") : _("右手の指にはめている", "wearing on your right hand")); break;
3460 case INVEN_LEFT: p = (left_hander ? _("右手の指にはめている", "wearing on your right hand") : _("左手の指にはめている", "wearing on your left hand")); break;
3461 case INVEN_NECK: p = _("首にかけている", "wearing around your neck"); break;
3462 case INVEN_LITE: p = _("光源にしている", "using to light the way"); break;
3463 case INVEN_BODY: p = _("体に着ている", "wearing on your body"); break;
3464 case INVEN_OUTER: p = _("身にまとっている", "wearing on your back"); break;
3465 case INVEN_HEAD: p = _("頭にかぶっている", "wearing on your head"); break;
3466 case INVEN_HANDS: p = _("手につけている", "wearing on your hands"); break;
3467 case INVEN_FEET: p = _("足にはいている", "wearing on your feet"); break;
3468 default: p = _("ザックに入っている", "carrying in your pack"); break;
3471 /* Return the result */