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 */
72 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
73 * @param out_string 作成した名を保管する参照ポインタ
75 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
76 * syllables 配列と elvish.txt を組み合わせる。\n
78 void get_table_name_aux(char *out_string)
82 get_rnd_line("aname_j.txt", 1, Syllable);
83 strcpy(out_string, Syllable);
84 get_rnd_line("aname_j.txt", 2, Syllable);
85 strcat(out_string, Syllable);
87 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
89 static cptr syllables[MAX_SYLLABLES] = {
90 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
91 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
92 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
93 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
94 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
95 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
96 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
97 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
98 "kho", "kli", "klis", "la", "lech", "man", "mar",
99 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
100 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
101 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
102 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
103 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
104 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
105 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
106 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
107 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
108 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
109 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
113 int testcounter = randint1(3) + 1;
115 strcpy(out_string, "");
117 if (randint1(3) == 2)
119 while (testcounter--)
120 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
125 testcounter = randint1(2) + 1;
126 while (testcounter--)
128 (void)get_rnd_line("elvish.txt", 0, Syllable);
129 strcat(out_string, Syllable);
133 out_string[0] = toupper(out_string[1]);
135 out_string[16] = '\0';
140 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
141 * @param out_string 作成した名を保管する参照ポインタ
143 * @details get_table_name_aux()ほぼ完全に実装を依存している。
145 void get_table_name(char *out_string)
148 get_table_name_aux(buff);
149 sprintf(out_string, _("『%s』", "'%s'"), buff);
153 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
154 * @param out_string 作成した名を保管する参照ポインタ
156 * @details sname.txtが語幹の辞書となっている。
158 void get_table_sindarin_aux(char *out_string)
165 get_rnd_line("sname.txt", 1, Syllable);
167 strcpy(tmp, Syllable);
169 strcpy(out_string, Syllable);
172 get_rnd_line("sname.txt", 2, Syllable);
174 strcat(tmp, Syllable);
175 sindarin_to_kana(out_string, tmp);
177 strcat(out_string, Syllable);
182 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
183 * @param out_string 作成した名を保管する参照ポインタ
185 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
187 void get_table_sindarin(char *out_string)
190 get_table_sindarin_aux(buff);
191 sprintf(out_string, _("『%s』", "'%s'"), buff);
196 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
197 * @param tval シャッフルしたいtval
199 * @details 巻物、各種魔道具などに利用される。
201 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
204 IDX k_idx_list_num = 0;
207 /* Allocate an array for a list of k_idx */
208 C_MAKE(k_idx_list, max_k_idx, s16b);
210 /* Search objects with given tval for shuffle */
211 for (i = 0; i < max_k_idx; i++)
213 object_kind *k_ptr = &k_info[i];
216 if (k_ptr->tval != tval) continue;
218 /* Paranoia -- Skip objects without flavor */
219 if (!k_ptr->flavor) continue;
221 /* Skip objects with a fixed flavor name */
222 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
225 k_idx_list[k_idx_list_num] = i;
227 /* Increase number of remembered indices */
231 /* Shuffle flavors */
232 for (i = 0; i < k_idx_list_num; i++)
234 object_kind *k1_ptr = &k_info[k_idx_list[i]];
235 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
237 /* Swap flavors of this pair */
238 s16b tmp = k1_ptr->flavor;
239 k1_ptr->flavor = k2_ptr->flavor;
240 k2_ptr->flavor = tmp;
243 /* Free an array for a list of k_idx */
244 C_KILL(k_idx_list, max_k_idx, s16b);
248 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
251 * Prepare the "variable" part of the "k_info" array.\n
253 * The "color"/"metal"/"type" of an item is its "flavor".\n
254 * For the most part, flavors are assigned randomly each game.\n
256 * Initialize descriptions for the "colored" objects, including:\n
257 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
259 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
260 * Slime Mold Juice, Unused Potion).\n
262 * Scroll titles are always between 6 and 14 letters long. This is\n
263 * ensured because every title is composed of whole words, where every\n
264 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
265 * letters each), and that no scroll is finished until it attempts to\n
266 * grow beyond 15 letters. The first time this can happen is when the\n
267 * current title has 6 letters and the new word has 8 letters, which\n
268 * would result in a 6 letter scroll title.\n
270 * Duplicate titles are avoided by requiring that no two scrolls share\n
271 * the same first four letters (not the most efficient method, and not\n
272 * the least efficient method, but it will always work).\n
274 * Hack -- make sure everything stays the same for each saved game\n
275 * This is accomplished by the use of a saved "random seed", as in\n
276 * "town_gen()". Since no other functions are called while the special\n
277 * seed is in effect, so this function is pretty "safe".\n
279 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
281 void flavor_init(void)
284 u32b state_backup[4];
286 /* Hack -- Backup the RNG state */
287 Rand_state_backup(state_backup);
289 /* Hack -- Induce consistant flavors */
290 Rand_state_set(seed_flavor);
293 /* Initialize flavor index of each object by itself */
294 for (i = 0; i < max_k_idx; i++)
296 object_kind *k_ptr = &k_info[i];
298 /* Skip objects without flavor name */
299 if (!k_ptr->flavor_name) continue;
302 * Initialize flavor index to itself
303 * -> Shuffle it later
309 shuffle_flavors(TV_RING);
311 /* Shuffle Amulets */
312 shuffle_flavors(TV_AMULET);
315 shuffle_flavors(TV_STAFF);
318 shuffle_flavors(TV_WAND);
321 shuffle_flavors(TV_ROD);
323 /* Shuffle Mushrooms */
324 shuffle_flavors(TV_FOOD);
326 /* Shuffle Potions */
327 shuffle_flavors(TV_POTION);
329 /* Shuffle Scrolls */
330 shuffle_flavors(TV_SCROLL);
333 /* Hack -- Restore the RNG state */
334 Rand_state_restore(state_backup);
336 /* Analyze every object */
337 for (i = 1; i < max_k_idx; i++)
339 object_kind *k_ptr = &k_info[i];
341 /* Skip "empty" objects */
342 if (!k_ptr->name) continue;
344 /* No flavor yields aware */
345 if (!k_ptr->flavor) k_ptr->aware = TRUE;
347 /* Check for "easily known" */
348 k_ptr->easy_know = object_easy_know(i);
354 * @brief 対象文字配列に一文字だけをコピーする。
355 * @param t 保管先文字列ポインタ
359 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
360 * and return a pointer to the terminator (t + 1).\n
362 static char *object_desc_chr(char *t, char c)
373 * @brief 対象文字配列に文字列をコピーする。
374 * @param t 保管先文字列ポインタ
375 * @param s コピーしたい文字列ポインタ
378 * Print a string "s" into a string "t", as if by strcpy(t, s),
379 * and return a pointer to the terminator.
381 static char *object_desc_str(char *t, cptr s)
383 /* Copy the string */
384 while (*s) *t++ = *s++;
392 * @brief 対象文字配列に符号なし整数値をコピーする。
393 * @param t 保管先文字列ポインタ
397 * Print an unsigned number "n" into a string "t", as if by
398 * sprintf(t, "%u", n), and return a pointer to the terminator.
400 static char *object_desc_num(char *t, uint n)
404 /* Find "size" of "n" */
405 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
407 /* Dump each digit */
413 /* Remove the digit */
416 /* Process next digit */
430 * @brief 日本語の個数表示ルーチン
431 * @param t 保管先文字列ポインタ
432 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
435 * cmd1.c で流用するために object_desc_japanese から移動した。
437 char *object_desc_kosuu(char *t, object_type *o_ptr)
439 t = object_desc_num(t, o_ptr->number);
451 t = object_desc_str(t, "本");
456 t = object_desc_str(t, "巻");
461 t = object_desc_str(t, "服");
465 case TV_SORCERY_BOOK:
473 case TV_CRUSADE_BOOK:
475 case TV_HISSATSU_BOOK:
478 t = object_desc_str(t, "冊");
486 t = object_desc_str(t, "着");
493 t = object_desc_str(t, "振");
498 t = object_desc_str(t, "足");
503 t = object_desc_str(t, "枚");
509 if(o_ptr->sval == SV_FOOD_JERKY)
511 t = object_desc_str(t, "切れ");
517 if (o_ptr->number < 10)
519 t = object_desc_str(t, "つ");
523 t = object_desc_str(t, "個");
533 * @brief 対象文字配列に符号あり整数値をコピーする。
534 * @param t 保管先文字列ポインタ
538 * Print an signed number "v" into a string "t", as if by
539 * sprintf(t, "%+d", n), and return a pointer to the terminator.
540 * Note that we always print a sign, either "+" or "-".
542 static char *object_desc_int(char *t, sint v)
549 /* Take the absolute value */
552 /* Use a "minus" sign */
556 /* Positive (or zero) */
559 /* Use the actual number */
562 /* Use a "plus" sign */
566 /* Find "size" of "n" */
567 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
569 /* Dump each digit */
575 /* Remove the digit */
578 /* Process next digit */
589 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
591 typedef struct flag_insc_table
602 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
603 static flag_insc_table flag_insc_plus[] =
605 { "攻", "At", TR_BLOWS, -1 },
606 { "速", "Sp", TR_SPEED, -1 },
607 { "腕", "St", TR_STR, -1 },
608 { "知", "In", TR_INT, -1 },
609 { "賢", "Wi", TR_WIS, -1 },
610 { "器", "Dx", TR_DEX, -1 },
611 { "耐", "Cn", TR_CON, -1 },
612 { "魅", "Ch", TR_CHR, -1 },
613 { "道", "Md", TR_MAGIC_MASTERY, -1 },
614 { "隠", "Sl", TR_STEALTH, -1 },
615 { "探", "Sr", TR_SEARCH, -1 },
616 { "赤", "If", TR_INFRA, -1 },
617 { "掘", "Dg", TR_TUNNEL, -1 },
618 { NULL, NULL, 0, -1 }
621 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
622 static flag_insc_table flag_insc_immune[] =
624 { "酸", "Ac", TR_IM_ACID, -1 },
625 { "電", "El", TR_IM_ELEC, -1 },
626 { "火", "Fi", TR_IM_FIRE, -1 },
627 { "冷", "Co", TR_IM_COLD, -1 },
628 { NULL, NULL, 0, -1 }
631 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
632 static flag_insc_table flag_insc_resistance[] =
634 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
635 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
636 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
637 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
638 { "毒", "Po", TR_RES_POIS, -1 },
639 { "閃", "Li", TR_RES_LITE, -1 },
640 { "暗", "Dk", TR_RES_DARK, -1 },
641 { "破", "Sh", TR_RES_SHARDS, -1 },
642 { "盲", "Bl", TR_RES_BLIND, -1 },
643 { "乱", "Cf", TR_RES_CONF, -1 },
644 { "轟", "So", TR_RES_SOUND, -1 },
645 { "獄", "Nt", TR_RES_NETHER, -1 },
646 { "因", "Nx", TR_RES_NEXUS, -1 },
647 { "沌", "Ca", TR_RES_CHAOS, -1 },
648 { "劣", "Di", TR_RES_DISEN, -1 },
649 { "恐", "Fe", TR_RES_FEAR, -1 },
650 { NULL, NULL, 0, -1 }
653 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
654 static flag_insc_table flag_insc_misc[] =
656 { "易", "Es", TR_EASY_SPELL, -1 },
657 { "減", "Dm", TR_DEC_MANA, -1 },
658 { "投", "Th", TR_THROW, -1 },
659 { "反", "Rf", TR_REFLECT, -1 },
660 { "麻", "Fa", TR_FREE_ACT, -1 },
661 { "視", "Si", TR_SEE_INVIS, -1 },
662 { "経", "Hl", TR_HOLD_EXP, -1 },
663 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
664 { "活", "Rg", TR_REGEN, -1 },
665 { "浮", "Lv", TR_LEVITATION, -1 },
666 { "明", "Lu", TR_LITE_1, -1 },
667 { "明", "Lu", TR_LITE_2, -1 },
668 { "明", "Lu", TR_LITE_3, -1 },
669 { "闇", "Dl", TR_LITE_M1, -1 },
670 { "闇", "Dl", TR_LITE_M2, -1 },
671 { "闇", "Dl", TR_LITE_M3, -1 },
672 { "警", "Wr", TR_WARNING, -1 },
673 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
674 { "射", "Xs", TR_XTRA_SHOTS, -1 },
675 { "瞬", "Te", TR_TELEPORT, -1 },
676 { "怒", "Ag", TR_AGGRAVATE, -1 },
677 { "祝", "Bs", TR_BLESSED, -1 },
678 { "忌", "Ty", TR_TY_CURSE, -1 },
679 { "呪", "C-", TR_ADD_L_CURSE, -1 },
680 { "詛", "C+", TR_ADD_H_CURSE, -1 },
681 { NULL, NULL, 0, -1 }
684 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
685 static flag_insc_table flag_insc_aura[] =
687 { "炎", "F", TR_SH_FIRE, -1 },
688 { "電", "E", TR_SH_ELEC, -1 },
689 { "冷", "C", TR_SH_COLD, -1 },
690 { "魔", "M", TR_NO_MAGIC, -1 },
691 { "瞬", "T", TR_NO_TELE, -1 },
692 { NULL, NULL, 0, -1 }
695 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
696 static flag_insc_table flag_insc_brand[] =
698 { "酸", "A", TR_BRAND_ACID, -1 },
699 { "電", "E", TR_BRAND_ELEC, -1 },
700 { "焼", "F", TR_BRAND_FIRE, -1 },
701 { "凍", "Co", TR_BRAND_COLD, -1 },
702 { "毒", "P", TR_BRAND_POIS, -1 },
703 { "沌", "Ca", TR_CHAOTIC, -1 },
704 { "吸", "V", TR_VAMPIRIC, -1 },
705 { "震", "Q", TR_IMPACT, -1 },
706 { "切", "S", TR_VORPAL, -1 },
707 { "理", "M", TR_FORCE_WEAPON, -1 },
708 { NULL, NULL, 0, -1 }
711 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
712 static flag_insc_table flag_insc_kill[] =
714 { "邪", "*", TR_KILL_EVIL, -1 },
715 { "人", "p", TR_KILL_HUMAN, -1 },
716 { "龍", "D", TR_KILL_DRAGON, -1 },
717 { "オ", "o", TR_KILL_ORC, -1 },
718 { "ト", "T", TR_KILL_TROLL, -1 },
719 { "巨", "P", TR_KILL_GIANT, -1 },
720 { "デ", "U", TR_KILL_DEMON, -1 },
721 { "死", "L", TR_KILL_UNDEAD, -1 },
722 { "動", "Z", TR_KILL_ANIMAL, -1 },
723 { NULL, NULL, 0, -1 }
726 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
727 static flag_insc_table flag_insc_slay[] =
729 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
730 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
731 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
732 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
733 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
734 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
735 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
736 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
737 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
738 { NULL, NULL, 0, -1 }
741 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
742 static flag_insc_table flag_insc_esp1[] =
744 { "感", "Tele", TR_TELEPATHY, -1 },
745 { "邪", "Evil", TR_ESP_EVIL, -1 },
746 { "善", "Good", TR_ESP_GOOD, -1 },
747 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
748 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
749 { NULL, NULL, 0, -1 }
752 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
753 static flag_insc_table flag_insc_esp2[] =
755 { "人", "p", TR_ESP_HUMAN, -1 },
756 { "竜", "D", TR_ESP_DRAGON, -1 },
757 { "オ", "o", TR_ESP_ORC, -1 },
758 { "ト", "T", TR_ESP_TROLL, -1 },
759 { "巨", "P", TR_ESP_GIANT, -1 },
760 { "デ", "U", TR_ESP_DEMON, -1 },
761 { "死", "L", TR_ESP_UNDEAD, -1 },
762 { "動", "Z", TR_ESP_ANIMAL, -1 },
763 { NULL, NULL, 0, -1 }
766 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
767 static flag_insc_table flag_insc_sust[] =
769 { "腕", "St", TR_SUST_STR, -1 },
770 { "知", "In", TR_SUST_INT, -1 },
771 { "賢", "Wi", TR_SUST_WIS, -1 },
772 { "器", "Dx", TR_SUST_DEX, -1 },
773 { "耐", "Cn", TR_SUST_CON, -1 },
774 { "魅", "Ch", TR_SUST_CHR, -1 },
775 { NULL, NULL, 0, -1 }
779 static flag_insc_table flag_insc_plus[] =
781 { "At", TR_BLOWS, -1 },
782 { "Sp", TR_SPEED, -1 },
783 { "St", TR_STR, -1 },
784 { "In", TR_INT, -1 },
785 { "Wi", TR_WIS, -1 },
786 { "Dx", TR_DEX, -1 },
787 { "Cn", TR_CON, -1 },
788 { "Ch", TR_CHR, -1 },
789 { "Md", TR_MAGIC_MASTERY, -1 },
790 { "Sl", TR_STEALTH, -1 },
791 { "Sr", TR_SEARCH, -1 },
792 { "If", TR_INFRA, -1 },
793 { "Dg", TR_TUNNEL, -1 },
797 static flag_insc_table flag_insc_immune[] =
799 { "Ac", TR_IM_ACID, -1 },
800 { "El", TR_IM_ELEC, -1 },
801 { "Fi", TR_IM_FIRE, -1 },
802 { "Co", TR_IM_COLD, -1 },
806 static flag_insc_table flag_insc_resistance[] =
808 { "Ac", TR_RES_ACID, TR_IM_ACID },
809 { "El", TR_RES_ELEC, TR_IM_ELEC },
810 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
811 { "Co", TR_RES_COLD, TR_IM_COLD },
812 { "Po", TR_RES_POIS, -1 },
813 { "Li", TR_RES_LITE, -1 },
814 { "Dk", TR_RES_DARK, -1 },
815 { "Sh", TR_RES_SHARDS, -1 },
816 { "Bl", TR_RES_BLIND, -1 },
817 { "Cf", TR_RES_CONF, -1 },
818 { "So", TR_RES_SOUND, -1 },
819 { "Nt", TR_RES_NETHER, -1 },
820 { "Nx", TR_RES_NEXUS, -1 },
821 { "Ca", TR_RES_CHAOS, -1 },
822 { "Di", TR_RES_DISEN, -1 },
823 { "Fe", TR_RES_FEAR, -1 },
827 static flag_insc_table flag_insc_misc[] =
829 { "Es", TR_EASY_SPELL, -1 },
830 { "Dm", TR_DEC_MANA, -1 },
831 { "Th", TR_THROW, -1 },
832 { "Rf", TR_REFLECT, -1 },
833 { "Fa", TR_FREE_ACT, -1 },
834 { "Si", TR_SEE_INVIS, -1 },
835 { "Hl", TR_HOLD_EXP, -1 },
836 { "Sd", TR_SLOW_DIGEST, -1 },
837 { "Rg", TR_REGEN, -1 },
838 { "Lv", TR_LEVITATION, -1 },
839 { "Lu", TR_LITE_1, -1 },
840 { "Lu", TR_LITE_2, -1 },
841 { "Lu", TR_LITE_3, -1 },
842 { "Dl", TR_LITE_M1, -1 },
843 { "Dl", TR_LITE_M2, -1 },
844 { "Dl", TR_LITE_M3, -1 },
845 { "Wr", TR_WARNING, -1 },
846 { "Xm", TR_XTRA_MIGHT, -1 },
847 { "Xs", TR_XTRA_SHOTS, -1 },
848 { "Te", TR_TELEPORT, -1 },
849 { "Ag", TR_AGGRAVATE, -1 },
850 { "Bs", TR_BLESSED, -1 },
851 { "Ty", TR_TY_CURSE, -1 },
852 { "C-", TR_ADD_L_CURSE, -1 },
853 { "C+", TR_ADD_H_CURSE, -1 },
857 static flag_insc_table flag_insc_aura[] =
859 { "F", TR_SH_FIRE, -1 },
860 { "E", TR_SH_ELEC, -1 },
861 { "C", TR_SH_COLD, -1 },
862 { "M", TR_NO_MAGIC, -1 },
863 { "T", TR_NO_TELE, -1 },
867 static flag_insc_table flag_insc_brand[] =
869 { "A", TR_BRAND_ACID, -1 },
870 { "E", TR_BRAND_ELEC, -1 },
871 { "F", TR_BRAND_FIRE, -1 },
872 { "Co", TR_BRAND_COLD, -1 },
873 { "P", TR_BRAND_POIS, -1 },
874 { "Ca", TR_CHAOTIC, -1 },
875 { "V", TR_VAMPIRIC, -1 },
876 { "Q", TR_IMPACT, -1 },
877 { "S", TR_VORPAL, -1 },
878 { "M", TR_FORCE_WEAPON, -1 },
882 static flag_insc_table flag_insc_kill[] =
884 { "*", TR_KILL_EVIL, -1 },
885 { "p", TR_KILL_HUMAN, -1 },
886 { "D", TR_KILL_DRAGON, -1 },
887 { "o", TR_KILL_ORC, -1 },
888 { "T", TR_KILL_TROLL, -1 },
889 { "P", TR_KILL_GIANT, -1 },
890 { "U", TR_KILL_DEMON, -1 },
891 { "L", TR_KILL_UNDEAD, -1 },
892 { "Z", TR_KILL_ANIMAL, -1 },
896 static flag_insc_table flag_insc_slay[] =
898 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
899 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
900 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
901 { "o", TR_SLAY_ORC, TR_KILL_ORC },
902 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
903 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
904 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
905 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
906 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
910 static flag_insc_table flag_insc_esp1[] =
912 { "Tele", TR_TELEPATHY, -1 },
913 { "Evil", TR_ESP_EVIL, -1 },
914 { "Good", TR_ESP_GOOD, -1 },
915 { "Nolv", TR_ESP_NONLIVING, -1 },
916 { "Uniq", TR_ESP_UNIQUE, -1 },
920 static flag_insc_table flag_insc_esp2[] =
922 { "p", TR_ESP_HUMAN, -1 },
923 { "D", TR_ESP_DRAGON, -1 },
924 { "o", TR_ESP_ORC, -1 },
925 { "T", TR_ESP_TROLL, -1 },
926 { "P", TR_ESP_GIANT, -1 },
927 { "U", TR_ESP_DEMON, -1 },
928 { "L", TR_ESP_UNDEAD, -1 },
929 { "Z", TR_ESP_ANIMAL, -1 },
933 static flag_insc_table flag_insc_sust[] =
935 { "St", TR_SUST_STR, -1 },
936 { "In", TR_SUST_INT, -1 },
937 { "Wi", TR_SUST_WIS, -1 },
938 { "Dx", TR_SUST_DEX, -1 },
939 { "Cn", TR_SUST_CON, -1 },
940 { "Ch", TR_SUST_CHR, -1 },
945 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
946 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
949 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
950 * @param fi_ptr 参照する特性表示記号テーブル
951 * @param flgs 対応するオブジェクトのフラグ文字列
952 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
953 * @param ptr フラグ群を保管する文字列参照ポインタ
954 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
956 * Print an signed number "v" into a string "t", as if by
957 * sprintf(t, "%+d", n), and return a pointer to the terminator.
958 * Note that we always print a sign, either "+" or "-".
960 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
966 while (fi_ptr->english)
968 if (have_flag(flgs, fi_ptr->flag) &&
969 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
971 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
973 ADD_INSC(fi_ptr->english);
983 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
984 * @param fi_ptr 参照する特性表示記号テーブル
985 * @param flgs 対応するオブジェクトのフラグ文字列
986 * @return 1つでも該当の特性があったらTRUEを返す。
988 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
990 while (fi_ptr->english)
992 if (have_flag(flgs, fi_ptr->flag) &&
993 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1002 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1003 * @param ptr 特性短縮表記を格納する文字列ポインタ
1004 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1005 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1006 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1007 * @return ptrと同じアドレス
1009 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1011 char *prev_ptr = ptr;
1012 BIT_FLAGS flgs[TR_FLAG_SIZE];
1014 /* Extract the flags */
1015 object_flags(o_ptr, flgs);
1017 /* Remove obvious flags */
1020 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1024 for (j = 0; j < TR_FLAG_SIZE; j++)
1025 flgs[j] &= ~k_ptr->flags[j];
1027 if (object_is_fixed_artifact(o_ptr))
1029 artifact_type *a_ptr = &a_info[o_ptr->name1];
1031 for (j = 0; j < TR_FLAG_SIZE; j++)
1032 flgs[j] &= ~a_ptr->flags[j];
1035 if (object_is_ego(o_ptr))
1037 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1039 for (j = 0; j < TR_FLAG_SIZE; j++)
1040 flgs[j] &= ~e_ptr->flags[j];
1044 /* Remove lite flags when this is a dark lite object */
1045 if (have_dark_flag(flgs))
1047 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1048 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1049 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1051 else if (have_lite_flag(flgs))
1053 add_flag(flgs, TR_LITE_1);
1054 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1055 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1059 if (have_flag_of(flag_insc_plus, flgs))
1064 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1067 if (have_flag_of(flag_insc_immune, flgs))
1069 if (!kanji && ptr != prev_ptr)
1076 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1079 if (have_flag_of(flag_insc_resistance, flgs))
1083 else if (ptr != prev_ptr)
1089 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1092 if (have_flag_of(flag_insc_misc, flgs))
1094 if (ptr != prev_ptr)
1100 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1103 if (have_flag_of(flag_insc_aura, flgs))
1107 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1110 if (have_flag_of(flag_insc_brand, flgs))
1112 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1115 if (have_flag_of(flag_insc_kill, flgs))
1117 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1120 if (have_flag_of(flag_insc_slay, flgs))
1122 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1127 if (have_flag_of(flag_insc_esp1, flgs) ||
1128 have_flag_of(flag_insc_esp2, flgs))
1130 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1131 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1135 if (have_flag_of(flag_insc_esp1, flgs))
1137 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1138 if (have_flag_of(flag_insc_esp2, flgs))
1140 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1144 if (have_flag_of(flag_insc_sust, flgs))
1148 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1157 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1158 * @param buff 特性短縮表記を格納する文字列ポインタ
1159 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1162 static void get_inscription(char *buff, object_type *o_ptr)
1164 cptr insc = quark_str(o_ptr->inscription);
1167 /* Not fully identified */
1168 if (!(o_ptr->ident & IDENT_MENTAL))
1170 /* Copy until end of line or '#' */
1173 if (*insc == '#') break;
1175 if (iskanji(*insc)) *buff++ = *insc++;
1185 for (; *insc; insc++)
1187 /* Ignore fake artifact inscription */
1188 if (*insc == '#') break;
1190 /* {%} will be automatically converted */
1191 else if ('%' == *insc)
1197 /* check for too long inscription */
1198 if (ptr >= buff + MAX_NLEN) continue;
1211 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1221 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1235 * @brief オブジェクトがクエストの達成目的か否かを返す。
1236 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1237 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1239 bool object_is_quest_target(object_type *o_ptr)
1241 if (p_ptr->inside_quest)
1243 ARTIFACT_IDX a_idx = quest[p_ptr->inside_quest].k_idx;
1246 artifact_type *a_ptr = &a_info[a_idx];
1247 if (!(a_ptr->gen_flags & TRG_INSTA_ART))
1249 if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
1261 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1262 * @param buf 表記を返すための文字列参照ポインタ
1263 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1264 * @param mode 表記に関するオプション指定
1265 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1267 * One can choose the "verbosity" of the description, including whether\n
1268 * or not the "number" of items should be described, and how much detail\n
1269 * should be used when describing the item.\n
1271 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1272 * description, which can get pretty long, including incriptions, such as:\n
1273 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1274 * Note that the inscription will be clipped to keep the total description\n
1275 * under MAX_NLEN-1 chars (plus a terminator).\n
1277 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1278 * portable, versions of some common "sprintf()" commands.\n
1280 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1281 * the item is also an artifact, which should NEVER happen.\n
1283 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1284 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1285 * The "Specials" never use "modifiers" if they are "known", since they\n
1286 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1288 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1289 * plus the artifact name, just like any other artifact, if known.\n
1291 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1292 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1293 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1294 * they will append the artifact name, just like any artifact, if known.\n
1296 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1299 * OD_NAME_ONLY : The Cloak of Death\n
1300 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1301 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1302 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1304 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1305 * OD_NO_PLURAL : Forbidden use of plural \n
1306 * OD_STORE : Assume to be aware and known\n
1307 * OD_NO_FLAVOR : Allow to hidden flavor\n
1308 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1310 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1312 /* Extract object kind name */
1313 cptr kindname = k_name + k_info[o_ptr->k_idx].name;
1315 /* Extract default "base" string */
1316 cptr basenm = kindname;
1318 /* Assume no "modifier" string */
1328 bool show_weapon = FALSE;
1329 bool show_armour = FALSE;
1334 char p1 = '(', p2 = ')';
1335 char b1 = '[', b2 = ']';
1336 char c1 = '{', c2 = '}';
1338 char tmp_val[MAX_NLEN+160];
1339 char tmp_val2[MAX_NLEN+10];
1340 char fake_insc_buf[30];
1342 BIT_FLAGS flgs[TR_FLAG_SIZE];
1344 object_type *bow_ptr;
1346 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1347 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1349 /* Extract some flags */
1350 object_flags(o_ptr, flgs);
1352 /* See if the object is "aware" */
1353 if (object_is_aware(o_ptr)) aware = TRUE;
1355 /* See if the object is "known" */
1356 if (object_is_known(o_ptr)) known = TRUE;
1358 /* Allow flavors to be hidden when aware */
1359 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1361 /* Object is in the inventory of a store or spoiler */
1362 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1364 /* Don't show flavors */
1367 /* Pretend known and aware */
1372 /* Force to be flavor name only */
1373 if (mode & OD_FORCE_FLAVOR)
1379 /* Cancel shuffling */
1380 flavor_k_ptr = k_ptr;
1383 /* Analyze the object */
1384 switch (o_ptr->tval)
1386 /* Some objects are easy to describe */
1400 monster_race *r_ptr = &r_info[o_ptr->pval];
1406 modstr = _(" (空)", " (empty)");
1411 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1414 cptr t = r_name + r_ptr->name;
1416 if (!(r_ptr->flags1 & RF1_UNIQUE))
1418 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1424 sprintf(tmp_val2, "(%s)", t);
1434 /* Figurines/Statues */
1438 monster_race *r_ptr = &r_info[o_ptr->pval];
1441 modstr = r_name + r_ptr->name;
1443 cptr t = r_name + r_ptr->name;
1445 if (!(r_ptr->flags1 & RF1_UNIQUE))
1447 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1464 monster_race *r_ptr = &r_info[o_ptr->pval];
1466 modstr = r_name + r_ptr->name;
1471 if (r_ptr->flags1 & RF1_UNIQUE)
1472 basenm = "& % of #";
1480 /* Missiles/ Bows/ Weapons */
1509 /* Lites (including a few "Specials") */
1515 /* Amulets (including a few "Specials") */
1518 /* Known artifacts */
1521 if (object_is_fixed_artifact(o_ptr)) break;
1522 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1525 /* Color the object */
1526 modstr = k_name + flavor_k_ptr->flavor_name;
1529 if (!flavor) basenm = "%のアミュレット";
1530 else if (aware) basenm = "%の#アミュレット";
1531 else basenm = "#アミュレット";
1533 if (!flavor) basenm = "& Amulet~ of %";
1534 else if (aware) basenm = "& # Amulet~ of %";
1535 else basenm = "& # Amulet~";
1541 /* Rings (including a few "Specials") */
1544 /* Known artifacts */
1547 if (object_is_fixed_artifact(o_ptr)) break;
1548 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1551 /* Color the object */
1552 modstr = k_name + flavor_k_ptr->flavor_name;
1555 if (!flavor) basenm = "%の指輪";
1556 else if (aware) basenm = "%の#指輪";
1557 else basenm = "#指輪";
1559 if (!flavor) basenm = "& Ring~ of %";
1560 else if (aware) basenm = "& # Ring~ of %";
1561 else basenm = "& # Ring~";
1564 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1576 /* Color the object */
1577 modstr = k_name + flavor_k_ptr->flavor_name;
1580 if (!flavor) basenm = "%の杖";
1581 else if (aware) basenm = "%の#杖";
1584 if (!flavor) basenm = "& Staff~ of %";
1585 else if (aware) basenm = "& # Staff~ of %";
1586 else basenm = "& # Staff~";
1594 /* Color the object */
1595 modstr = k_name + flavor_k_ptr->flavor_name;
1598 if (!flavor) basenm = "%の魔法棒";
1599 else if (aware) basenm = "%の#魔法棒";
1600 else basenm = "#魔法棒";
1602 if (!flavor) basenm = "& Wand~ of %";
1603 else if (aware) basenm = "& # Wand~ of %";
1604 else basenm = "& # Wand~";
1612 /* Color the object */
1613 modstr = k_name + flavor_k_ptr->flavor_name;
1616 if (!flavor) basenm = "%のロッド";
1617 else if (aware) basenm = "%の#ロッド";
1618 else basenm = "#ロッド";
1620 if (!flavor) basenm = "& Rod~ of %";
1621 else if (aware) basenm = "& # Rod~ of %";
1622 else basenm = "& # Rod~";
1630 /* Color the object */
1631 modstr = k_name + flavor_k_ptr->flavor_name;
1634 if (!flavor) basenm = "%の巻物";
1635 else if (aware) basenm = "「#」と書かれた%の巻物";
1636 else basenm = "「#」と書かれた巻物";
1638 if (!flavor) basenm = "& Scroll~ of %";
1639 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1640 else basenm = "& Scroll~ titled \"#\"";
1648 /* Color the object */
1649 modstr = k_name + flavor_k_ptr->flavor_name;
1652 if (!flavor) basenm = "%の薬";
1653 else if (aware) basenm = "%の#薬";
1656 if (!flavor) basenm = "& Potion~ of %";
1657 else if (aware) basenm = "& # Potion~ of %";
1658 else basenm = "& # Potion~";
1666 /* Ordinary food is "boring" */
1667 if (!k_ptr->flavor_name) break;
1669 /* Color the object */
1670 modstr = k_name + flavor_k_ptr->flavor_name;
1673 if (!flavor) basenm = "%のキノコ";
1674 else if (aware) basenm = "%の#キノコ";
1675 else basenm = "#キノコ";
1677 if (!flavor) basenm = "& Mushroom~ of %";
1678 else if (aware) basenm = "& # Mushroom~ of %";
1679 else basenm = "& # Mushroom~";
1687 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1697 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1698 basenm = "& Book~ of Life Magic %";
1700 basenm = "& Life Spellbook~ %";
1706 case TV_SORCERY_BOOK:
1711 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1712 basenm = "& Book~ of Sorcery %";
1714 basenm = "& Sorcery Spellbook~ %";
1720 case TV_NATURE_BOOK:
1725 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1726 basenm = "& Book~ of Nature Magic %";
1728 basenm = "& Nature Spellbook~ %";
1737 basenm = "カオスの魔法書%";
1739 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1740 basenm = "& Book~ of Chaos Magic %";
1742 basenm = "& Chaos Spellbook~ %";
1753 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1754 basenm = "& Book~ of Death Magic %";
1756 basenm = "& Death Spellbook~ %";
1765 basenm = "トランプの魔法書%";
1767 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1768 basenm = "& Book~ of Trump Magic %";
1770 basenm = "& Trump Spellbook~ %";
1776 case TV_ARCANE_BOOK:
1781 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1782 basenm = "& Book~ of Arcane Magic %";
1784 basenm = "& Arcane Spellbook~ %";
1795 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1796 basenm = "& Book~ of Craft Magic %";
1798 basenm = "& Craft Spellbook~ %";
1804 case TV_DAEMON_BOOK:
1809 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1810 basenm = "& Book~ of Daemon Magic %";
1812 basenm = "& Daemon Spellbook~ %";
1818 case TV_CRUSADE_BOOK:
1823 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1824 basenm = "& Book~ of Crusade Magic %";
1826 basenm = "& Crusade Spellbook~ %";
1834 basenm = _("歌集%", "& Song Book~ %");
1838 case TV_HISSATSU_BOOK:
1840 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1849 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1850 basenm = "& Book~ of Hex Magic %";
1852 basenm = "& Hex Spellbook~ %";
1858 /* Hack -- Gold/Gems */
1861 strcpy(buf, basenm);
1865 /* Used in the "inventory" routine */
1868 strcpy(buf, _("(なし)", "(nothing)"));
1873 /* Use full name from k_info or a_info */
1874 if (aware && have_flag(flgs, TR_FULL_NAME))
1876 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1877 else basenm = kindname;
1880 /* Start dumping the result */
1884 if (basenm[0] == '&')
1890 if (mode & OD_OMIT_PREFIX)
1894 else if (o_ptr->number > 1)
1896 t = object_desc_kosuu(t, o_ptr);
1897 t = object_desc_str(t, "の ");
1900 /* 英語の場合アーティファクトは The が付くので分かるが
1901 * 日本語では分からないのでマークをつける
1905 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1906 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1911 /* The object "expects" a "number" */
1912 if (basenm[0] == '&')
1914 /* Skip the ampersand (and space) */
1918 if (mode & OD_OMIT_PREFIX)
1923 /* Hack -- None left */
1924 else if (o_ptr->number <= 0)
1926 t = object_desc_str(t, "no more ");
1929 /* Extract the number */
1930 else if (o_ptr->number > 1)
1932 t = object_desc_num(t, o_ptr->number);
1933 t = object_desc_chr(t, ' ');
1936 /* Hack -- The only one of its kind */
1937 else if ((known && object_is_artifact(o_ptr)) ||
1938 ((o_ptr->tval == TV_CORPSE) &&
1939 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1941 t = object_desc_str(t, "The ");
1951 case '#': vowel = is_a_vowel(modstr[0]); break;
1952 case '%': vowel = is_a_vowel(*kindname); break;
1953 default: vowel = is_a_vowel(*s); break;
1958 /* A single one, with a vowel */
1959 t = object_desc_str(t, "an ");
1963 /* A single one, without a vowel */
1964 t = object_desc_str(t, "a ");
1969 /* Hack -- objects that "never" take an article */
1976 if (mode & OD_OMIT_PREFIX)
1981 /* Hack -- all gone */
1982 else if (o_ptr->number <= 0)
1984 t = object_desc_str(t, "no more ");
1987 /* Prefix a number if required */
1988 else if (o_ptr->number > 1)
1990 t = object_desc_num(t, o_ptr->number);
1991 t = object_desc_chr(t, ' ');
1994 /* Hack -- The only one of its kind */
1995 else if (known && object_is_artifact(o_ptr))
1997 t = object_desc_str(t, "The ");
2000 /* Hack -- single items get no prefix */
2008 /* Paranoia -- skip illegal tildes */
2009 /* while (*s == '~') s++; */
2012 if (object_is_smith(o_ptr))
2014 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2017 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2021 if (o_ptr->art_name)
2023 cptr temp = quark_str(o_ptr->art_name);
2025 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2026 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2027 if (strncmp(temp, "of ", 3) == 0)
2029 t = object_desc_str(t, &temp[3]);
2030 t = object_desc_str(t, "の");
2032 else if ((strncmp(temp, "『", 2) != 0) &&
2033 (strncmp(temp, "《", 2) != 0) &&
2035 t = object_desc_str(t, temp);
2038 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2040 artifact_type *a_ptr = &a_info[o_ptr->name1];
2041 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2042 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2044 t = object_desc_str(t, a_name + a_ptr->name);
2048 else if (object_is_ego(o_ptr))
2050 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2051 t = object_desc_str(t, e_name + e_ptr->name);
2056 /* Copy the string */
2057 for (s0 = NULL; *s || s0; )
2059 /* The end of the flavour/kind string. */
2066 /* Begin to append the modifier (flavor) */
2067 else if ((*s == '#') && !s0)
2072 /* Paranoia -- Never append multiple modstrs */
2076 /* Begin to append the kind name */
2077 else if ((*s == '%') && !s0)
2082 /* Paranoia -- Never append multiple kindnames */
2090 /* Add a plural if needed */
2091 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2097 /* Hack -- "Cutlass-es" and "Torch-es" */
2098 if ((k == 's') || (k == 'h')) *t++ = 'e';
2120 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2123 /* ランダムアーティファクトの名前はセーブファイルに記録
2124 されるので、英語版の名前もそれらしく変換する */
2125 if (o_ptr->art_name)
2129 strcpy(temp, quark_str(o_ptr->art_name));
2130 /* MEGA HACK by ita */
2131 if (strncmp(temp, "『", 2) == 0 ||
2132 strncmp(temp, "《", 2) == 0)
2133 t = object_desc_str(t, temp);
2134 else if (temp[0] == '\'')
2136 itemp = strlen(temp);
2137 temp[itemp - 1] = 0;
2138 t = object_desc_str(t, "『");
2139 t = object_desc_str(t, &temp[1]);
2140 t = object_desc_str(t, "』");
2143 else if (object_is_fixed_artifact(o_ptr))
2145 artifact_type *a_ptr = &a_info[o_ptr->name1];
2146 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2148 t = object_desc_str(t, a_name + a_ptr->name);
2151 else if (o_ptr->inscription)
2153 cptr str = quark_str(o_ptr->inscription);
2162 if (*str == '#') break;
2168 cptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2170 /* Add the false name */
2171 t = object_desc_str(t,"『");
2172 t = object_desc_str(t, &str_aux[1]);
2173 t = object_desc_str(t,"』");
2178 if (object_is_smith(o_ptr))
2180 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2183 /* Hack -- Append "Artifact" or "Special" names */
2184 if (known && !have_flag(flgs, TR_FULL_NAME))
2186 /* Is it a new random artifact ? */
2187 if (o_ptr->art_name)
2189 t = object_desc_chr(t, ' ');
2190 t = object_desc_str(t, quark_str(o_ptr->art_name));
2193 /* Grab any artifact name */
2194 else if (object_is_fixed_artifact(o_ptr))
2196 artifact_type *a_ptr = &a_info[o_ptr->name1];
2198 t = object_desc_chr(t, ' ');
2199 t = object_desc_str(t, a_name + a_ptr->name);
2202 /* Grab any ego-item name */
2205 if (object_is_ego(o_ptr))
2207 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2209 t = object_desc_chr(t, ' ');
2210 t = object_desc_str(t, e_name + e_ptr->name);
2213 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2216 cptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2218 /* Add the false name */
2219 t = object_desc_chr(t, ' ');
2220 t = object_desc_str(t, &str[1]);
2227 /* No more details wanted */
2228 if (mode & OD_NAME_ONLY) goto object_desc_done;
2230 /* Hack -- Chests must be described in detail */
2231 if (o_ptr->tval == TV_CHEST)
2233 /* Not searched yet */
2239 /* May be "empty" */
2240 else if (!o_ptr->pval)
2242 t = object_desc_str(t, _("(空)", " (empty)"));
2245 /* May be "disarmed" */
2246 else if (o_ptr->pval < 0)
2248 if (chest_traps[0 - o_ptr->pval])
2250 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2254 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2258 /* Describe the traps, if any */
2261 /* Describe the traps */
2262 switch (chest_traps[o_ptr->pval])
2266 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2269 case CHEST_LOSE_STR:
2271 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2274 case CHEST_LOSE_CON:
2276 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2281 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2284 case CHEST_PARALYZE:
2286 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2291 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2295 case CHEST_BIRD_STORM:
2296 case CHEST_E_SUMMON:
2297 case CHEST_H_SUMMON:
2299 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2302 case CHEST_RUNES_OF_EVIL:
2304 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2309 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2314 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2322 /* Display the item like a weapon */
2323 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2325 /* Display the item like a weapon */
2326 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2329 /* Display the item like a weapon */
2330 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2332 /* Display the item like armour */
2333 if (o_ptr->ac) show_armour = TRUE;
2336 /* Dump base weapon info */
2337 switch (o_ptr->tval)
2339 /* Missiles and Weapons */
2348 /* In Vault Quest, hide the dice of target weapon. */
2349 if(object_is_quest_target(o_ptr) && !known)
2354 /* Append a "damage" string */
2355 t = object_desc_chr(t, ' ');
2356 t = object_desc_chr(t, p1);
2357 t = object_desc_num(t, o_ptr->dd);
2358 t = object_desc_chr(t, 'd');
2359 t = object_desc_num(t, o_ptr->ds);
2360 t = object_desc_chr(t, p2);
2366 /* Bows get a special "damage string" */
2369 /* Mega-Hack -- Extract the "base power" */
2370 power = bow_tmul(o_ptr->sval);
2372 /* Apply the "Extra Might" flag */
2373 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2375 /* Append a special "damage" string */
2376 t = object_desc_chr(t, ' ');
2377 t = object_desc_chr(t, p1);
2378 t = object_desc_chr(t, 'x');
2379 t = object_desc_num(t, power);
2380 t = object_desc_chr(t, p2);
2382 fire_rate = calc_num_fire(o_ptr);
2383 /* Show Fire rate */
2384 if (fire_rate != 0 && power > 0 && known)
2386 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2388 t = object_desc_chr(t, ' ');
2389 t = object_desc_chr(t, p1);
2390 t = object_desc_num(t, fire_rate/100);
2391 t = object_desc_chr(t, '.');
2392 t = object_desc_num(t, fire_rate%100);
2393 t = object_desc_str(t, "turn");
2394 t = object_desc_chr(t, p2);
2402 /* Add the weapon bonuses */
2405 /* Show the tohit/todam on request */
2408 t = object_desc_chr(t, ' ');
2409 t = object_desc_chr(t, p1);
2410 t = object_desc_int(t, o_ptr->to_h);
2411 t = object_desc_chr(t, ',');
2412 t = object_desc_int(t, o_ptr->to_d);
2413 t = object_desc_chr(t, p2);
2416 /* Show the tohit if needed */
2417 else if (o_ptr->to_h)
2419 t = object_desc_chr(t, ' ');
2420 t = object_desc_chr(t, p1);
2421 t = object_desc_int(t, o_ptr->to_h);
2422 t = object_desc_chr(t, p2);
2425 /* Show the todam if needed */
2426 else if (o_ptr->to_d)
2428 t = object_desc_chr(t, ' ');
2429 t = object_desc_chr(t, p1);
2430 t = object_desc_int(t, o_ptr->to_d);
2431 t = object_desc_chr(t, p2);
2435 bow_ptr = &inventory[INVEN_BOW];
2437 /* If have a firing weapon + ammo matches bow */
2438 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2440 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2441 int tmul = bow_tmul(bow_ptr->sval);
2442 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2444 /* See if the bow is "known" - then set damage bonus */
2445 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2447 /* Effect of ammo */
2448 if (known) avgdam += (o_ptr->to_d * 10);
2450 /* Get extra "power" from "extra might" */
2451 if (p_ptr->xtra_might) tmul++;
2453 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2455 /* Launcher multiplier */
2457 avgdam /= (100 * 10);
2459 /* Get extra damage from concentration */
2460 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2462 if (avgdam < 0) avgdam = 0;
2464 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2465 t = object_desc_chr(t, ' ');
2466 t = object_desc_chr(t, p1);
2468 if(show_ammo_no_crit)
2470 /* Damage with no-crit */
2471 t = object_desc_num(t, avgdam);
2472 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2475 /* Apply Expect damage of Critical */
2476 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2477 t = object_desc_num(t, avgdam);
2479 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2480 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2482 if (p_ptr->num_fire == 0)
2484 t = object_desc_chr(t, '0');
2488 /* Calc effects of energy */
2489 avgdam *= (p_ptr->num_fire * 100);
2490 avgdam /= energy_fire;
2491 t = object_desc_num(t, avgdam);
2492 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2494 if(show_ammo_crit_ratio)
2496 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2498 t = object_desc_chr(t, '/');
2499 t = object_desc_num(t, percent / 100);
2500 t = object_desc_chr(t, '.');
2501 if(percent % 100 < 10)
2503 t = object_desc_chr(t, '0');
2505 t = object_desc_num(t, percent % 100);
2506 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2510 t = object_desc_chr(t, p2);
2512 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2514 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2515 s16b energy_fire = 100 - p_ptr->lev;
2517 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2519 /* Display (shot damage/ avg damage) */
2520 t = object_desc_chr(t, ' ');
2521 t = object_desc_chr(t, p1);
2522 t = object_desc_num(t, avgdam);
2523 t = object_desc_chr(t, '/');
2525 /* Calc effects of energy */
2526 avgdam = 100 * avgdam / energy_fire;
2528 t = object_desc_num(t, avgdam);
2529 t = object_desc_chr(t, p2);
2532 /* Add the armor bonuses */
2535 /* Show the armor class info */
2538 t = object_desc_chr(t, ' ');
2539 t = object_desc_chr(t, b1);
2540 t = object_desc_num(t, o_ptr->ac);
2541 t = object_desc_chr(t, ',');
2542 t = object_desc_int(t, o_ptr->to_a);
2543 t = object_desc_chr(t, b2);
2546 /* No base armor, but does increase armor */
2547 else if (o_ptr->to_a)
2549 t = object_desc_chr(t, ' ');
2550 t = object_desc_chr(t, b1);
2551 t = object_desc_int(t, o_ptr->to_a);
2552 t = object_desc_chr(t, b2);
2556 /* Hack -- always show base armor */
2557 else if (show_armour)
2559 t = object_desc_chr(t, ' ');
2560 t = object_desc_chr(t, b1);
2561 t = object_desc_num(t, o_ptr->ac);
2562 t = object_desc_chr(t, b2);
2566 /* No more details wanted */
2567 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2570 if (known) /* Known item only */
2573 * Hack -- Wands and Staffs have charges. Make certain how many charges
2574 * a stack of staffs really has is clear. -LM-
2576 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2578 /* Dump " (N charges)" */
2579 t = object_desc_chr(t, ' ');
2580 t = object_desc_chr(t, p1);
2582 /* Clear explaination for staffs. */
2583 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2585 t = object_desc_num(t, o_ptr->number);
2586 t = object_desc_str(t, "x ");
2588 t = object_desc_num(t, o_ptr->pval);
2590 t = object_desc_str(t, "回分");
2592 t = object_desc_str(t, " charge");
2593 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2596 t = object_desc_chr(t, p2);
2598 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2599 * be in any state of charge or discharge, this now includes a number. -LM-
2601 else if (o_ptr->tval == TV_ROD)
2603 /* Hack -- Dump " (# charging)" if relevant */
2606 /* Stacks of rods display an exact count of charging rods. */
2607 if (o_ptr->number > 1)
2610 if (k_ptr->pval == 0) k_ptr->pval = 1;
2612 /* Find out how many rods are charging, by dividing
2613 * current timeout by each rod's maximum timeout.
2614 * Ensure that any remainder is rounded up. Display
2615 * very discharged stacks as merely fully discharged.
2617 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2618 if (power > o_ptr->number) power = o_ptr->number;
2620 /* Display prettily. */
2621 t = object_desc_str(t, " (");
2622 t = object_desc_num(t, power);
2623 t = object_desc_str(t, _("本 充填中)", " charging)"));
2626 /* "one Rod of Perception (1 charging)" would look tacky. */
2629 t = object_desc_str(t, _("(充填中)", " (charging)"));
2634 /* Dump "pval" flags for wearable items */
2635 if (have_pval_flags(flgs))
2637 /* Start the display */
2638 t = object_desc_chr(t, ' ');
2639 t = object_desc_chr(t, p1);
2641 /* Dump the "pval" itself */
2642 t = object_desc_int(t, o_ptr->pval);
2644 /* Do not display the "pval" flags */
2645 if (have_flag(flgs, TR_HIDE_TYPE))
2651 else if (have_flag(flgs, TR_SPEED))
2653 /* Dump " to speed" */
2654 t = object_desc_str(t, _("加速", " to speed"));
2658 else if (have_flag(flgs, TR_BLOWS))
2662 t = object_desc_str(t, "攻撃");
2664 t = object_desc_str(t, " attack");
2667 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2672 else if (have_flag(flgs, TR_STEALTH))
2674 /* Dump " to stealth" */
2675 t = object_desc_str(t, _("隠密", " to stealth"));
2679 else if (have_flag(flgs, TR_SEARCH))
2681 /* Dump " to searching" */
2682 t = object_desc_str(t, _("探索", " to searching"));
2686 else if (have_flag(flgs, TR_INFRA))
2688 /* Dump " to infravision" */
2689 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2692 /* Finish the display */
2693 t = object_desc_chr(t, p2);
2696 /* Hack -- Process Lanterns/Torches */
2697 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2699 /* Hack -- Turns of light for normal lites */
2701 t = object_desc_chr(t, '(');
2703 t = object_desc_str(t, " (with ");
2706 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2707 else t = object_desc_num(t, o_ptr->xtra4);
2708 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2711 /* Indicate charging objects, but not rods. */
2712 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2714 /* Hack -- Dump " (charging)" if relevant */
2715 t = object_desc_str(t, _("(充填中)", " (charging)"));
2720 /* No more details wanted */
2721 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2724 /* Prepare real inscriptions in a buffer */
2727 /* Auto abbreviation inscribe */
2728 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2730 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2741 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2745 /* Use the standard inscription if available */
2746 if (o_ptr->inscription)
2750 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2752 /* Get inscription and convert {%} */
2753 get_inscription(buff, o_ptr);
2755 /* strcat with correct treating of kanji */
2756 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2760 /* No fake inscription yet */
2761 fake_insc_buf[0] = '\0';
2763 /* Use the game-generated "feeling" otherwise, if available */
2766 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2769 /* Note "cursed" if the item is known to be cursed */
2770 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2772 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2775 /* Note "unidentified" if the item is unidentified */
2776 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2777 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2779 && !(o_ptr->ident & IDENT_SENSE))
2781 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2784 /* Mega-Hack -- note empty wands/staffs */
2785 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2787 strcpy(fake_insc_buf, _("空", "empty"));
2790 /* Note "tried" if the object has been tested unsuccessfully */
2791 else if (!aware && object_is_tried(o_ptr))
2793 strcpy(fake_insc_buf, _("未判明", "tried"));
2796 /* Note the discount, if any */
2797 if (o_ptr->discount)
2799 /* Hidden by real inscription unless in a store */
2800 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2802 char discount_num_buf[4];
2804 /* Append to other fake inscriptions if any */
2805 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2807 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2808 strcat(fake_insc_buf, discount_num_buf);
2809 strcat(fake_insc_buf, _("%引き", "% off"));
2814 /* Append the inscription, if any */
2815 if (fake_insc_buf[0] || tmp_val2[0])
2817 /* Append the inscription */
2818 t = object_desc_chr(t, ' ');
2819 t = object_desc_chr(t, c1);
2821 /* Append fake inscriptions */
2822 if (fake_insc_buf[0])
2824 t = object_desc_str(t, fake_insc_buf);
2827 /* Append a separater */
2828 if (fake_insc_buf[0] && tmp_val2[0])
2830 t = object_desc_chr(t, ',');
2831 t = object_desc_chr(t, ' ');
2834 /* Append real inscriptions */
2837 t = object_desc_str(t, tmp_val2);
2840 t = object_desc_chr(t, c2);
2844 my_strcpy(buf, tmp_val, MAX_NLEN);