3 * @brief オブジェクトの記述処理 / Mbject flavor code
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
16 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
18 * @return 簡易名称を明らかにするならTRUEを返す。
20 * This function is used only by "flavor_init()"
22 static bool object_easy_know(int i)
24 object_kind *k_ptr = &k_info[i];
26 /* Analyze the "tval" */
41 case TV_HISSATSU_BOOK:
58 /* All Food, Potions, Scrolls, Rods */
73 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
74 * @param out_string 作成した名を保管する参照ポインタ
76 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
77 * syllables 配列と elvish.txt を組み合わせる。\n
79 void get_table_name_aux(char *out_string)
83 get_rnd_line("aname_j.txt", 1, Syllable);
84 strcpy(out_string, Syllable);
85 get_rnd_line("aname_j.txt", 2, Syllable);
86 strcat(out_string, Syllable);
88 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
90 static cptr syllables[MAX_SYLLABLES] = {
91 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
92 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
93 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
94 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
95 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
96 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
97 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
98 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
99 "kho", "kli", "klis", "la", "lech", "man", "mar",
100 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
101 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
102 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
103 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
104 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
105 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
106 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
107 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
108 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
109 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
110 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
114 int testcounter = randint1(3) + 1;
116 strcpy(out_string, "");
118 if (randint1(3) == 2)
120 while (testcounter--)
121 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
126 testcounter = randint1(2) + 1;
127 while (testcounter--)
129 (void)get_rnd_line("elvish.txt", 0, Syllable);
130 strcat(out_string, Syllable);
134 out_string[0] = toupper(out_string[1]);
136 out_string[16] = '\0';
141 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
142 * @param out_string 作成した名を保管する参照ポインタ
144 * @details get_table_name_aux()ほぼ完全に実装を依存している。
146 void get_table_name(char *out_string)
149 get_table_name_aux(buff);
150 sprintf(out_string, _("『%s』", "'%s'"), buff);
154 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
155 * @param out_string 作成した名を保管する参照ポインタ
157 * @details sname.txtが語幹の辞書となっている。
159 void get_table_sindarin_aux(char *out_string)
166 get_rnd_line("sname.txt", 1, Syllable);
168 strcpy(tmp, Syllable);
170 strcpy(out_string, Syllable);
173 get_rnd_line("sname.txt", 2, Syllable);
175 strcat(tmp, Syllable);
176 sindarin_to_kana(out_string, tmp);
178 strcat(out_string, Syllable);
183 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
184 * @param out_string 作成した名を保管する参照ポインタ
186 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
188 void get_table_sindarin(char *out_string)
191 get_table_sindarin_aux(buff);
192 sprintf(out_string, _("『%s』", "'%s'"), buff);
197 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
198 * @param tval シャッフルしたいtval
200 * @details 巻物、各種魔道具などに利用される。
202 static void shuffle_flavors(byte tval)
205 IDX k_idx_list_num = 0;
208 /* Allocate an array for a list of k_idx */
209 C_MAKE(k_idx_list, max_k_idx, s16b);
211 /* Search objects with given tval for shuffle */
212 for (i = 0; i < max_k_idx; i++)
214 object_kind *k_ptr = &k_info[i];
217 if (k_ptr->tval != tval) continue;
219 /* Paranoia -- Skip objects without flavor */
220 if (!k_ptr->flavor) continue;
222 /* Skip objects with a fixed flavor name */
223 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
226 k_idx_list[k_idx_list_num] = i;
228 /* Increase number of remembered indices */
232 /* Shuffle flavors */
233 for (i = 0; i < k_idx_list_num; i++)
235 object_kind *k1_ptr = &k_info[k_idx_list[i]];
236 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
238 /* Swap flavors of this pair */
239 s16b tmp = k1_ptr->flavor;
240 k1_ptr->flavor = k2_ptr->flavor;
241 k2_ptr->flavor = tmp;
244 /* Free an array for a list of k_idx */
245 C_KILL(k_idx_list, max_k_idx, s16b);
249 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
252 * Prepare the "variable" part of the "k_info" array.\n
254 * The "color"/"metal"/"type" of an item is its "flavor".\n
255 * For the most part, flavors are assigned randomly each game.\n
257 * Initialize descriptions for the "colored" objects, including:\n
258 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
260 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
261 * Slime Mold Juice, Unused Potion).\n
263 * Scroll titles are always between 6 and 14 letters long. This is\n
264 * ensured because every title is composed of whole words, where every\n
265 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
266 * letters each), and that no scroll is finished until it attempts to\n
267 * grow beyond 15 letters. The first time this can happen is when the\n
268 * current title has 6 letters and the new word has 8 letters, which\n
269 * would result in a 6 letter scroll title.\n
271 * Duplicate titles are avoided by requiring that no two scrolls share\n
272 * the same first four letters (not the most efficient method, and not\n
273 * the least efficient method, but it will always work).\n
275 * Hack -- make sure everything stays the same for each saved game\n
276 * This is accomplished by the use of a saved "random seed", as in\n
277 * "town_gen()". Since no other functions are called while the special\n
278 * seed is in effect, so this function is pretty "safe".\n
280 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
282 void flavor_init(void)
285 u32b state_backup[4];
287 /* Hack -- Backup the RNG state */
288 Rand_state_backup(state_backup);
290 /* Hack -- Induce consistant flavors */
291 Rand_state_set(seed_flavor);
294 /* Initialize flavor index of each object by itself */
295 for (i = 0; i < max_k_idx; i++)
297 object_kind *k_ptr = &k_info[i];
299 /* Skip objects without flavor name */
300 if (!k_ptr->flavor_name) continue;
303 * Initialize flavor index to itself
304 * -> Shuffle it later
310 shuffle_flavors(TV_RING);
312 /* Shuffle Amulets */
313 shuffle_flavors(TV_AMULET);
316 shuffle_flavors(TV_STAFF);
319 shuffle_flavors(TV_WAND);
322 shuffle_flavors(TV_ROD);
324 /* Shuffle Mushrooms */
325 shuffle_flavors(TV_FOOD);
327 /* Shuffle Potions */
328 shuffle_flavors(TV_POTION);
330 /* Shuffle Scrolls */
331 shuffle_flavors(TV_SCROLL);
334 /* Hack -- Restore the RNG state */
335 Rand_state_restore(state_backup);
337 /* Analyze every object */
338 for (i = 1; i < max_k_idx; i++)
340 object_kind *k_ptr = &k_info[i];
342 /* Skip "empty" objects */
343 if (!k_ptr->name) continue;
345 /* No flavor yields aware */
346 if (!k_ptr->flavor) k_ptr->aware = TRUE;
348 /* Check for "easily known" */
349 k_ptr->easy_know = object_easy_know(i);
355 * @brief 対象文字配列に一文字だけをコピーする。
356 * @param t 保管先文字列ポインタ
360 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
361 * and return a pointer to the terminator (t + 1).\n
363 static char *object_desc_chr(char *t, char c)
376 * @brief 対象文字配列に文字列をコピーする。
377 * @param t 保管先文字列ポインタ
378 * @param s コピーしたい文字列ポインタ
381 * Print a string "s" into a string "t", as if by strcpy(t, s),
382 * and return a pointer to the terminator.
384 static char *object_desc_str(char *t, cptr s)
386 /* Copy the string */
387 while (*s) *t++ = *s++;
397 * @brief 対象文字配列に符号なし整数値をコピーする。
398 * @param t 保管先文字列ポインタ
402 * Print an unsigned number "n" into a string "t", as if by
403 * sprintf(t, "%u", n), and return a pointer to the terminator.
405 static char *object_desc_num(char *t, uint n)
409 /* Find "size" of "n" */
410 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
412 /* Dump each digit */
418 /* Remove the digit */
421 /* Process next digit */
437 * @brief 日本語の個数表示ルーチン
438 * @param t 保管先文字列ポインタ
439 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
442 * cmd1.c で流用するために object_desc_japanese から移動した。
444 char *object_desc_kosuu(char *t, object_type *o_ptr)
446 t = object_desc_num(t, o_ptr->number);
458 t = object_desc_str(t, "本");
463 t = object_desc_str(t, "巻");
468 t = object_desc_str(t, "服");
472 case TV_SORCERY_BOOK:
480 case TV_CRUSADE_BOOK:
482 case TV_HISSATSU_BOOK:
485 t = object_desc_str(t, "冊");
493 t = object_desc_str(t, "着");
500 t = object_desc_str(t, "振");
505 t = object_desc_str(t, "足");
510 t = object_desc_str(t, "枚");
516 if(o_ptr->sval == SV_FOOD_JERKY)
518 t = object_desc_str(t, "切れ");
524 if (o_ptr->number < 10)
526 t = object_desc_str(t, "つ");
530 t = object_desc_str(t, "個");
540 * @brief 対象文字配列に符号あり整数値をコピーする。
541 * @param t 保管先文字列ポインタ
545 * Print an signed number "v" into a string "t", as if by
546 * sprintf(t, "%+d", n), and return a pointer to the terminator.
547 * Note that we always print a sign, either "+" or "-".
549 static char *object_desc_int(char *t, sint v)
556 /* Take the absolute value */
559 /* Use a "minus" sign */
563 /* Positive (or zero) */
566 /* Use the actual number */
569 /* Use a "plus" sign */
573 /* Find "size" of "n" */
574 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
576 /* Dump each digit */
582 /* Remove the digit */
585 /* Process next digit */
598 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
600 typedef struct flag_insc_table
611 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
612 static flag_insc_table flag_insc_plus[] =
614 { "攻", "At", TR_BLOWS, -1 },
615 { "速", "Sp", TR_SPEED, -1 },
616 { "腕", "St", TR_STR, -1 },
617 { "知", "In", TR_INT, -1 },
618 { "賢", "Wi", TR_WIS, -1 },
619 { "器", "Dx", TR_DEX, -1 },
620 { "耐", "Cn", TR_CON, -1 },
621 { "魅", "Ch", TR_CHR, -1 },
622 { "道", "Md", TR_MAGIC_MASTERY, -1 },
623 { "隠", "Sl", TR_STEALTH, -1 },
624 { "探", "Sr", TR_SEARCH, -1 },
625 { "赤", "If", TR_INFRA, -1 },
626 { "掘", "Dg", TR_TUNNEL, -1 },
627 { NULL, NULL, 0, -1 }
630 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
631 static flag_insc_table flag_insc_immune[] =
633 { "酸", "Ac", TR_IM_ACID, -1 },
634 { "電", "El", TR_IM_ELEC, -1 },
635 { "火", "Fi", TR_IM_FIRE, -1 },
636 { "冷", "Co", TR_IM_COLD, -1 },
637 { NULL, NULL, 0, -1 }
640 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
641 static flag_insc_table flag_insc_resistance[] =
643 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
644 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
645 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
646 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
647 { "毒", "Po", TR_RES_POIS, -1 },
648 { "閃", "Li", TR_RES_LITE, -1 },
649 { "暗", "Dk", TR_RES_DARK, -1 },
650 { "破", "Sh", TR_RES_SHARDS, -1 },
651 { "盲", "Bl", TR_RES_BLIND, -1 },
652 { "乱", "Cf", TR_RES_CONF, -1 },
653 { "轟", "So", TR_RES_SOUND, -1 },
654 { "獄", "Nt", TR_RES_NETHER, -1 },
655 { "因", "Nx", TR_RES_NEXUS, -1 },
656 { "沌", "Ca", TR_RES_CHAOS, -1 },
657 { "劣", "Di", TR_RES_DISEN, -1 },
658 { "恐", "Fe", TR_RES_FEAR, -1 },
659 { NULL, NULL, 0, -1 }
662 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
663 static flag_insc_table flag_insc_misc[] =
665 { "易", "Es", TR_EASY_SPELL, -1 },
666 { "減", "Dm", TR_DEC_MANA, -1 },
667 { "投", "Th", TR_THROW, -1 },
668 { "反", "Rf", TR_REFLECT, -1 },
669 { "麻", "Fa", TR_FREE_ACT, -1 },
670 { "視", "Si", TR_SEE_INVIS, -1 },
671 { "経", "Hl", TR_HOLD_EXP, -1 },
672 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
673 { "活", "Rg", TR_REGEN, -1 },
674 { "浮", "Lv", TR_LEVITATION, -1 },
675 { "明", "Lu", TR_LITE_1, -1 },
676 { "明", "Lu", TR_LITE_2, -1 },
677 { "明", "Lu", TR_LITE_3, -1 },
678 { "闇", "Dl", TR_LITE_M1, -1 },
679 { "闇", "Dl", TR_LITE_M2, -1 },
680 { "闇", "Dl", TR_LITE_M3, -1 },
681 { "警", "Wr", TR_WARNING, -1 },
682 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
683 { "射", "Xs", TR_XTRA_SHOTS, -1 },
684 { "瞬", "Te", TR_TELEPORT, -1 },
685 { "怒", "Ag", TR_AGGRAVATE, -1 },
686 { "祝", "Bs", TR_BLESSED, -1 },
687 { "忌", "Ty", TR_TY_CURSE, -1 },
688 { "呪", "C-", TR_ADD_L_CURSE, -1 },
689 { "詛", "C+", TR_ADD_H_CURSE, -1 },
690 { NULL, NULL, 0, -1 }
693 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
694 static flag_insc_table flag_insc_aura[] =
696 { "炎", "F", TR_SH_FIRE, -1 },
697 { "電", "E", TR_SH_ELEC, -1 },
698 { "冷", "C", TR_SH_COLD, -1 },
699 { "魔", "M", TR_NO_MAGIC, -1 },
700 { "瞬", "T", TR_NO_TELE, -1 },
701 { NULL, NULL, 0, -1 }
704 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
705 static flag_insc_table flag_insc_brand[] =
707 { "酸", "A", TR_BRAND_ACID, -1 },
708 { "電", "E", TR_BRAND_ELEC, -1 },
709 { "焼", "F", TR_BRAND_FIRE, -1 },
710 { "凍", "Co", TR_BRAND_COLD, -1 },
711 { "毒", "P", TR_BRAND_POIS, -1 },
712 { "沌", "Ca", TR_CHAOTIC, -1 },
713 { "吸", "V", TR_VAMPIRIC, -1 },
714 { "震", "Q", TR_IMPACT, -1 },
715 { "切", "S", TR_VORPAL, -1 },
716 { "理", "M", TR_FORCE_WEAPON, -1 },
717 { NULL, NULL, 0, -1 }
720 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
721 static flag_insc_table flag_insc_kill[] =
723 { "邪", "*", TR_KILL_EVIL, -1 },
724 { "人", "p", TR_KILL_HUMAN, -1 },
725 { "龍", "D", TR_KILL_DRAGON, -1 },
726 { "オ", "o", TR_KILL_ORC, -1 },
727 { "ト", "T", TR_KILL_TROLL, -1 },
728 { "巨", "P", TR_KILL_GIANT, -1 },
729 { "デ", "U", TR_KILL_DEMON, -1 },
730 { "死", "L", TR_KILL_UNDEAD, -1 },
731 { "動", "Z", TR_KILL_ANIMAL, -1 },
732 { NULL, NULL, 0, -1 }
735 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
736 static flag_insc_table flag_insc_slay[] =
738 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
739 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
740 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
741 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
742 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
743 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
744 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
745 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
746 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
747 { NULL, NULL, 0, -1 }
750 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
751 static flag_insc_table flag_insc_esp1[] =
753 { "感", "Tele", TR_TELEPATHY, -1 },
754 { "邪", "Evil", TR_ESP_EVIL, -1 },
755 { "善", "Good", TR_ESP_GOOD, -1 },
756 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
757 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
758 { NULL, NULL, 0, -1 }
761 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
762 static flag_insc_table flag_insc_esp2[] =
764 { "人", "p", TR_ESP_HUMAN, -1 },
765 { "竜", "D", TR_ESP_DRAGON, -1 },
766 { "オ", "o", TR_ESP_ORC, -1 },
767 { "ト", "T", TR_ESP_TROLL, -1 },
768 { "巨", "P", TR_ESP_GIANT, -1 },
769 { "デ", "U", TR_ESP_DEMON, -1 },
770 { "死", "L", TR_ESP_UNDEAD, -1 },
771 { "動", "Z", TR_ESP_ANIMAL, -1 },
772 { NULL, NULL, 0, -1 }
775 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
776 static flag_insc_table flag_insc_sust[] =
778 { "腕", "St", TR_SUST_STR, -1 },
779 { "知", "In", TR_SUST_INT, -1 },
780 { "賢", "Wi", TR_SUST_WIS, -1 },
781 { "器", "Dx", TR_SUST_DEX, -1 },
782 { "耐", "Cn", TR_SUST_CON, -1 },
783 { "魅", "Ch", TR_SUST_CHR, -1 },
784 { NULL, NULL, 0, -1 }
788 static flag_insc_table flag_insc_plus[] =
790 { "At", TR_BLOWS, -1 },
791 { "Sp", TR_SPEED, -1 },
792 { "St", TR_STR, -1 },
793 { "In", TR_INT, -1 },
794 { "Wi", TR_WIS, -1 },
795 { "Dx", TR_DEX, -1 },
796 { "Cn", TR_CON, -1 },
797 { "Ch", TR_CHR, -1 },
798 { "Md", TR_MAGIC_MASTERY, -1 },
799 { "Sl", TR_STEALTH, -1 },
800 { "Sr", TR_SEARCH, -1 },
801 { "If", TR_INFRA, -1 },
802 { "Dg", TR_TUNNEL, -1 },
806 static flag_insc_table flag_insc_immune[] =
808 { "Ac", TR_IM_ACID, -1 },
809 { "El", TR_IM_ELEC, -1 },
810 { "Fi", TR_IM_FIRE, -1 },
811 { "Co", TR_IM_COLD, -1 },
815 static flag_insc_table flag_insc_resistance[] =
817 { "Ac", TR_RES_ACID, TR_IM_ACID },
818 { "El", TR_RES_ELEC, TR_IM_ELEC },
819 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
820 { "Co", TR_RES_COLD, TR_IM_COLD },
821 { "Po", TR_RES_POIS, -1 },
822 { "Li", TR_RES_LITE, -1 },
823 { "Dk", TR_RES_DARK, -1 },
824 { "Sh", TR_RES_SHARDS, -1 },
825 { "Bl", TR_RES_BLIND, -1 },
826 { "Cf", TR_RES_CONF, -1 },
827 { "So", TR_RES_SOUND, -1 },
828 { "Nt", TR_RES_NETHER, -1 },
829 { "Nx", TR_RES_NEXUS, -1 },
830 { "Ca", TR_RES_CHAOS, -1 },
831 { "Di", TR_RES_DISEN, -1 },
832 { "Fe", TR_RES_FEAR, -1 },
836 static flag_insc_table flag_insc_misc[] =
838 { "Es", TR_EASY_SPELL, -1 },
839 { "Dm", TR_DEC_MANA, -1 },
840 { "Th", TR_THROW, -1 },
841 { "Rf", TR_REFLECT, -1 },
842 { "Fa", TR_FREE_ACT, -1 },
843 { "Si", TR_SEE_INVIS, -1 },
844 { "Hl", TR_HOLD_EXP, -1 },
845 { "Sd", TR_SLOW_DIGEST, -1 },
846 { "Rg", TR_REGEN, -1 },
847 { "Lv", TR_LEVITATION, -1 },
848 { "Lu", TR_LITE_1, -1 },
849 { "Lu", TR_LITE_2, -1 },
850 { "Lu", TR_LITE_3, -1 },
851 { "Dl", TR_LITE_M1, -1 },
852 { "Dl", TR_LITE_M2, -1 },
853 { "Dl", TR_LITE_M3, -1 },
854 { "Wr", TR_WARNING, -1 },
855 { "Xm", TR_XTRA_MIGHT, -1 },
856 { "Xs", TR_XTRA_SHOTS, -1 },
857 { "Te", TR_TELEPORT, -1 },
858 { "Ag", TR_AGGRAVATE, -1 },
859 { "Bs", TR_BLESSED, -1 },
860 { "Ty", TR_TY_CURSE, -1 },
861 { "C-", TR_ADD_L_CURSE, -1 },
862 { "C+", TR_ADD_H_CURSE, -1 },
866 static flag_insc_table flag_insc_aura[] =
868 { "F", TR_SH_FIRE, -1 },
869 { "E", TR_SH_ELEC, -1 },
870 { "C", TR_SH_COLD, -1 },
871 { "M", TR_NO_MAGIC, -1 },
872 { "T", TR_NO_TELE, -1 },
876 static flag_insc_table flag_insc_brand[] =
878 { "A", TR_BRAND_ACID, -1 },
879 { "E", TR_BRAND_ELEC, -1 },
880 { "F", TR_BRAND_FIRE, -1 },
881 { "Co", TR_BRAND_COLD, -1 },
882 { "P", TR_BRAND_POIS, -1 },
883 { "Ca", TR_CHAOTIC, -1 },
884 { "V", TR_VAMPIRIC, -1 },
885 { "Q", TR_IMPACT, -1 },
886 { "S", TR_VORPAL, -1 },
887 { "M", TR_FORCE_WEAPON, -1 },
891 static flag_insc_table flag_insc_kill[] =
893 { "*", TR_KILL_EVIL, -1 },
894 { "p", TR_KILL_HUMAN, -1 },
895 { "D", TR_KILL_DRAGON, -1 },
896 { "o", TR_KILL_ORC, -1 },
897 { "T", TR_KILL_TROLL, -1 },
898 { "P", TR_KILL_GIANT, -1 },
899 { "U", TR_KILL_DEMON, -1 },
900 { "L", TR_KILL_UNDEAD, -1 },
901 { "Z", TR_KILL_ANIMAL, -1 },
905 static flag_insc_table flag_insc_slay[] =
907 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
908 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
909 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
910 { "o", TR_SLAY_ORC, TR_KILL_ORC },
911 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
912 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
913 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
914 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
915 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
919 static flag_insc_table flag_insc_esp1[] =
921 { "Tele", TR_TELEPATHY, -1 },
922 { "Evil", TR_ESP_EVIL, -1 },
923 { "Good", TR_ESP_GOOD, -1 },
924 { "Nolv", TR_ESP_NONLIVING, -1 },
925 { "Uniq", TR_ESP_UNIQUE, -1 },
929 static flag_insc_table flag_insc_esp2[] =
931 { "p", TR_ESP_HUMAN, -1 },
932 { "D", TR_ESP_DRAGON, -1 },
933 { "o", TR_ESP_ORC, -1 },
934 { "T", TR_ESP_TROLL, -1 },
935 { "P", TR_ESP_GIANT, -1 },
936 { "U", TR_ESP_DEMON, -1 },
937 { "L", TR_ESP_UNDEAD, -1 },
938 { "Z", TR_ESP_ANIMAL, -1 },
942 static flag_insc_table flag_insc_sust[] =
944 { "St", TR_SUST_STR, -1 },
945 { "In", TR_SUST_INT, -1 },
946 { "Wi", TR_SUST_WIS, -1 },
947 { "Dx", TR_SUST_DEX, -1 },
948 { "Cn", TR_SUST_CON, -1 },
949 { "Ch", TR_SUST_CHR, -1 },
954 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
955 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
958 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
959 * @param fi_ptr 参照する特性表示記号テーブル
960 * @param flgs 対応するオブジェクトのフラグ文字列
961 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
962 * @param ptr フラグ群を保管する文字列参照ポインタ
963 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
965 * Print an signed number "v" into a string "t", as if by
966 * sprintf(t, "%+d", n), and return a pointer to the terminator.
967 * Note that we always print a sign, either "+" or "-".
969 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
975 while (fi_ptr->english)
977 if (have_flag(flgs, fi_ptr->flag) &&
978 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
980 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
982 ADD_INSC(fi_ptr->english);
992 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
993 * @param fi_ptr 参照する特性表示記号テーブル
994 * @param flgs 対応するオブジェクトのフラグ文字列
995 * @return 1つでも該当の特性があったらTRUEを返す。
997 static bool have_flag_of(flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE])
999 while (fi_ptr->english)
1001 if (have_flag(flgs, fi_ptr->flag) &&
1002 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1011 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1012 * @param ptr 特性短縮表記を格納する文字列ポインタ
1013 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1014 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1015 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1016 * @return ptrと同じアドレス
1018 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1020 char *prev_ptr = ptr;
1021 u32b flgs[TR_FLAG_SIZE];
1023 /* Extract the flags */
1024 object_flags(o_ptr, flgs);
1026 /* Remove obvious flags */
1029 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1033 for (j = 0; j < TR_FLAG_SIZE; j++)
1034 flgs[j] &= ~k_ptr->flags[j];
1036 if (object_is_fixed_artifact(o_ptr))
1038 artifact_type *a_ptr = &a_info[o_ptr->name1];
1040 for (j = 0; j < TR_FLAG_SIZE; j++)
1041 flgs[j] &= ~a_ptr->flags[j];
1044 if (object_is_ego(o_ptr))
1046 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1048 for (j = 0; j < TR_FLAG_SIZE; j++)
1049 flgs[j] &= ~e_ptr->flags[j];
1053 /* Remove lite flags when this is a dark lite object */
1054 if (have_dark_flag(flgs))
1056 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1057 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1058 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1060 else if (have_lite_flag(flgs))
1062 add_flag(flgs, TR_LITE_1);
1063 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1064 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1068 if (have_flag_of(flag_insc_plus, flgs))
1073 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1076 if (have_flag_of(flag_insc_immune, flgs))
1078 if (!kanji && ptr != prev_ptr)
1085 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1088 if (have_flag_of(flag_insc_resistance, flgs))
1092 else if (ptr != prev_ptr)
1098 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1101 if (have_flag_of(flag_insc_misc, flgs))
1103 if (ptr != prev_ptr)
1109 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1112 if (have_flag_of(flag_insc_aura, flgs))
1116 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1119 if (have_flag_of(flag_insc_brand, flgs))
1121 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1124 if (have_flag_of(flag_insc_kill, flgs))
1126 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1129 if (have_flag_of(flag_insc_slay, flgs))
1131 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1136 if (have_flag_of(flag_insc_esp1, flgs) ||
1137 have_flag_of(flag_insc_esp2, flgs))
1139 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1140 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1144 if (have_flag_of(flag_insc_esp1, flgs))
1146 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1147 if (have_flag_of(flag_insc_esp2, flgs))
1149 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1153 if (have_flag_of(flag_insc_sust, flgs))
1157 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1166 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1167 * @param buff 特性短縮表記を格納する文字列ポインタ
1168 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1171 static void get_inscription(char *buff, object_type *o_ptr)
1173 cptr insc = quark_str(o_ptr->inscription);
1176 /* Not fully identified */
1177 if (!(o_ptr->ident & IDENT_MENTAL))
1179 /* Copy until end of line or '#' */
1182 if (*insc == '#') break;
1184 if (iskanji(*insc)) *buff++ = *insc++;
1194 for (; *insc; insc++)
1196 /* Ignore fake artifact inscription */
1197 if (*insc == '#') break;
1199 /* {%} will be automatically converted */
1200 else if ('%' == *insc)
1206 /* check for too long inscription */
1207 if (ptr >= buff + MAX_NLEN) continue;
1220 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1230 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1244 * @brief オブジェクトがクエストの達成目的か否かを返す。
1245 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1246 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1248 bool object_is_quest_target(object_type *o_ptr)
1250 if (p_ptr->inside_quest)
1252 int a_idx = quest[p_ptr->inside_quest].k_idx;
1255 artifact_type *a_ptr = &a_info[a_idx];
1256 if (!(a_ptr->gen_flags & TRG_INSTA_ART))
1258 if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
1270 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1271 * @param buf 表記を返すための文字列参照ポインタ
1272 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1273 * @param mode 表記に関するオプション指定
1274 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1276 * One can choose the "verbosity" of the description, including whether\n
1277 * or not the "number" of items should be described, and how much detail\n
1278 * should be used when describing the item.\n
1280 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1281 * description, which can get pretty long, including incriptions, such as:\n
1282 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1283 * Note that the inscription will be clipped to keep the total description\n
1284 * under MAX_NLEN-1 chars (plus a terminator).\n
1286 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1287 * portable, versions of some common "sprintf()" commands.\n
1289 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1290 * the item is also an artifact, which should NEVER happen.\n
1292 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1293 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1294 * The "Specials" never use "modifiers" if they are "known", since they\n
1295 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1297 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1298 * plus the artifact name, just like any other artifact, if known.\n
1300 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1301 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1302 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1303 * they will append the artifact name, just like any artifact, if known.\n
1305 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1308 * OD_NAME_ONLY : The Cloak of Death\n
1309 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1310 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1311 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1313 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1314 * OD_NO_PLURAL : Forbidden use of plural \n
1315 * OD_STORE : Assume to be aware and known\n
1316 * OD_NO_FLAVOR : Allow to hidden flavor\n
1317 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1319 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1321 /* Extract object kind name */
1322 cptr kindname = k_name + k_info[o_ptr->k_idx].name;
1324 /* Extract default "base" string */
1325 cptr basenm = kindname;
1327 /* Assume no "modifier" string */
1337 bool show_weapon = FALSE;
1338 bool show_armour = FALSE;
1343 char p1 = '(', p2 = ')';
1344 char b1 = '[', b2 = ']';
1345 char c1 = '{', c2 = '}';
1347 char tmp_val[MAX_NLEN+160];
1348 char tmp_val2[MAX_NLEN+10];
1349 char fake_insc_buf[30];
1351 u32b flgs[TR_FLAG_SIZE];
1353 object_type *bow_ptr;
1355 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1356 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1358 /* Extract some flags */
1359 object_flags(o_ptr, flgs);
1361 /* See if the object is "aware" */
1362 if (object_is_aware(o_ptr)) aware = TRUE;
1364 /* See if the object is "known" */
1365 if (object_is_known(o_ptr)) known = TRUE;
1367 /* Allow flavors to be hidden when aware */
1368 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1370 /* Object is in the inventory of a store or spoiler */
1371 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1373 /* Don't show flavors */
1376 /* Pretend known and aware */
1381 /* Force to be flavor name only */
1382 if (mode & OD_FORCE_FLAVOR)
1388 /* Cancel shuffling */
1389 flavor_k_ptr = k_ptr;
1392 /* Analyze the object */
1393 switch (o_ptr->tval)
1395 /* Some objects are easy to describe */
1409 monster_race *r_ptr = &r_info[o_ptr->pval];
1415 modstr = _(" (空)", " (empty)");
1420 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1423 cptr t = r_name + r_ptr->name;
1425 if (!(r_ptr->flags1 & RF1_UNIQUE))
1427 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1433 sprintf(tmp_val2, "(%s)", t);
1443 /* Figurines/Statues */
1447 monster_race *r_ptr = &r_info[o_ptr->pval];
1450 modstr = r_name + r_ptr->name;
1452 cptr t = r_name + r_ptr->name;
1454 if (!(r_ptr->flags1 & RF1_UNIQUE))
1456 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1473 monster_race *r_ptr = &r_info[o_ptr->pval];
1475 modstr = r_name + r_ptr->name;
1480 if (r_ptr->flags1 & RF1_UNIQUE)
1481 basenm = "& % of #";
1489 /* Missiles/ Bows/ Weapons */
1518 /* Lites (including a few "Specials") */
1524 /* Amulets (including a few "Specials") */
1527 /* Known artifacts */
1530 if (object_is_fixed_artifact(o_ptr)) break;
1531 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1534 /* Color the object */
1535 modstr = k_name + flavor_k_ptr->flavor_name;
1538 if (!flavor) basenm = "%のアミュレット";
1539 else if (aware) basenm = "%の#アミュレット";
1540 else basenm = "#アミュレット";
1542 if (!flavor) basenm = "& Amulet~ of %";
1543 else if (aware) basenm = "& # Amulet~ of %";
1544 else basenm = "& # Amulet~";
1550 /* Rings (including a few "Specials") */
1553 /* Known artifacts */
1556 if (object_is_fixed_artifact(o_ptr)) break;
1557 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1560 /* Color the object */
1561 modstr = k_name + flavor_k_ptr->flavor_name;
1564 if (!flavor) basenm = "%の指輪";
1565 else if (aware) basenm = "%の#指輪";
1566 else basenm = "#指輪";
1568 if (!flavor) basenm = "& Ring~ of %";
1569 else if (aware) basenm = "& # Ring~ of %";
1570 else basenm = "& # Ring~";
1573 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1585 /* Color the object */
1586 modstr = k_name + flavor_k_ptr->flavor_name;
1589 if (!flavor) basenm = "%の杖";
1590 else if (aware) basenm = "%の#杖";
1593 if (!flavor) basenm = "& Staff~ of %";
1594 else if (aware) basenm = "& # Staff~ of %";
1595 else basenm = "& # Staff~";
1603 /* Color the object */
1604 modstr = k_name + flavor_k_ptr->flavor_name;
1607 if (!flavor) basenm = "%の魔法棒";
1608 else if (aware) basenm = "%の#魔法棒";
1609 else basenm = "#魔法棒";
1611 if (!flavor) basenm = "& Wand~ of %";
1612 else if (aware) basenm = "& # Wand~ of %";
1613 else basenm = "& # Wand~";
1621 /* Color the object */
1622 modstr = k_name + flavor_k_ptr->flavor_name;
1625 if (!flavor) basenm = "%のロッド";
1626 else if (aware) basenm = "%の#ロッド";
1627 else basenm = "#ロッド";
1629 if (!flavor) basenm = "& Rod~ of %";
1630 else if (aware) basenm = "& # Rod~ of %";
1631 else basenm = "& # Rod~";
1639 /* Color the object */
1640 modstr = k_name + flavor_k_ptr->flavor_name;
1643 if (!flavor) basenm = "%の巻物";
1644 else if (aware) basenm = "「#」と書かれた%の巻物";
1645 else basenm = "「#」と書かれた巻物";
1647 if (!flavor) basenm = "& Scroll~ of %";
1648 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1649 else basenm = "& Scroll~ titled \"#\"";
1657 /* Color the object */
1658 modstr = k_name + flavor_k_ptr->flavor_name;
1661 if (!flavor) basenm = "%の薬";
1662 else if (aware) basenm = "%の#薬";
1665 if (!flavor) basenm = "& Potion~ of %";
1666 else if (aware) basenm = "& # Potion~ of %";
1667 else basenm = "& # Potion~";
1675 /* Ordinary food is "boring" */
1676 if (!k_ptr->flavor_name) break;
1678 /* Color the object */
1679 modstr = k_name + flavor_k_ptr->flavor_name;
1682 if (!flavor) basenm = "%のキノコ";
1683 else if (aware) basenm = "%の#キノコ";
1684 else basenm = "#キノコ";
1686 if (!flavor) basenm = "& Mushroom~ of %";
1687 else if (aware) basenm = "& # Mushroom~ of %";
1688 else basenm = "& # Mushroom~";
1696 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1706 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1707 basenm = "& Book~ of Life Magic %";
1709 basenm = "& Life Spellbook~ %";
1715 case TV_SORCERY_BOOK:
1720 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1721 basenm = "& Book~ of Sorcery %";
1723 basenm = "& Sorcery Spellbook~ %";
1729 case TV_NATURE_BOOK:
1734 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1735 basenm = "& Book~ of Nature Magic %";
1737 basenm = "& Nature Spellbook~ %";
1746 basenm = "カオスの魔法書%";
1748 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1749 basenm = "& Book~ of Chaos Magic %";
1751 basenm = "& Chaos Spellbook~ %";
1762 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1763 basenm = "& Book~ of Death Magic %";
1765 basenm = "& Death Spellbook~ %";
1774 basenm = "トランプの魔法書%";
1776 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1777 basenm = "& Book~ of Trump Magic %";
1779 basenm = "& Trump Spellbook~ %";
1785 case TV_ARCANE_BOOK:
1790 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1791 basenm = "& Book~ of Arcane Magic %";
1793 basenm = "& Arcane Spellbook~ %";
1804 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1805 basenm = "& Book~ of Craft Magic %";
1807 basenm = "& Craft Spellbook~ %";
1813 case TV_DAEMON_BOOK:
1818 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1819 basenm = "& Book~ of Daemon Magic %";
1821 basenm = "& Daemon Spellbook~ %";
1827 case TV_CRUSADE_BOOK:
1832 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1833 basenm = "& Book~ of Crusade Magic %";
1835 basenm = "& Crusade Spellbook~ %";
1843 basenm = _("歌集%", "& Song Book~ %");
1847 case TV_HISSATSU_BOOK:
1849 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1858 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1859 basenm = "& Book~ of Hex Magic %";
1861 basenm = "& Hex Spellbook~ %";
1867 /* Hack -- Gold/Gems */
1870 strcpy(buf, basenm);
1874 /* Used in the "inventory" routine */
1877 strcpy(buf, _("(なし)", "(nothing)"));
1882 /* Use full name from k_info or a_info */
1883 if (aware && have_flag(flgs, TR_FULL_NAME))
1885 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1886 else basenm = kindname;
1889 /* Start dumping the result */
1893 if (basenm[0] == '&')
1899 if (mode & OD_OMIT_PREFIX)
1903 else if (o_ptr->number > 1)
1905 t = object_desc_kosuu(t, o_ptr);
1906 t = object_desc_str(t, "の ");
1909 /* 英語の場合アーティファクトは The が付くので分かるが
1910 * 日本語では分からないのでマークをつける
1914 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1915 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1920 /* The object "expects" a "number" */
1921 if (basenm[0] == '&')
1923 /* Skip the ampersand (and space) */
1927 if (mode & OD_OMIT_PREFIX)
1932 /* Hack -- None left */
1933 else if (o_ptr->number <= 0)
1935 t = object_desc_str(t, "no more ");
1938 /* Extract the number */
1939 else if (o_ptr->number > 1)
1941 t = object_desc_num(t, o_ptr->number);
1942 t = object_desc_chr(t, ' ');
1945 /* Hack -- The only one of its kind */
1946 else if ((known && object_is_artifact(o_ptr)) ||
1947 ((o_ptr->tval == TV_CORPSE) &&
1948 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1950 t = object_desc_str(t, "The ");
1960 case '#': vowel = is_a_vowel(modstr[0]); break;
1961 case '%': vowel = is_a_vowel(*kindname); break;
1962 default: vowel = is_a_vowel(*s); break;
1967 /* A single one, with a vowel */
1968 t = object_desc_str(t, "an ");
1972 /* A single one, without a vowel */
1973 t = object_desc_str(t, "a ");
1978 /* Hack -- objects that "never" take an article */
1985 if (mode & OD_OMIT_PREFIX)
1990 /* Hack -- all gone */
1991 else if (o_ptr->number <= 0)
1993 t = object_desc_str(t, "no more ");
1996 /* Prefix a number if required */
1997 else if (o_ptr->number > 1)
1999 t = object_desc_num(t, o_ptr->number);
2000 t = object_desc_chr(t, ' ');
2003 /* Hack -- The only one of its kind */
2004 else if (known && object_is_artifact(o_ptr))
2006 t = object_desc_str(t, "The ");
2009 /* Hack -- single items get no prefix */
2017 /* Paranoia -- skip illegal tildes */
2018 /* while (*s == '~') s++; */
2021 if (object_is_smith(o_ptr))
2023 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2026 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2030 if (o_ptr->art_name)
2032 cptr temp = quark_str(o_ptr->art_name);
2034 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2035 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2036 if (strncmp(temp, "of ", 3) == 0)
2038 t = object_desc_str(t, &temp[3]);
2039 t = object_desc_str(t, "の");
2041 else if ((strncmp(temp, "『", 2) != 0) &&
2042 (strncmp(temp, "《", 2) != 0) &&
2044 t = object_desc_str(t, temp);
2047 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2049 artifact_type *a_ptr = &a_info[o_ptr->name1];
2050 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2051 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2053 t = object_desc_str(t, a_name + a_ptr->name);
2057 else if (object_is_ego(o_ptr))
2059 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2060 t = object_desc_str(t, e_name + e_ptr->name);
2065 /* Copy the string */
2066 for (s0 = NULL; *s || s0; )
2068 /* The end of the flavour/kind string. */
2075 /* Begin to append the modifier (flavor) */
2076 else if ((*s == '#') && !s0)
2081 /* Paranoia -- Never append multiple modstrs */
2085 /* Begin to append the kind name */
2086 else if ((*s == '%') && !s0)
2091 /* Paranoia -- Never append multiple kindnames */
2099 /* Add a plural if needed */
2100 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2104 /* XXX XXX XXX Mega-Hack */
2106 /* Hack -- "Cutlass-es" and "Torch-es" */
2107 if ((k == 's') || (k == 'h')) *t++ = 'e';
2129 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2132 /* ランダムアーティファクトの名前はセーブファイルに記録
2133 されるので、英語版の名前もそれらしく変換する */
2134 if (o_ptr->art_name)
2138 strcpy(temp, quark_str(o_ptr->art_name));
2139 /* MEGA HACK by ita */
2140 if (strncmp(temp, "『", 2) == 0 ||
2141 strncmp(temp, "《", 2) == 0)
2142 t = object_desc_str(t, temp);
2143 else if (temp[0] == '\'')
2145 itemp = strlen(temp);
2146 temp[itemp - 1] = 0;
2147 t = object_desc_str(t, "『");
2148 t = object_desc_str(t, &temp[1]);
2149 t = object_desc_str(t, "』");
2152 else if (object_is_fixed_artifact(o_ptr))
2154 artifact_type *a_ptr = &a_info[o_ptr->name1];
2155 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2157 t = object_desc_str(t, a_name + a_ptr->name);
2160 else if (o_ptr->inscription)
2162 cptr str = quark_str(o_ptr->inscription);
2171 if (*str == '#') break;
2177 cptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2179 /* Add the false name */
2180 t = object_desc_str(t,"『");
2181 t = object_desc_str(t, &str_aux[1]);
2182 t = object_desc_str(t,"』");
2187 if (object_is_smith(o_ptr))
2189 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2192 /* Hack -- Append "Artifact" or "Special" names */
2193 if (known && !have_flag(flgs, TR_FULL_NAME))
2195 /* Is it a new random artifact ? */
2196 if (o_ptr->art_name)
2198 t = object_desc_chr(t, ' ');
2199 t = object_desc_str(t, quark_str(o_ptr->art_name));
2202 /* Grab any artifact name */
2203 else if (object_is_fixed_artifact(o_ptr))
2205 artifact_type *a_ptr = &a_info[o_ptr->name1];
2207 t = object_desc_chr(t, ' ');
2208 t = object_desc_str(t, a_name + a_ptr->name);
2211 /* Grab any ego-item name */
2214 if (object_is_ego(o_ptr))
2216 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2218 t = object_desc_chr(t, ' ');
2219 t = object_desc_str(t, e_name + e_ptr->name);
2222 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2225 cptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2227 /* Add the false name */
2228 t = object_desc_chr(t, ' ');
2229 t = object_desc_str(t, &str[1]);
2236 /* No more details wanted */
2237 if (mode & OD_NAME_ONLY) goto object_desc_done;
2239 /* Hack -- Chests must be described in detail */
2240 if (o_ptr->tval == TV_CHEST)
2242 /* Not searched yet */
2248 /* May be "empty" */
2249 else if (!o_ptr->pval)
2251 t = object_desc_str(t, _("(空)", " (empty)"));
2254 /* May be "disarmed" */
2255 else if (o_ptr->pval < 0)
2257 if (chest_traps[0 - o_ptr->pval])
2259 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2263 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2267 /* Describe the traps, if any */
2270 /* Describe the traps */
2271 switch (chest_traps[o_ptr->pval])
2275 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2278 case CHEST_LOSE_STR:
2280 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2283 case CHEST_LOSE_CON:
2285 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2290 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2293 case CHEST_PARALYZE:
2295 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2300 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2304 case CHEST_BIRD_STORM:
2305 case CHEST_E_SUMMON:
2306 case CHEST_H_SUMMON:
2308 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2311 case CHEST_RUNES_OF_EVIL:
2313 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2318 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2323 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2331 /* Display the item like a weapon */
2332 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2334 /* Display the item like a weapon */
2335 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2338 /* Display the item like a weapon */
2339 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2341 /* Display the item like armour */
2342 if (o_ptr->ac) show_armour = TRUE;
2345 /* Dump base weapon info */
2346 switch (o_ptr->tval)
2348 /* Missiles and Weapons */
2357 /* In Vault Quest, hide the dice of target weapon. */
2358 if(object_is_quest_target(o_ptr) && !known)
2363 /* Append a "damage" string */
2364 t = object_desc_chr(t, ' ');
2365 t = object_desc_chr(t, p1);
2366 t = object_desc_num(t, o_ptr->dd);
2367 t = object_desc_chr(t, 'd');
2368 t = object_desc_num(t, o_ptr->ds);
2369 t = object_desc_chr(t, p2);
2375 /* Bows get a special "damage string" */
2378 /* Mega-Hack -- Extract the "base power" */
2379 power = bow_tmul(o_ptr->sval);
2381 /* Apply the "Extra Might" flag */
2382 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2384 /* Append a special "damage" string */
2385 t = object_desc_chr(t, ' ');
2386 t = object_desc_chr(t, p1);
2387 t = object_desc_chr(t, 'x');
2388 t = object_desc_num(t, power);
2389 t = object_desc_chr(t, p2);
2391 fire_rate = calc_num_fire(o_ptr);
2392 /* Show Fire rate */
2393 if (fire_rate != 0 && power > 0 && known)
2395 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2397 t = object_desc_chr(t, ' ');
2398 t = object_desc_chr(t, p1);
2399 t = object_desc_num(t, fire_rate/100);
2400 t = object_desc_chr(t, '.');
2401 t = object_desc_num(t, fire_rate%100);
2402 t = object_desc_str(t, "turn");
2403 t = object_desc_chr(t, p2);
2411 /* Add the weapon bonuses */
2414 /* Show the tohit/todam on request */
2417 t = object_desc_chr(t, ' ');
2418 t = object_desc_chr(t, p1);
2419 t = object_desc_int(t, o_ptr->to_h);
2420 t = object_desc_chr(t, ',');
2421 t = object_desc_int(t, o_ptr->to_d);
2422 t = object_desc_chr(t, p2);
2425 /* Show the tohit if needed */
2426 else if (o_ptr->to_h)
2428 t = object_desc_chr(t, ' ');
2429 t = object_desc_chr(t, p1);
2430 t = object_desc_int(t, o_ptr->to_h);
2431 t = object_desc_chr(t, p2);
2434 /* Show the todam if needed */
2435 else if (o_ptr->to_d)
2437 t = object_desc_chr(t, ' ');
2438 t = object_desc_chr(t, p1);
2439 t = object_desc_int(t, o_ptr->to_d);
2440 t = object_desc_chr(t, p2);
2444 bow_ptr = &inventory[INVEN_BOW];
2446 /* If have a firing weapon + ammo matches bow */
2447 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2449 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2450 int tmul = bow_tmul(bow_ptr->sval);
2451 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2453 /* See if the bow is "known" - then set damage bonus */
2454 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2456 /* Effect of ammo */
2457 if (known) avgdam += (o_ptr->to_d * 10);
2459 /* Get extra "power" from "extra might" */
2460 if (p_ptr->xtra_might) tmul++;
2462 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2464 /* Launcher multiplier */
2466 avgdam /= (100 * 10);
2468 /* Get extra damage from concentration */
2469 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2471 if (avgdam < 0) avgdam = 0;
2473 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2474 t = object_desc_chr(t, ' ');
2475 t = object_desc_chr(t, p1);
2477 if(show_ammo_no_crit)
2479 /* Damage with no-crit */
2480 t = object_desc_num(t, avgdam);
2481 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2484 /* Apply Expect damage of Critical */
2485 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2486 t = object_desc_num(t, avgdam);
2488 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2489 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2491 if (p_ptr->num_fire == 0)
2493 t = object_desc_chr(t, '0');
2497 /* Calc effects of energy */
2498 avgdam *= (p_ptr->num_fire * 100);
2499 avgdam /= energy_fire;
2500 t = object_desc_num(t, avgdam);
2501 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2503 if(show_ammo_crit_ratio)
2505 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2507 t = object_desc_chr(t, '/');
2508 t = object_desc_num(t, percent / 100);
2509 t = object_desc_chr(t, '.');
2510 if(percent % 100 < 10)
2512 t = object_desc_chr(t, '0');
2514 t = object_desc_num(t, percent % 100);
2515 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2519 t = object_desc_chr(t, p2);
2521 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2523 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2524 s16b energy_fire = 100 - p_ptr->lev;
2526 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2528 /* Display (shot damage/ avg damage) */
2529 t = object_desc_chr(t, ' ');
2530 t = object_desc_chr(t, p1);
2531 t = object_desc_num(t, avgdam);
2532 t = object_desc_chr(t, '/');
2534 /* Calc effects of energy */
2535 avgdam = 100 * avgdam / energy_fire;
2537 t = object_desc_num(t, avgdam);
2538 t = object_desc_chr(t, p2);
2541 /* Add the armor bonuses */
2544 /* Show the armor class info */
2547 t = object_desc_chr(t, ' ');
2548 t = object_desc_chr(t, b1);
2549 t = object_desc_num(t, o_ptr->ac);
2550 t = object_desc_chr(t, ',');
2551 t = object_desc_int(t, o_ptr->to_a);
2552 t = object_desc_chr(t, b2);
2555 /* No base armor, but does increase armor */
2556 else if (o_ptr->to_a)
2558 t = object_desc_chr(t, ' ');
2559 t = object_desc_chr(t, b1);
2560 t = object_desc_int(t, o_ptr->to_a);
2561 t = object_desc_chr(t, b2);
2565 /* Hack -- always show base armor */
2566 else if (show_armour)
2568 t = object_desc_chr(t, ' ');
2569 t = object_desc_chr(t, b1);
2570 t = object_desc_num(t, o_ptr->ac);
2571 t = object_desc_chr(t, b2);
2575 /* No more details wanted */
2576 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2579 if (known) /* Known item only */
2582 * Hack -- Wands and Staffs have charges. Make certain how many charges
2583 * a stack of staffs really has is clear. -LM-
2585 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2587 /* Dump " (N charges)" */
2588 t = object_desc_chr(t, ' ');
2589 t = object_desc_chr(t, p1);
2591 /* Clear explaination for staffs. */
2592 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2594 t = object_desc_num(t, o_ptr->number);
2595 t = object_desc_str(t, "x ");
2597 t = object_desc_num(t, o_ptr->pval);
2599 t = object_desc_str(t, "回分");
2601 t = object_desc_str(t, " charge");
2602 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2605 t = object_desc_chr(t, p2);
2607 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2608 * be in any state of charge or discharge, this now includes a number. -LM-
2610 else if (o_ptr->tval == TV_ROD)
2612 /* Hack -- Dump " (# charging)" if relevant */
2615 /* Stacks of rods display an exact count of charging rods. */
2616 if (o_ptr->number > 1)
2619 if (k_ptr->pval == 0) k_ptr->pval = 1;
2621 /* Find out how many rods are charging, by dividing
2622 * current timeout by each rod's maximum timeout.
2623 * Ensure that any remainder is rounded up. Display
2624 * very discharged stacks as merely fully discharged.
2626 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2627 if (power > o_ptr->number) power = o_ptr->number;
2629 /* Display prettily. */
2630 t = object_desc_str(t, " (");
2631 t = object_desc_num(t, power);
2632 t = object_desc_str(t, _("本 充填中)", " charging)"));
2635 /* "one Rod of Perception (1 charging)" would look tacky. */
2638 t = object_desc_str(t, _("(充填中)", " (charging)"));
2643 /* Dump "pval" flags for wearable items */
2644 if (have_pval_flags(flgs))
2646 /* Start the display */
2647 t = object_desc_chr(t, ' ');
2648 t = object_desc_chr(t, p1);
2650 /* Dump the "pval" itself */
2651 t = object_desc_int(t, o_ptr->pval);
2653 /* Do not display the "pval" flags */
2654 if (have_flag(flgs, TR_HIDE_TYPE))
2660 else if (have_flag(flgs, TR_SPEED))
2662 /* Dump " to speed" */
2663 t = object_desc_str(t, _("加速", " to speed"));
2667 else if (have_flag(flgs, TR_BLOWS))
2671 t = object_desc_str(t, "攻撃");
2673 t = object_desc_str(t, " attack");
2676 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2681 else if (have_flag(flgs, TR_STEALTH))
2683 /* Dump " to stealth" */
2684 t = object_desc_str(t, _("隠密", " to stealth"));
2688 else if (have_flag(flgs, TR_SEARCH))
2690 /* Dump " to searching" */
2691 t = object_desc_str(t, _("探索", " to searching"));
2695 else if (have_flag(flgs, TR_INFRA))
2697 /* Dump " to infravision" */
2698 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2701 /* Finish the display */
2702 t = object_desc_chr(t, p2);
2705 /* Hack -- Process Lanterns/Torches */
2706 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2708 /* Hack -- Turns of light for normal lites */
2710 t = object_desc_chr(t, '(');
2712 t = object_desc_str(t, " (with ");
2715 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2716 else t = object_desc_num(t, o_ptr->xtra4);
2717 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2720 /* Indicate charging objects, but not rods. */
2721 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2723 /* Hack -- Dump " (charging)" if relevant */
2724 t = object_desc_str(t, _("(充填中)", " (charging)"));
2729 /* No more details wanted */
2730 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2733 /* Prepare real inscriptions in a buffer */
2736 /* Auto abbreviation inscribe */
2737 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2739 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2750 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2754 /* Use the standard inscription if available */
2755 if (o_ptr->inscription)
2759 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2761 /* Get inscription and convert {%} */
2762 get_inscription(buff, o_ptr);
2764 /* strcat with correct treating of kanji */
2765 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2769 /* No fake inscription yet */
2770 fake_insc_buf[0] = '\0';
2772 /* Use the game-generated "feeling" otherwise, if available */
2775 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2778 /* Note "cursed" if the item is known to be cursed */
2779 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2781 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2784 /* Note "unidentified" if the item is unidentified */
2785 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2786 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2788 && !(o_ptr->ident & IDENT_SENSE))
2790 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2793 /* Mega-Hack -- note empty wands/staffs */
2794 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2796 strcpy(fake_insc_buf, _("空", "empty"));
2799 /* Note "tried" if the object has been tested unsuccessfully */
2800 else if (!aware && object_is_tried(o_ptr))
2802 strcpy(fake_insc_buf, _("未判明", "tried"));
2805 /* Note the discount, if any */
2806 if (o_ptr->discount)
2808 /* Hidden by real inscription unless in a store */
2809 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2811 char discount_num_buf[4];
2813 /* Append to other fake inscriptions if any */
2814 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2816 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2817 strcat(fake_insc_buf, discount_num_buf);
2818 strcat(fake_insc_buf, _("%引き", "% off"));
2823 /* Append the inscription, if any */
2824 if (fake_insc_buf[0] || tmp_val2[0])
2826 /* Append the inscription */
2827 t = object_desc_chr(t, ' ');
2828 t = object_desc_chr(t, c1);
2830 /* Append fake inscriptions */
2831 if (fake_insc_buf[0])
2833 t = object_desc_str(t, fake_insc_buf);
2836 /* Append a separater */
2837 if (fake_insc_buf[0] && tmp_val2[0])
2839 t = object_desc_chr(t, ',');
2840 t = object_desc_chr(t, ' ');
2843 /* Append real inscriptions */
2846 t = object_desc_str(t, tmp_val2);
2849 t = object_desc_chr(t, c2);
2853 my_strcpy(buf, tmp_val, MAX_NLEN);