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
14 #include "player-status.h"
17 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
19 * @return 簡易名称を明らかにするならTRUEを返す。
21 * This function is used only by "flavor_init()"
23 static bool object_easy_know(int i)
25 object_kind *k_ptr = &k_info[i];
27 /* Analyze the "tval" */
42 case TV_HISSATSU_BOOK:
59 /* 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 concptr 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(OBJECT_TYPE_VALUE tval)
204 KIND_OBJECT_IDX *k_idx_list;
205 KIND_OBJECT_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, KIND_OBJECT_IDX);
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)
374 * @brief 対象文字配列に文字列をコピーする。
375 * @param t 保管先文字列ポインタ
376 * @param s コピーしたい文字列ポインタ
379 * Print a string "s" into a string "t", as if by strcpy(t, s),
380 * and return a pointer to the terminator.
382 static char *object_desc_str(char *t, concptr s)
384 /* Copy the string */
385 while (*s) *t++ = *s++;
393 * @brief 対象文字配列に符号なし整数値をコピーする。
394 * @param t 保管先文字列ポインタ
398 * Print an unsigned number "n" into a string "t", as if by
399 * sprintf(t, "%u", n), and return a pointer to the terminator.
401 static char *object_desc_num(char *t, uint n)
405 /* Find "size" of "n" */
406 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
408 /* Dump each digit */
414 /* Remove the digit */
417 /* Process next digit */
431 * @brief 日本語の個数表示ルーチン
432 * @param t 保管先文字列ポインタ
433 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
436 * cmd1.c で流用するために object_desc_japanese から移動した。
438 char *object_desc_kosuu(char *t, object_type *o_ptr)
440 t = object_desc_num(t, o_ptr->number);
452 t = object_desc_str(t, "本");
457 t = object_desc_str(t, "巻");
462 t = object_desc_str(t, "服");
466 case TV_SORCERY_BOOK:
474 case TV_CRUSADE_BOOK:
476 case TV_HISSATSU_BOOK:
479 t = object_desc_str(t, "冊");
487 t = object_desc_str(t, "着");
494 t = object_desc_str(t, "振");
499 t = object_desc_str(t, "足");
504 t = object_desc_str(t, "枚");
510 if(o_ptr->sval == SV_FOOD_JERKY)
512 t = object_desc_str(t, "切れ");
518 if (o_ptr->number < 10)
520 t = object_desc_str(t, "つ");
524 t = object_desc_str(t, "個");
534 * @brief 対象文字配列に符号あり整数値をコピーする。
535 * @param t 保管先文字列ポインタ
539 * Print an signed number "v" into a string "t", as if by
540 * sprintf(t, "%+d", n), and return a pointer to the terminator.
541 * Note that we always print a sign, either "+" or "-".
543 static char *object_desc_int(char *t, sint v)
550 /* Take the absolute value */
553 /* Use a "minus" sign */
557 /* Positive (or zero) */
560 /* Use the actual number */
563 /* Use a "plus" sign */
567 /* Find "size" of "n" */
568 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
570 /* Dump each digit */
576 /* Remove the digit */
579 /* Process next digit */
590 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
592 typedef struct flag_insc_table
603 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
604 static flag_insc_table flag_insc_plus[] =
606 { "攻", "At", TR_BLOWS, -1 },
607 { "速", "Sp", TR_SPEED, -1 },
608 { "腕", "St", TR_STR, -1 },
609 { "知", "In", TR_INT, -1 },
610 { "賢", "Wi", TR_WIS, -1 },
611 { "器", "Dx", TR_DEX, -1 },
612 { "耐", "Cn", TR_CON, -1 },
613 { "魅", "Ch", TR_CHR, -1 },
614 { "道", "Md", TR_MAGIC_MASTERY, -1 },
615 { "隠", "Sl", TR_STEALTH, -1 },
616 { "探", "Sr", TR_SEARCH, -1 },
617 { "赤", "If", TR_INFRA, -1 },
618 { "掘", "Dg", TR_TUNNEL, -1 },
619 { NULL, NULL, 0, -1 }
622 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
623 static flag_insc_table flag_insc_immune[] =
625 { "酸", "Ac", TR_IM_ACID, -1 },
626 { "電", "El", TR_IM_ELEC, -1 },
627 { "火", "Fi", TR_IM_FIRE, -1 },
628 { "冷", "Co", TR_IM_COLD, -1 },
629 { NULL, NULL, 0, -1 }
632 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
633 static flag_insc_table flag_insc_resistance[] =
635 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
636 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
637 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
638 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
639 { "毒", "Po", TR_RES_POIS, -1 },
640 { "閃", "Li", TR_RES_LITE, -1 },
641 { "暗", "Dk", TR_RES_DARK, -1 },
642 { "破", "Sh", TR_RES_SHARDS, -1 },
643 { "盲", "Bl", TR_RES_BLIND, -1 },
644 { "乱", "Cf", TR_RES_CONF, -1 },
645 { "轟", "So", TR_RES_SOUND, -1 },
646 { "獄", "Nt", TR_RES_NETHER, -1 },
647 { "因", "Nx", TR_RES_NEXUS, -1 },
648 { "沌", "Ca", TR_RES_CHAOS, -1 },
649 { "劣", "Di", TR_RES_DISEN, -1 },
650 { "恐", "Fe", TR_RES_FEAR, -1 },
651 { NULL, NULL, 0, -1 }
654 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
655 static flag_insc_table flag_insc_misc[] =
657 { "易", "Es", TR_EASY_SPELL, -1 },
658 { "減", "Dm", TR_DEC_MANA, -1 },
659 { "投", "Th", TR_THROW, -1 },
660 { "反", "Rf", TR_REFLECT, -1 },
661 { "麻", "Fa", TR_FREE_ACT, -1 },
662 { "視", "Si", TR_SEE_INVIS, -1 },
663 { "経", "Hl", TR_HOLD_EXP, -1 },
664 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
665 { "活", "Rg", TR_REGEN, -1 },
666 { "浮", "Lv", TR_LEVITATION, -1 },
667 { "明", "Lu", TR_LITE_1, -1 },
668 { "明", "Lu", TR_LITE_2, -1 },
669 { "明", "Lu", TR_LITE_3, -1 },
670 { "闇", "Dl", TR_LITE_M1, -1 },
671 { "闇", "Dl", TR_LITE_M2, -1 },
672 { "闇", "Dl", TR_LITE_M3, -1 },
673 { "警", "Wr", TR_WARNING, -1 },
674 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
675 { "射", "Xs", TR_XTRA_SHOTS, -1 },
676 { "瞬", "Te", TR_TELEPORT, -1 },
677 { "怒", "Ag", TR_AGGRAVATE, -1 },
678 { "祝", "Bs", TR_BLESSED, -1 },
679 { "忌", "Ty", TR_TY_CURSE, -1 },
680 { "呪", "C-", TR_ADD_L_CURSE, -1 },
681 { "詛", "C+", TR_ADD_H_CURSE, -1 },
682 { NULL, NULL, 0, -1 }
685 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
686 static flag_insc_table flag_insc_aura[] =
688 { "炎", "F", TR_SH_FIRE, -1 },
689 { "電", "E", TR_SH_ELEC, -1 },
690 { "冷", "C", TR_SH_COLD, -1 },
691 { "魔", "M", TR_NO_MAGIC, -1 },
692 { "瞬", "T", TR_NO_TELE, -1 },
693 { NULL, NULL, 0, -1 }
696 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
697 static flag_insc_table flag_insc_brand[] =
699 { "酸", "A", TR_BRAND_ACID, -1 },
700 { "電", "E", TR_BRAND_ELEC, -1 },
701 { "焼", "F", TR_BRAND_FIRE, -1 },
702 { "凍", "Co", TR_BRAND_COLD, -1 },
703 { "毒", "P", TR_BRAND_POIS, -1 },
704 { "沌", "Ca", TR_CHAOTIC, -1 },
705 { "吸", "V", TR_VAMPIRIC, -1 },
706 { "震", "Q", TR_IMPACT, -1 },
707 { "切", "S", TR_VORPAL, -1 },
708 { "理", "M", TR_FORCE_WEAPON, -1 },
709 { NULL, NULL, 0, -1 }
712 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
713 static flag_insc_table flag_insc_kill[] =
715 { "邪", "*", TR_KILL_EVIL, -1 },
716 { "人", "p", TR_KILL_HUMAN, -1 },
717 { "龍", "D", TR_KILL_DRAGON, -1 },
718 { "オ", "o", TR_KILL_ORC, -1 },
719 { "ト", "T", TR_KILL_TROLL, -1 },
720 { "巨", "P", TR_KILL_GIANT, -1 },
721 { "デ", "U", TR_KILL_DEMON, -1 },
722 { "死", "L", TR_KILL_UNDEAD, -1 },
723 { "動", "Z", TR_KILL_ANIMAL, -1 },
724 { NULL, NULL, 0, -1 }
727 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
728 static flag_insc_table flag_insc_slay[] =
730 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
731 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
732 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
733 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
734 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
735 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
736 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
737 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
738 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
739 { NULL, NULL, 0, -1 }
742 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
743 static flag_insc_table flag_insc_esp1[] =
745 { "感", "Tele", TR_TELEPATHY, -1 },
746 { "邪", "Evil", TR_ESP_EVIL, -1 },
747 { "善", "Good", TR_ESP_GOOD, -1 },
748 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
749 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
750 { NULL, NULL, 0, -1 }
753 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
754 static flag_insc_table flag_insc_esp2[] =
756 { "人", "p", TR_ESP_HUMAN, -1 },
757 { "竜", "D", TR_ESP_DRAGON, -1 },
758 { "オ", "o", TR_ESP_ORC, -1 },
759 { "ト", "T", TR_ESP_TROLL, -1 },
760 { "巨", "P", TR_ESP_GIANT, -1 },
761 { "デ", "U", TR_ESP_DEMON, -1 },
762 { "死", "L", TR_ESP_UNDEAD, -1 },
763 { "動", "Z", TR_ESP_ANIMAL, -1 },
764 { NULL, NULL, 0, -1 }
767 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
768 static flag_insc_table flag_insc_sust[] =
770 { "腕", "St", TR_SUST_STR, -1 },
771 { "知", "In", TR_SUST_INT, -1 },
772 { "賢", "Wi", TR_SUST_WIS, -1 },
773 { "器", "Dx", TR_SUST_DEX, -1 },
774 { "耐", "Cn", TR_SUST_CON, -1 },
775 { "魅", "Ch", TR_SUST_CHR, -1 },
776 { NULL, NULL, 0, -1 }
780 static flag_insc_table flag_insc_plus[] =
782 { "At", TR_BLOWS, -1 },
783 { "Sp", TR_SPEED, -1 },
784 { "St", TR_STR, -1 },
785 { "In", TR_INT, -1 },
786 { "Wi", TR_WIS, -1 },
787 { "Dx", TR_DEX, -1 },
788 { "Cn", TR_CON, -1 },
789 { "Ch", TR_CHR, -1 },
790 { "Md", TR_MAGIC_MASTERY, -1 },
791 { "Sl", TR_STEALTH, -1 },
792 { "Sr", TR_SEARCH, -1 },
793 { "If", TR_INFRA, -1 },
794 { "Dg", TR_TUNNEL, -1 },
798 static flag_insc_table flag_insc_immune[] =
800 { "Ac", TR_IM_ACID, -1 },
801 { "El", TR_IM_ELEC, -1 },
802 { "Fi", TR_IM_FIRE, -1 },
803 { "Co", TR_IM_COLD, -1 },
807 static flag_insc_table flag_insc_resistance[] =
809 { "Ac", TR_RES_ACID, TR_IM_ACID },
810 { "El", TR_RES_ELEC, TR_IM_ELEC },
811 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
812 { "Co", TR_RES_COLD, TR_IM_COLD },
813 { "Po", TR_RES_POIS, -1 },
814 { "Li", TR_RES_LITE, -1 },
815 { "Dk", TR_RES_DARK, -1 },
816 { "Sh", TR_RES_SHARDS, -1 },
817 { "Bl", TR_RES_BLIND, -1 },
818 { "Cf", TR_RES_CONF, -1 },
819 { "So", TR_RES_SOUND, -1 },
820 { "Nt", TR_RES_NETHER, -1 },
821 { "Nx", TR_RES_NEXUS, -1 },
822 { "Ca", TR_RES_CHAOS, -1 },
823 { "Di", TR_RES_DISEN, -1 },
824 { "Fe", TR_RES_FEAR, -1 },
828 static flag_insc_table flag_insc_misc[] =
830 { "Es", TR_EASY_SPELL, -1 },
831 { "Dm", TR_DEC_MANA, -1 },
832 { "Th", TR_THROW, -1 },
833 { "Rf", TR_REFLECT, -1 },
834 { "Fa", TR_FREE_ACT, -1 },
835 { "Si", TR_SEE_INVIS, -1 },
836 { "Hl", TR_HOLD_EXP, -1 },
837 { "Sd", TR_SLOW_DIGEST, -1 },
838 { "Rg", TR_REGEN, -1 },
839 { "Lv", TR_LEVITATION, -1 },
840 { "Lu", TR_LITE_1, -1 },
841 { "Lu", TR_LITE_2, -1 },
842 { "Lu", TR_LITE_3, -1 },
843 { "Dl", TR_LITE_M1, -1 },
844 { "Dl", TR_LITE_M2, -1 },
845 { "Dl", TR_LITE_M3, -1 },
846 { "Wr", TR_WARNING, -1 },
847 { "Xm", TR_XTRA_MIGHT, -1 },
848 { "Xs", TR_XTRA_SHOTS, -1 },
849 { "Te", TR_TELEPORT, -1 },
850 { "Ag", TR_AGGRAVATE, -1 },
851 { "Bs", TR_BLESSED, -1 },
852 { "Ty", TR_TY_CURSE, -1 },
853 { "C-", TR_ADD_L_CURSE, -1 },
854 { "C+", TR_ADD_H_CURSE, -1 },
858 static flag_insc_table flag_insc_aura[] =
860 { "F", TR_SH_FIRE, -1 },
861 { "E", TR_SH_ELEC, -1 },
862 { "C", TR_SH_COLD, -1 },
863 { "M", TR_NO_MAGIC, -1 },
864 { "T", TR_NO_TELE, -1 },
868 static flag_insc_table flag_insc_brand[] =
870 { "A", TR_BRAND_ACID, -1 },
871 { "E", TR_BRAND_ELEC, -1 },
872 { "F", TR_BRAND_FIRE, -1 },
873 { "Co", TR_BRAND_COLD, -1 },
874 { "P", TR_BRAND_POIS, -1 },
875 { "Ca", TR_CHAOTIC, -1 },
876 { "V", TR_VAMPIRIC, -1 },
877 { "Q", TR_IMPACT, -1 },
878 { "S", TR_VORPAL, -1 },
879 { "M", TR_FORCE_WEAPON, -1 },
883 static flag_insc_table flag_insc_kill[] =
885 { "*", TR_KILL_EVIL, -1 },
886 { "p", TR_KILL_HUMAN, -1 },
887 { "D", TR_KILL_DRAGON, -1 },
888 { "o", TR_KILL_ORC, -1 },
889 { "T", TR_KILL_TROLL, -1 },
890 { "P", TR_KILL_GIANT, -1 },
891 { "U", TR_KILL_DEMON, -1 },
892 { "L", TR_KILL_UNDEAD, -1 },
893 { "Z", TR_KILL_ANIMAL, -1 },
897 static flag_insc_table flag_insc_slay[] =
899 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
900 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
901 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
902 { "o", TR_SLAY_ORC, TR_KILL_ORC },
903 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
904 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
905 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
906 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
907 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
911 static flag_insc_table flag_insc_esp1[] =
913 { "Tele", TR_TELEPATHY, -1 },
914 { "Evil", TR_ESP_EVIL, -1 },
915 { "Good", TR_ESP_GOOD, -1 },
916 { "Nolv", TR_ESP_NONLIVING, -1 },
917 { "Uniq", TR_ESP_UNIQUE, -1 },
921 static flag_insc_table flag_insc_esp2[] =
923 { "p", TR_ESP_HUMAN, -1 },
924 { "D", TR_ESP_DRAGON, -1 },
925 { "o", TR_ESP_ORC, -1 },
926 { "T", TR_ESP_TROLL, -1 },
927 { "P", TR_ESP_GIANT, -1 },
928 { "U", TR_ESP_DEMON, -1 },
929 { "L", TR_ESP_UNDEAD, -1 },
930 { "Z", TR_ESP_ANIMAL, -1 },
934 static flag_insc_table flag_insc_sust[] =
936 { "St", TR_SUST_STR, -1 },
937 { "In", TR_SUST_INT, -1 },
938 { "Wi", TR_SUST_WIS, -1 },
939 { "Dx", TR_SUST_DEX, -1 },
940 { "Cn", TR_SUST_CON, -1 },
941 { "Ch", TR_SUST_CHR, -1 },
946 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
947 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
950 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
951 * @param fi_ptr 参照する特性表示記号テーブル
952 * @param flgs 対応するオブジェクトのフラグ文字列
953 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
954 * @param ptr フラグ群を保管する文字列参照ポインタ
955 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
957 * Print an signed number "v" into a string "t", as if by
958 * sprintf(t, "%+d", n), and return a pointer to the terminator.
959 * Note that we always print a sign, either "+" or "-".
961 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
967 while (fi_ptr->english)
969 if (have_flag(flgs, fi_ptr->flag) &&
970 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
972 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
974 ADD_INSC(fi_ptr->english);
984 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
985 * @param fi_ptr 参照する特性表示記号テーブル
986 * @param flgs 対応するオブジェクトのフラグ文字列
987 * @return 1つでも該当の特性があったらTRUEを返す。
989 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
991 while (fi_ptr->english)
993 if (have_flag(flgs, fi_ptr->flag) &&
994 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1003 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1004 * @param ptr 特性短縮表記を格納する文字列ポインタ
1005 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1006 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1007 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1008 * @return ptrと同じアドレス
1010 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1012 char *prev_ptr = ptr;
1013 BIT_FLAGS flgs[TR_FLAG_SIZE];
1014 object_flags(o_ptr, flgs);
1016 /* Remove obvious flags */
1019 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1023 for (j = 0; j < TR_FLAG_SIZE; j++)
1024 flgs[j] &= ~k_ptr->flags[j];
1026 if (object_is_fixed_artifact(o_ptr))
1028 artifact_type *a_ptr = &a_info[o_ptr->name1];
1030 for (j = 0; j < TR_FLAG_SIZE; j++)
1031 flgs[j] &= ~a_ptr->flags[j];
1034 if (object_is_ego(o_ptr))
1036 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1038 for (j = 0; j < TR_FLAG_SIZE; j++)
1039 flgs[j] &= ~e_ptr->flags[j];
1043 /* Remove lite flags when this is a dark lite object */
1044 if (have_dark_flag(flgs))
1046 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1047 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1048 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1050 else if (have_lite_flag(flgs))
1052 add_flag(flgs, TR_LITE_1);
1053 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1054 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1058 if (have_flag_of(flag_insc_plus, flgs))
1063 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1066 if (have_flag_of(flag_insc_immune, flgs))
1068 if (!kanji && ptr != prev_ptr)
1075 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1078 if (have_flag_of(flag_insc_resistance, flgs))
1082 else if (ptr != prev_ptr)
1088 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1091 if (have_flag_of(flag_insc_misc, flgs))
1093 if (ptr != prev_ptr)
1099 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1102 if (have_flag_of(flag_insc_aura, flgs))
1106 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1109 if (have_flag_of(flag_insc_brand, flgs))
1111 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1114 if (have_flag_of(flag_insc_kill, flgs))
1116 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1119 if (have_flag_of(flag_insc_slay, flgs))
1121 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1126 if (have_flag_of(flag_insc_esp1, flgs) ||
1127 have_flag_of(flag_insc_esp2, flgs))
1129 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1130 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1134 if (have_flag_of(flag_insc_esp1, flgs))
1136 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1137 if (have_flag_of(flag_insc_esp2, flgs))
1139 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1143 if (have_flag_of(flag_insc_sust, flgs))
1147 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1156 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1157 * @param buff 特性短縮表記を格納する文字列ポインタ
1158 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1161 static void get_inscription(char *buff, object_type *o_ptr)
1163 concptr insc = quark_str(o_ptr->inscription);
1166 /* Not fully identified */
1167 if (!(o_ptr->ident & IDENT_MENTAL))
1169 /* Copy until end of line or '#' */
1172 if (*insc == '#') break;
1174 if (iskanji(*insc)) *buff++ = *insc++;
1184 for (; *insc; insc++)
1186 /* Ignore fake artifact inscription */
1187 if (*insc == '#') break;
1189 /* {%} will be automatically converted */
1190 else if ('%' == *insc)
1194 concptr start = ptr;
1196 /* check for too long inscription */
1197 if (ptr >= buff + MAX_NLEN) continue;
1210 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1220 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1234 * @brief オブジェクトがクエストの達成目的か否かを返す。
1235 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1236 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1238 bool object_is_quest_target(object_type *o_ptr)
1240 if (p_ptr->inside_quest)
1242 ARTIFACT_IDX a_idx = quest[p_ptr->inside_quest].k_idx;
1245 artifact_type *a_ptr = &a_info[a_idx];
1246 if (!(a_ptr->gen_flags & TRG_INSTA_ART))
1248 if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
1260 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1261 * @param buf 表記を返すための文字列参照ポインタ
1262 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1263 * @param mode 表記に関するオプション指定
1264 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1266 * One can choose the "verbosity" of the description, including whether\n
1267 * or not the "number" of items should be described, and how much detail\n
1268 * should be used when describing the item.\n
1270 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1271 * description, which can get pretty long, including incriptions, such as:\n
1272 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1273 * Note that the inscription will be clipped to keep the total description\n
1274 * under MAX_NLEN-1 chars (plus a terminator).\n
1276 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1277 * portable, versions of some common "sprintf()" commands.\n
1279 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1280 * the item is also an artifact, which should NEVER happen.\n
1282 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1283 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1284 * The "Specials" never use "modifiers" if they are "known", since they\n
1285 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1287 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1288 * plus the artifact name, just like any other artifact, if known.\n
1290 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1291 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1292 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1293 * they will append the artifact name, just like any artifact, if known.\n
1295 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1298 * OD_NAME_ONLY : The Cloak of Death\n
1299 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1300 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1301 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1303 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1304 * OD_NO_PLURAL : Forbidden use of plural \n
1305 * OD_STORE : Assume to be aware and known\n
1306 * OD_NO_FLAVOR : Allow to hidden flavor\n
1307 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1309 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1311 /* Extract object kind name */
1312 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1314 /* Extract default "base" string */
1315 concptr basenm = kindname;
1317 /* Assume no "modifier" string */
1318 concptr modstr = "";
1327 bool show_weapon = FALSE;
1328 bool show_armour = FALSE;
1333 char p1 = '(', p2 = ')';
1334 char b1 = '[', b2 = ']';
1335 char c1 = '{', c2 = '}';
1337 char tmp_val[MAX_NLEN+160];
1338 char tmp_val2[MAX_NLEN+10];
1339 char fake_insc_buf[30];
1341 BIT_FLAGS flgs[TR_FLAG_SIZE];
1343 object_type *bow_ptr;
1345 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1346 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1348 /* Extract some flags */
1349 object_flags(o_ptr, flgs);
1351 /* See if the object is "aware" */
1352 if (object_is_aware(o_ptr)) aware = TRUE;
1354 /* See if the object is "known" */
1355 if (object_is_known(o_ptr)) known = TRUE;
1357 /* Allow flavors to be hidden when aware */
1358 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1360 /* Object is in the inventory of a store or spoiler */
1361 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1363 /* Don't show flavors */
1366 /* Pretend known and aware */
1371 /* Force to be flavor name only */
1372 if (mode & OD_FORCE_FLAVOR)
1378 /* Cancel shuffling */
1379 flavor_k_ptr = k_ptr;
1382 /* Analyze the object */
1383 switch (o_ptr->tval)
1385 /* Some objects are easy to describe */
1399 monster_race *r_ptr = &r_info[o_ptr->pval];
1405 modstr = _(" (空)", " (empty)");
1410 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1413 concptr t = r_name + r_ptr->name;
1415 if (!(r_ptr->flags1 & RF1_UNIQUE))
1417 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1423 sprintf(tmp_val2, "(%s)", t);
1433 /* Figurines/Statues */
1437 monster_race *r_ptr = &r_info[o_ptr->pval];
1440 modstr = r_name + r_ptr->name;
1442 concptr t = r_name + r_ptr->name;
1444 if (!(r_ptr->flags1 & RF1_UNIQUE))
1446 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1463 monster_race *r_ptr = &r_info[o_ptr->pval];
1465 modstr = r_name + r_ptr->name;
1470 if (r_ptr->flags1 & RF1_UNIQUE)
1471 basenm = "& % of #";
1479 /* Missiles/ Bows/ Weapons */
1508 /* Lites (including a few "Specials") */
1514 /* Amulets (including a few "Specials") */
1517 /* Known artifacts */
1520 if (object_is_fixed_artifact(o_ptr)) break;
1521 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1524 /* Color the object */
1525 modstr = k_name + flavor_k_ptr->flavor_name;
1528 if (!flavor) basenm = "%のアミュレット";
1529 else if (aware) basenm = "%の#アミュレット";
1530 else basenm = "#アミュレット";
1532 if (!flavor) basenm = "& Amulet~ of %";
1533 else if (aware) basenm = "& # Amulet~ of %";
1534 else basenm = "& # Amulet~";
1540 /* Rings (including a few "Specials") */
1543 /* Known artifacts */
1546 if (object_is_fixed_artifact(o_ptr)) break;
1547 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1550 /* Color the object */
1551 modstr = k_name + flavor_k_ptr->flavor_name;
1554 if (!flavor) basenm = "%の指輪";
1555 else if (aware) basenm = "%の#指輪";
1556 else basenm = "#指輪";
1558 if (!flavor) basenm = "& Ring~ of %";
1559 else if (aware) basenm = "& # Ring~ of %";
1560 else basenm = "& # Ring~";
1563 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1575 /* Color the object */
1576 modstr = k_name + flavor_k_ptr->flavor_name;
1579 if (!flavor) basenm = "%の杖";
1580 else if (aware) basenm = "%の#杖";
1583 if (!flavor) basenm = "& Staff~ of %";
1584 else if (aware) basenm = "& # Staff~ of %";
1585 else basenm = "& # Staff~";
1593 /* Color the object */
1594 modstr = k_name + flavor_k_ptr->flavor_name;
1597 if (!flavor) basenm = "%の魔法棒";
1598 else if (aware) basenm = "%の#魔法棒";
1599 else basenm = "#魔法棒";
1601 if (!flavor) basenm = "& Wand~ of %";
1602 else if (aware) basenm = "& # Wand~ of %";
1603 else basenm = "& # Wand~";
1611 /* Color the object */
1612 modstr = k_name + flavor_k_ptr->flavor_name;
1615 if (!flavor) basenm = "%のロッド";
1616 else if (aware) basenm = "%の#ロッド";
1617 else basenm = "#ロッド";
1619 if (!flavor) basenm = "& Rod~ of %";
1620 else if (aware) basenm = "& # Rod~ of %";
1621 else basenm = "& # Rod~";
1629 /* Color the object */
1630 modstr = k_name + flavor_k_ptr->flavor_name;
1633 if (!flavor) basenm = "%の巻物";
1634 else if (aware) basenm = "「#」と書かれた%の巻物";
1635 else basenm = "「#」と書かれた巻物";
1637 if (!flavor) basenm = "& Scroll~ of %";
1638 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1639 else basenm = "& Scroll~ titled \"#\"";
1647 /* Color the object */
1648 modstr = k_name + flavor_k_ptr->flavor_name;
1651 if (!flavor) basenm = "%の薬";
1652 else if (aware) basenm = "%の#薬";
1655 if (!flavor) basenm = "& Potion~ of %";
1656 else if (aware) basenm = "& # Potion~ of %";
1657 else basenm = "& # Potion~";
1665 /* Ordinary food is "boring" */
1666 if (!k_ptr->flavor_name) break;
1668 /* Color the object */
1669 modstr = k_name + flavor_k_ptr->flavor_name;
1672 if (!flavor) basenm = "%のキノコ";
1673 else if (aware) basenm = "%の#キノコ";
1674 else basenm = "#キノコ";
1676 if (!flavor) basenm = "& Mushroom~ of %";
1677 else if (aware) basenm = "& # Mushroom~ of %";
1678 else basenm = "& # Mushroom~";
1686 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1696 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1697 basenm = "& Book~ of Life Magic %";
1699 basenm = "& Life Spellbook~ %";
1705 case TV_SORCERY_BOOK:
1710 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1711 basenm = "& Book~ of Sorcery %";
1713 basenm = "& Sorcery Spellbook~ %";
1719 case TV_NATURE_BOOK:
1724 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1725 basenm = "& Book~ of Nature Magic %";
1727 basenm = "& Nature Spellbook~ %";
1736 basenm = "カオスの魔法書%";
1738 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1739 basenm = "& Book~ of Chaos Magic %";
1741 basenm = "& Chaos Spellbook~ %";
1752 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1753 basenm = "& Book~ of Death Magic %";
1755 basenm = "& Death Spellbook~ %";
1764 basenm = "トランプの魔法書%";
1766 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1767 basenm = "& Book~ of Trump Magic %";
1769 basenm = "& Trump Spellbook~ %";
1775 case TV_ARCANE_BOOK:
1780 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1781 basenm = "& Book~ of Arcane Magic %";
1783 basenm = "& Arcane Spellbook~ %";
1794 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1795 basenm = "& Book~ of Craft Magic %";
1797 basenm = "& Craft Spellbook~ %";
1803 case TV_DAEMON_BOOK:
1808 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1809 basenm = "& Book~ of Daemon Magic %";
1811 basenm = "& Daemon Spellbook~ %";
1817 case TV_CRUSADE_BOOK:
1822 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1823 basenm = "& Book~ of Crusade Magic %";
1825 basenm = "& Crusade Spellbook~ %";
1833 basenm = _("歌集%", "& Song Book~ %");
1837 case TV_HISSATSU_BOOK:
1839 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1848 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1849 basenm = "& Book~ of Hex Magic %";
1851 basenm = "& Hex Spellbook~ %";
1857 /* Hack -- Gold/Gems */
1860 strcpy(buf, basenm);
1864 /* Used in the "inventory" routine */
1867 strcpy(buf, _("(なし)", "(nothing)"));
1872 /* Use full name from k_info or a_info */
1873 if (aware && have_flag(flgs, TR_FULL_NAME))
1875 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1876 else basenm = kindname;
1879 /* Start dumping the result */
1883 if (basenm[0] == '&')
1889 if (mode & OD_OMIT_PREFIX)
1893 else if (o_ptr->number > 1)
1895 t = object_desc_kosuu(t, o_ptr);
1896 t = object_desc_str(t, "の ");
1899 /* 英語の場合アーティファクトは The が付くので分かるが
1900 * 日本語では分からないのでマークをつける
1904 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1905 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1910 /* The object "expects" a "number" */
1911 if (basenm[0] == '&')
1913 /* Skip the ampersand (and space) */
1917 if (mode & OD_OMIT_PREFIX)
1922 /* Hack -- None left */
1923 else if (o_ptr->number <= 0)
1925 t = object_desc_str(t, "no more ");
1928 /* Extract the number */
1929 else if (o_ptr->number > 1)
1931 t = object_desc_num(t, o_ptr->number);
1932 t = object_desc_chr(t, ' ');
1935 /* Hack -- The only one of its kind */
1936 else if ((known && object_is_artifact(o_ptr)) ||
1937 ((o_ptr->tval == TV_CORPSE) &&
1938 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1940 t = object_desc_str(t, "The ");
1950 case '#': vowel = is_a_vowel(modstr[0]); break;
1951 case '%': vowel = is_a_vowel(*kindname); break;
1952 default: vowel = is_a_vowel(*s); break;
1957 /* A single one, with a vowel */
1958 t = object_desc_str(t, "an ");
1962 /* A single one, without a vowel */
1963 t = object_desc_str(t, "a ");
1968 /* Hack -- objects that "never" take an article */
1975 if (mode & OD_OMIT_PREFIX)
1980 /* Hack -- all gone */
1981 else if (o_ptr->number <= 0)
1983 t = object_desc_str(t, "no more ");
1986 /* Prefix a number if required */
1987 else if (o_ptr->number > 1)
1989 t = object_desc_num(t, o_ptr->number);
1990 t = object_desc_chr(t, ' ');
1993 /* Hack -- The only one of its kind */
1994 else if (known && object_is_artifact(o_ptr))
1996 t = object_desc_str(t, "The ");
1999 /* Hack -- single items get no prefix */
2007 /* Paranoia -- skip illegal tildes */
2008 /* while (*s == '~') s++; */
2011 if (object_is_smith(o_ptr))
2013 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2016 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2020 if (o_ptr->art_name)
2022 concptr temp = quark_str(o_ptr->art_name);
2024 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2025 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2026 if (strncmp(temp, "of ", 3) == 0)
2028 t = object_desc_str(t, &temp[3]);
2029 t = object_desc_str(t, "の");
2031 else if ((strncmp(temp, "『", 2) != 0) &&
2032 (strncmp(temp, "《", 2) != 0) &&
2034 t = object_desc_str(t, temp);
2037 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2039 artifact_type *a_ptr = &a_info[o_ptr->name1];
2040 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2041 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2043 t = object_desc_str(t, a_name + a_ptr->name);
2047 else if (object_is_ego(o_ptr))
2049 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2050 t = object_desc_str(t, e_name + e_ptr->name);
2055 /* Copy the string */
2056 for (s0 = NULL; *s || s0; )
2058 /* The end of the flavour/kind string. */
2065 /* Begin to append the modifier (flavor) */
2066 else if ((*s == '#') && !s0)
2071 /* Paranoia -- Never append multiple modstrs */
2075 /* Begin to append the kind name */
2076 else if ((*s == '%') && !s0)
2081 /* Paranoia -- Never append multiple kindnames */
2089 /* Add a plural if needed */
2090 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2096 /* Hack -- "Cutlass-es" and "Torch-es" */
2097 if ((k == 's') || (k == 'h')) *t++ = 'e';
2119 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2122 /* ランダムアーティファクトの名前はセーブファイルに記録
2123 されるので、英語版の名前もそれらしく変換する */
2124 if (o_ptr->art_name)
2128 strcpy(temp, quark_str(o_ptr->art_name));
2129 /* MEGA HACK by ita */
2130 if (strncmp(temp, "『", 2) == 0 ||
2131 strncmp(temp, "《", 2) == 0)
2132 t = object_desc_str(t, temp);
2133 else if (temp[0] == '\'')
2135 itemp = strlen(temp);
2136 temp[itemp - 1] = 0;
2137 t = object_desc_str(t, "『");
2138 t = object_desc_str(t, &temp[1]);
2139 t = object_desc_str(t, "』");
2142 else if (object_is_fixed_artifact(o_ptr))
2144 artifact_type *a_ptr = &a_info[o_ptr->name1];
2145 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2147 t = object_desc_str(t, a_name + a_ptr->name);
2150 else if (o_ptr->inscription)
2152 concptr str = quark_str(o_ptr->inscription);
2161 if (*str == '#') break;
2167 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2169 /* Add the false name */
2170 t = object_desc_str(t,"『");
2171 t = object_desc_str(t, &str_aux[1]);
2172 t = object_desc_str(t,"』");
2177 if (object_is_smith(o_ptr))
2179 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2182 /* Hack -- Append "Artifact" or "Special" names */
2183 if (known && !have_flag(flgs, TR_FULL_NAME))
2185 /* Is it a new random artifact ? */
2186 if (o_ptr->art_name)
2188 t = object_desc_chr(t, ' ');
2189 t = object_desc_str(t, quark_str(o_ptr->art_name));
2192 /* Grab any artifact name */
2193 else if (object_is_fixed_artifact(o_ptr))
2195 artifact_type *a_ptr = &a_info[o_ptr->name1];
2197 t = object_desc_chr(t, ' ');
2198 t = object_desc_str(t, a_name + a_ptr->name);
2201 /* Grab any ego-item name */
2204 if (object_is_ego(o_ptr))
2206 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2208 t = object_desc_chr(t, ' ');
2209 t = object_desc_str(t, e_name + e_ptr->name);
2212 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2215 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2217 /* Add the false name */
2218 t = object_desc_chr(t, ' ');
2219 t = object_desc_str(t, &str[1]);
2226 /* No more details wanted */
2227 if (mode & OD_NAME_ONLY) goto object_desc_done;
2229 /* Hack -- Chests must be described in detail */
2230 if (o_ptr->tval == TV_CHEST)
2232 /* Not searched yet */
2238 /* May be "empty" */
2239 else if (!o_ptr->pval)
2241 t = object_desc_str(t, _("(空)", " (empty)"));
2244 /* May be "disarmed" */
2245 else if (o_ptr->pval < 0)
2247 if (chest_traps[0 - o_ptr->pval])
2249 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2253 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2257 /* Describe the traps, if any */
2260 /* Describe the traps */
2261 switch (chest_traps[o_ptr->pval])
2265 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2268 case CHEST_LOSE_STR:
2270 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2273 case CHEST_LOSE_CON:
2275 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2280 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2283 case CHEST_PARALYZE:
2285 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2290 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2294 case CHEST_BIRD_STORM:
2295 case CHEST_E_SUMMON:
2296 case CHEST_H_SUMMON:
2298 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2301 case CHEST_RUNES_OF_EVIL:
2303 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2308 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2313 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2321 /* Display the item like a weapon */
2322 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2324 /* Display the item like a weapon */
2325 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2328 /* Display the item like a weapon */
2329 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2331 /* Display the item like armour */
2332 if (o_ptr->ac) show_armour = TRUE;
2335 /* Dump base weapon info */
2336 switch (o_ptr->tval)
2338 /* Missiles and Weapons */
2347 /* In Vault Quest, hide the dice of target weapon. */
2348 if(object_is_quest_target(o_ptr) && !known)
2353 /* Append a "damage" string */
2354 t = object_desc_chr(t, ' ');
2355 t = object_desc_chr(t, p1);
2356 t = object_desc_num(t, o_ptr->dd);
2357 t = object_desc_chr(t, 'd');
2358 t = object_desc_num(t, o_ptr->ds);
2359 t = object_desc_chr(t, p2);
2365 /* Bows get a special "damage string" */
2368 /* Mega-Hack -- Extract the "base power" */
2369 power = bow_tmul(o_ptr->sval);
2371 /* Apply the "Extra Might" flag */
2372 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2374 /* Append a special "damage" string */
2375 t = object_desc_chr(t, ' ');
2376 t = object_desc_chr(t, p1);
2377 t = object_desc_chr(t, 'x');
2378 t = object_desc_num(t, power);
2379 t = object_desc_chr(t, p2);
2381 fire_rate = calc_num_fire(o_ptr);
2382 /* Show Fire rate */
2383 if (fire_rate != 0 && power > 0 && known)
2385 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2387 t = object_desc_chr(t, ' ');
2388 t = object_desc_chr(t, p1);
2389 t = object_desc_num(t, fire_rate/100);
2390 t = object_desc_chr(t, '.');
2391 t = object_desc_num(t, fire_rate%100);
2392 t = object_desc_str(t, "turn");
2393 t = object_desc_chr(t, p2);
2401 /* Add the weapon bonuses */
2404 /* Show the tohit/todam on request */
2407 t = object_desc_chr(t, ' ');
2408 t = object_desc_chr(t, p1);
2409 t = object_desc_int(t, o_ptr->to_h);
2410 t = object_desc_chr(t, ',');
2411 t = object_desc_int(t, o_ptr->to_d);
2412 t = object_desc_chr(t, p2);
2415 /* Show the tohit if needed */
2416 else if (o_ptr->to_h)
2418 t = object_desc_chr(t, ' ');
2419 t = object_desc_chr(t, p1);
2420 t = object_desc_int(t, o_ptr->to_h);
2421 t = object_desc_chr(t, p2);
2424 /* Show the todam if needed */
2425 else if (o_ptr->to_d)
2427 t = object_desc_chr(t, ' ');
2428 t = object_desc_chr(t, p1);
2429 t = object_desc_int(t, o_ptr->to_d);
2430 t = object_desc_chr(t, p2);
2434 bow_ptr = &inventory[INVEN_BOW];
2436 /* If have a firing weapon + ammo matches bow */
2437 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2439 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2440 int tmul = bow_tmul(bow_ptr->sval);
2441 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2443 /* See if the bow is "known" - then set damage bonus */
2444 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2446 /* Effect of ammo */
2447 if (known) avgdam += (o_ptr->to_d * 10);
2449 /* Get extra "power" from "extra might" */
2450 if (p_ptr->xtra_might) tmul++;
2452 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2454 /* Launcher multiplier */
2456 avgdam /= (100 * 10);
2458 /* Get extra damage from concentration */
2459 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2461 if (avgdam < 0) avgdam = 0;
2463 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2464 t = object_desc_chr(t, ' ');
2465 t = object_desc_chr(t, p1);
2467 if(show_ammo_no_crit)
2469 /* Damage with no-crit */
2470 t = object_desc_num(t, avgdam);
2471 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2474 /* Apply Expect damage of Critical */
2475 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2476 t = object_desc_num(t, avgdam);
2478 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2479 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2481 if (p_ptr->num_fire == 0)
2483 t = object_desc_chr(t, '0');
2487 /* Calc effects of energy */
2488 avgdam *= (p_ptr->num_fire * 100);
2489 avgdam /= energy_fire;
2490 t = object_desc_num(t, avgdam);
2491 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2493 if(show_ammo_crit_ratio)
2495 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2497 t = object_desc_chr(t, '/');
2498 t = object_desc_num(t, percent / 100);
2499 t = object_desc_chr(t, '.');
2500 if(percent % 100 < 10)
2502 t = object_desc_chr(t, '0');
2504 t = object_desc_num(t, percent % 100);
2505 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2509 t = object_desc_chr(t, p2);
2511 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2513 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2514 s16b energy_fire = 100 - p_ptr->lev;
2516 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2518 /* Display (shot damage/ avg damage) */
2519 t = object_desc_chr(t, ' ');
2520 t = object_desc_chr(t, p1);
2521 t = object_desc_num(t, avgdam);
2522 t = object_desc_chr(t, '/');
2524 /* Calc effects of energy */
2525 avgdam = 100 * avgdam / energy_fire;
2527 t = object_desc_num(t, avgdam);
2528 t = object_desc_chr(t, p2);
2531 /* Add the armor bonuses */
2534 /* Show the armor class info */
2537 t = object_desc_chr(t, ' ');
2538 t = object_desc_chr(t, b1);
2539 t = object_desc_num(t, o_ptr->ac);
2540 t = object_desc_chr(t, ',');
2541 t = object_desc_int(t, o_ptr->to_a);
2542 t = object_desc_chr(t, b2);
2545 /* No base armor, but does increase armor */
2546 else if (o_ptr->to_a)
2548 t = object_desc_chr(t, ' ');
2549 t = object_desc_chr(t, b1);
2550 t = object_desc_int(t, o_ptr->to_a);
2551 t = object_desc_chr(t, b2);
2555 /* Hack -- always show base armor */
2556 else if (show_armour)
2558 t = object_desc_chr(t, ' ');
2559 t = object_desc_chr(t, b1);
2560 t = object_desc_num(t, o_ptr->ac);
2561 t = object_desc_chr(t, b2);
2565 /* No more details wanted */
2566 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2569 if (known) /* Known item only */
2572 * Hack -- Wands and Staffs have charges. Make certain how many charges
2573 * a stack of staffs really has is clear. -LM-
2575 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2577 /* Dump " (N charges)" */
2578 t = object_desc_chr(t, ' ');
2579 t = object_desc_chr(t, p1);
2581 /* Clear explaination for staffs. */
2582 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2584 t = object_desc_num(t, o_ptr->number);
2585 t = object_desc_str(t, "x ");
2587 t = object_desc_num(t, o_ptr->pval);
2589 t = object_desc_str(t, "回分");
2591 t = object_desc_str(t, " charge");
2592 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2595 t = object_desc_chr(t, p2);
2597 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2598 * be in any state of charge or discharge, this now includes a number. -LM-
2600 else if (o_ptr->tval == TV_ROD)
2602 /* Hack -- Dump " (# charging)" if relevant */
2605 /* Stacks of rods display an exact count of charging rods. */
2606 if (o_ptr->number > 1)
2609 if (k_ptr->pval == 0) k_ptr->pval = 1;
2611 /* Find out how many rods are charging, by dividing
2612 * current timeout by each rod's maximum timeout.
2613 * Ensure that any remainder is rounded up. Display
2614 * very discharged stacks as merely fully discharged.
2616 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2617 if (power > o_ptr->number) power = o_ptr->number;
2619 /* Display prettily. */
2620 t = object_desc_str(t, " (");
2621 t = object_desc_num(t, power);
2622 t = object_desc_str(t, _("本 充填中)", " charging)"));
2625 /* "one Rod of Perception (1 charging)" would look tacky. */
2628 t = object_desc_str(t, _("(充填中)", " (charging)"));
2633 /* Dump "pval" flags for wearable items */
2634 if (have_pval_flags(flgs))
2636 /* Start the display */
2637 t = object_desc_chr(t, ' ');
2638 t = object_desc_chr(t, p1);
2640 /* Dump the "pval" itself */
2641 t = object_desc_int(t, o_ptr->pval);
2643 /* Do not display the "pval" flags */
2644 if (have_flag(flgs, TR_HIDE_TYPE))
2650 else if (have_flag(flgs, TR_SPEED))
2652 /* Dump " to speed" */
2653 t = object_desc_str(t, _("加速", " to speed"));
2657 else if (have_flag(flgs, TR_BLOWS))
2661 t = object_desc_str(t, "攻撃");
2663 t = object_desc_str(t, " attack");
2666 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2671 else if (have_flag(flgs, TR_STEALTH))
2673 /* Dump " to stealth" */
2674 t = object_desc_str(t, _("隠密", " to stealth"));
2678 else if (have_flag(flgs, TR_SEARCH))
2680 /* Dump " to searching" */
2681 t = object_desc_str(t, _("探索", " to searching"));
2685 else if (have_flag(flgs, TR_INFRA))
2687 /* Dump " to infravision" */
2688 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2691 /* Finish the display */
2692 t = object_desc_chr(t, p2);
2695 /* Hack -- Process Lanterns/Torches */
2696 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2698 /* Hack -- Turns of light for normal lites */
2700 t = object_desc_chr(t, '(');
2702 t = object_desc_str(t, " (with ");
2705 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2706 else t = object_desc_num(t, o_ptr->xtra4);
2707 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2710 /* Indicate charging objects, but not rods. */
2711 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2713 /* Hack -- Dump " (charging)" if relevant */
2714 t = object_desc_str(t, _("(充填中)", " (charging)"));
2719 /* No more details wanted */
2720 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2723 /* Prepare real inscriptions in a buffer */
2726 /* Auto abbreviation inscribe */
2727 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2729 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2740 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2744 /* Use the standard inscription if available */
2745 if (o_ptr->inscription)
2749 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2751 /* Get inscription and convert {%} */
2752 get_inscription(buff, o_ptr);
2754 /* strcat with correct treating of kanji */
2755 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2759 /* No fake inscription yet */
2760 fake_insc_buf[0] = '\0';
2762 /* Use the game-generated "feeling" otherwise, if available */
2765 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2768 /* Note "cursed" if the item is known to be cursed */
2769 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2771 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2774 /* Note "unidentified" if the item is unidentified */
2775 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2776 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2778 && !(o_ptr->ident & IDENT_SENSE))
2780 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2783 /* Mega-Hack -- note empty wands/staffs */
2784 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2786 strcpy(fake_insc_buf, _("空", "empty"));
2789 /* Note "tried" if the object has been tested unsuccessfully */
2790 else if (!aware && object_is_tried(o_ptr))
2792 strcpy(fake_insc_buf, _("未判明", "tried"));
2795 /* Note the discount, if any */
2796 if (o_ptr->discount)
2798 /* Hidden by real inscription unless in a store */
2799 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2801 char discount_num_buf[4];
2803 /* Append to other fake inscriptions if any */
2804 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2806 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2807 strcat(fake_insc_buf, discount_num_buf);
2808 strcat(fake_insc_buf, _("%引き", "% off"));
2813 /* Append the inscription, if any */
2814 if (fake_insc_buf[0] || tmp_val2[0])
2816 /* Append the inscription */
2817 t = object_desc_chr(t, ' ');
2818 t = object_desc_chr(t, c1);
2820 /* Append fake inscriptions */
2821 if (fake_insc_buf[0])
2823 t = object_desc_str(t, fake_insc_buf);
2826 /* Append a separater */
2827 if (fake_insc_buf[0] && tmp_val2[0])
2829 t = object_desc_chr(t, ',');
2830 t = object_desc_chr(t, ' ');
2833 /* Append real inscriptions */
2836 t = object_desc_str(t, tmp_val2);
2839 t = object_desc_chr(t, c2);
2843 my_strcpy(buf, tmp_val, MAX_NLEN);