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"
18 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
20 * @return 簡易名称を明らかにするならTRUEを返す。
22 * This function is used only by "flavor_init()"
24 static bool object_easy_know(int i)
26 object_kind *k_ptr = &k_info[i];
28 /* Analyze the "tval" */
43 case TV_HISSATSU_BOOK:
60 /* All Food, Potions, Scrolls, Rods */
74 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
75 * @param out_string 作成した名を保管する参照ポインタ
77 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
78 * syllables 配列と elvish.txt を組み合わせる。\n
80 void get_table_name_aux(char *out_string)
84 get_rnd_line("aname_j.txt", 1, Syllable);
85 strcpy(out_string, Syllable);
86 get_rnd_line("aname_j.txt", 2, Syllable);
87 strcat(out_string, Syllable);
89 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
91 static concptr syllables[MAX_SYLLABLES] = {
92 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
93 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
94 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
95 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
96 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
97 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
98 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
99 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
100 "kho", "kli", "klis", "la", "lech", "man", "mar",
101 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
102 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
103 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
104 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
105 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
106 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
107 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
108 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
109 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
110 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
111 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
115 int testcounter = randint1(3) + 1;
117 strcpy(out_string, "");
119 if (randint1(3) == 2)
121 while (testcounter--)
122 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
127 testcounter = randint1(2) + 1;
128 while (testcounter--)
130 (void)get_rnd_line("elvish.txt", 0, Syllable);
131 strcat(out_string, Syllable);
135 out_string[0] = toupper(out_string[1]);
137 out_string[16] = '\0';
142 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
143 * @param out_string 作成した名を保管する参照ポインタ
145 * @details get_table_name_aux()ほぼ完全に実装を依存している。
147 void get_table_name(char *out_string)
150 get_table_name_aux(buff);
151 sprintf(out_string, _("『%s』", "'%s'"), buff);
155 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
156 * @param out_string 作成した名を保管する参照ポインタ
158 * @details sname.txtが語幹の辞書となっている。
160 void get_table_sindarin_aux(char *out_string)
167 get_rnd_line("sname.txt", 1, Syllable);
169 strcpy(tmp, Syllable);
171 strcpy(out_string, Syllable);
174 get_rnd_line("sname.txt", 2, Syllable);
176 strcat(tmp, Syllable);
177 sindarin_to_kana(out_string, tmp);
179 strcat(out_string, Syllable);
184 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
185 * @param out_string 作成した名を保管する参照ポインタ
187 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
189 void get_table_sindarin(char *out_string)
192 get_table_sindarin_aux(buff);
193 sprintf(out_string, _("『%s』", "'%s'"), buff);
198 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
199 * @param tval シャッフルしたいtval
201 * @details 巻物、各種魔道具などに利用される。
203 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
205 KIND_OBJECT_IDX *k_idx_list;
206 KIND_OBJECT_IDX k_idx_list_num = 0;
209 /* Allocate an array for a list of k_idx */
210 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
212 /* Search objects with given tval for shuffle */
213 for (i = 0; i < max_k_idx; i++)
215 object_kind *k_ptr = &k_info[i];
218 if (k_ptr->tval != tval) continue;
220 /* Paranoia -- Skip objects without flavor */
221 if (!k_ptr->flavor) continue;
223 /* Skip objects with a fixed flavor name */
224 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
227 k_idx_list[k_idx_list_num] = i;
229 /* Increase number of remembered indices */
233 /* Shuffle flavors */
234 for (i = 0; i < k_idx_list_num; i++)
236 object_kind *k1_ptr = &k_info[k_idx_list[i]];
237 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
239 /* Swap flavors of this pair */
240 s16b tmp = k1_ptr->flavor;
241 k1_ptr->flavor = k2_ptr->flavor;
242 k2_ptr->flavor = tmp;
245 /* Free an array for a list of k_idx */
246 C_KILL(k_idx_list, max_k_idx, s16b);
250 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
253 * Prepare the "variable" part of the "k_info" array.\n
255 * The "color"/"metal"/"type" of an item is its "flavor".\n
256 * For the most part, flavors are assigned randomly each game.\n
258 * Initialize descriptions for the "colored" objects, including:\n
259 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
261 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
262 * Slime Mold Juice, Unused Potion).\n
264 * Scroll titles are always between 6 and 14 letters long. This is\n
265 * ensured because every title is composed of whole words, where every\n
266 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
267 * letters each), and that no scroll is finished until it attempts to\n
268 * grow beyond 15 letters. The first time this can happen is when the\n
269 * current title has 6 letters and the new word has 8 letters, which\n
270 * would result in a 6 letter scroll title.\n
272 * Duplicate titles are avoided by requiring that no two scrolls share\n
273 * the same first four letters (not the most efficient method, and not\n
274 * the least efficient method, but it will always work).\n
276 * Hack -- make sure everything stays the same for each saved game\n
277 * This is accomplished by the use of a saved "random seed", as in\n
278 * "town_gen()". Since no other functions are called while the special\n
279 * seed is in effect, so this function is pretty "safe".\n
281 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
283 void flavor_init(void)
286 u32b state_backup[4];
288 /* Hack -- Backup the RNG state */
289 Rand_state_backup(state_backup);
291 /* Hack -- Induce consistant flavors */
292 Rand_state_set(seed_flavor);
295 /* Initialize flavor index of each object by itself */
296 for (i = 0; i < max_k_idx; i++)
298 object_kind *k_ptr = &k_info[i];
300 /* Skip objects without flavor name */
301 if (!k_ptr->flavor_name) continue;
304 * Initialize flavor index to itself
305 * -> Shuffle it later
311 shuffle_flavors(TV_RING);
313 /* Shuffle Amulets */
314 shuffle_flavors(TV_AMULET);
317 shuffle_flavors(TV_STAFF);
320 shuffle_flavors(TV_WAND);
323 shuffle_flavors(TV_ROD);
325 /* Shuffle Mushrooms */
326 shuffle_flavors(TV_FOOD);
328 /* Shuffle Potions */
329 shuffle_flavors(TV_POTION);
331 /* Shuffle Scrolls */
332 shuffle_flavors(TV_SCROLL);
335 /* Hack -- Restore the RNG state */
336 Rand_state_restore(state_backup);
338 /* Analyze every object */
339 for (i = 1; i < max_k_idx; i++)
341 object_kind *k_ptr = &k_info[i];
343 /* Skip "empty" objects */
344 if (!k_ptr->name) continue;
346 /* No flavor yields aware */
347 if (!k_ptr->flavor) k_ptr->aware = TRUE;
349 /* Check for "easily known" */
350 k_ptr->easy_know = object_easy_know(i);
356 * @brief 対象文字配列に一文字だけをコピーする。
357 * @param t 保管先文字列ポインタ
361 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
362 * and return a pointer to the terminator (t + 1).\n
364 static char *object_desc_chr(char *t, char c)
375 * @brief 対象文字配列に文字列をコピーする。
376 * @param t 保管先文字列ポインタ
377 * @param s コピーしたい文字列ポインタ
380 * Print a string "s" into a string "t", as if by strcpy(t, s),
381 * and return a pointer to the terminator.
383 static char *object_desc_str(char *t, concptr s)
385 /* Copy the string */
386 while (*s) *t++ = *s++;
394 * @brief 対象文字配列に符号なし整数値をコピーする。
395 * @param t 保管先文字列ポインタ
399 * Print an unsigned number "n" into a string "t", as if by
400 * sprintf(t, "%u", n), and return a pointer to the terminator.
402 static char *object_desc_num(char *t, uint n)
406 /* Find "size" of "n" */
407 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
409 /* Dump each digit */
415 /* Remove the digit */
418 /* Process next digit */
432 * @brief 日本語の個数表示ルーチン
433 * @param t 保管先文字列ポインタ
434 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
437 * cmd1.c で流用するために object_desc_japanese から移動した。
439 char *object_desc_kosuu(char *t, object_type *o_ptr)
441 t = object_desc_num(t, o_ptr->number);
453 t = object_desc_str(t, "本");
458 t = object_desc_str(t, "巻");
463 t = object_desc_str(t, "服");
467 case TV_SORCERY_BOOK:
475 case TV_CRUSADE_BOOK:
477 case TV_HISSATSU_BOOK:
480 t = object_desc_str(t, "冊");
488 t = object_desc_str(t, "着");
495 t = object_desc_str(t, "振");
500 t = object_desc_str(t, "足");
505 t = object_desc_str(t, "枚");
511 if(o_ptr->sval == SV_FOOD_JERKY)
513 t = object_desc_str(t, "切れ");
519 if (o_ptr->number < 10)
521 t = object_desc_str(t, "つ");
525 t = object_desc_str(t, "個");
535 * @brief 対象文字配列に符号あり整数値をコピーする。
536 * @param t 保管先文字列ポインタ
540 * Print an signed number "v" into a string "t", as if by
541 * sprintf(t, "%+d", n), and return a pointer to the terminator.
542 * Note that we always print a sign, either "+" or "-".
544 static char *object_desc_int(char *t, sint v)
551 /* Take the absolute value */
554 /* Use a "minus" sign */
558 /* Positive (or zero) */
561 /* Use the actual number */
564 /* Use a "plus" sign */
568 /* Find "size" of "n" */
569 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
571 /* Dump each digit */
577 /* Remove the digit */
580 /* Process next digit */
591 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
593 typedef struct flag_insc_table
604 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
605 static flag_insc_table flag_insc_plus[] =
607 { "攻", "At", TR_BLOWS, -1 },
608 { "速", "Sp", TR_SPEED, -1 },
609 { "腕", "St", TR_STR, -1 },
610 { "知", "In", TR_INT, -1 },
611 { "賢", "Wi", TR_WIS, -1 },
612 { "器", "Dx", TR_DEX, -1 },
613 { "耐", "Cn", TR_CON, -1 },
614 { "魅", "Ch", TR_CHR, -1 },
615 { "道", "Md", TR_MAGIC_MASTERY, -1 },
616 { "隠", "Sl", TR_STEALTH, -1 },
617 { "探", "Sr", TR_SEARCH, -1 },
618 { "赤", "If", TR_INFRA, -1 },
619 { "掘", "Dg", TR_TUNNEL, -1 },
620 { NULL, NULL, 0, -1 }
623 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
624 static flag_insc_table flag_insc_immune[] =
626 { "酸", "Ac", TR_IM_ACID, -1 },
627 { "電", "El", TR_IM_ELEC, -1 },
628 { "火", "Fi", TR_IM_FIRE, -1 },
629 { "冷", "Co", TR_IM_COLD, -1 },
630 { NULL, NULL, 0, -1 }
633 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
634 static flag_insc_table flag_insc_resistance[] =
636 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
637 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
638 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
639 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
640 { "毒", "Po", TR_RES_POIS, -1 },
641 { "閃", "Li", TR_RES_LITE, -1 },
642 { "暗", "Dk", TR_RES_DARK, -1 },
643 { "破", "Sh", TR_RES_SHARDS, -1 },
644 { "盲", "Bl", TR_RES_BLIND, -1 },
645 { "乱", "Cf", TR_RES_CONF, -1 },
646 { "轟", "So", TR_RES_SOUND, -1 },
647 { "獄", "Nt", TR_RES_NETHER, -1 },
648 { "因", "Nx", TR_RES_NEXUS, -1 },
649 { "沌", "Ca", TR_RES_CHAOS, -1 },
650 { "劣", "Di", TR_RES_DISEN, -1 },
651 { "恐", "Fe", TR_RES_FEAR, -1 },
652 { NULL, NULL, 0, -1 }
655 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
656 static flag_insc_table flag_insc_misc[] =
658 { "易", "Es", TR_EASY_SPELL, -1 },
659 { "減", "Dm", TR_DEC_MANA, -1 },
660 { "投", "Th", TR_THROW, -1 },
661 { "反", "Rf", TR_REFLECT, -1 },
662 { "麻", "Fa", TR_FREE_ACT, -1 },
663 { "視", "Si", TR_SEE_INVIS, -1 },
664 { "経", "Hl", TR_HOLD_EXP, -1 },
665 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
666 { "活", "Rg", TR_REGEN, -1 },
667 { "浮", "Lv", TR_LEVITATION, -1 },
668 { "明", "Lu", TR_LITE_1, -1 },
669 { "明", "Lu", TR_LITE_2, -1 },
670 { "明", "Lu", TR_LITE_3, -1 },
671 { "闇", "Dl", TR_LITE_M1, -1 },
672 { "闇", "Dl", TR_LITE_M2, -1 },
673 { "闇", "Dl", TR_LITE_M3, -1 },
674 { "警", "Wr", TR_WARNING, -1 },
675 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
676 { "射", "Xs", TR_XTRA_SHOTS, -1 },
677 { "瞬", "Te", TR_TELEPORT, -1 },
678 { "怒", "Ag", TR_AGGRAVATE, -1 },
679 { "祝", "Bs", TR_BLESSED, -1 },
680 { "忌", "Ty", TR_TY_CURSE, -1 },
681 { "呪", "C-", TR_ADD_L_CURSE, -1 },
682 { "詛", "C+", TR_ADD_H_CURSE, -1 },
683 { NULL, NULL, 0, -1 }
686 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
687 static flag_insc_table flag_insc_aura[] =
689 { "炎", "F", TR_SH_FIRE, -1 },
690 { "電", "E", TR_SH_ELEC, -1 },
691 { "冷", "C", TR_SH_COLD, -1 },
692 { "魔", "M", TR_NO_MAGIC, -1 },
693 { "瞬", "T", TR_NO_TELE, -1 },
694 { NULL, NULL, 0, -1 }
697 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
698 static flag_insc_table flag_insc_brand[] =
700 { "酸", "A", TR_BRAND_ACID, -1 },
701 { "電", "E", TR_BRAND_ELEC, -1 },
702 { "焼", "F", TR_BRAND_FIRE, -1 },
703 { "凍", "Co", TR_BRAND_COLD, -1 },
704 { "毒", "P", TR_BRAND_POIS, -1 },
705 { "沌", "Ca", TR_CHAOTIC, -1 },
706 { "吸", "V", TR_VAMPIRIC, -1 },
707 { "震", "Q", TR_IMPACT, -1 },
708 { "切", "S", TR_VORPAL, -1 },
709 { "理", "M", TR_FORCE_WEAPON, -1 },
710 { NULL, NULL, 0, -1 }
713 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
714 static flag_insc_table flag_insc_kill[] =
716 { "邪", "*", TR_KILL_EVIL, -1 },
717 { "人", "p", TR_KILL_HUMAN, -1 },
718 { "龍", "D", TR_KILL_DRAGON, -1 },
719 { "オ", "o", TR_KILL_ORC, -1 },
720 { "ト", "T", TR_KILL_TROLL, -1 },
721 { "巨", "P", TR_KILL_GIANT, -1 },
722 { "デ", "U", TR_KILL_DEMON, -1 },
723 { "死", "L", TR_KILL_UNDEAD, -1 },
724 { "動", "Z", TR_KILL_ANIMAL, -1 },
725 { NULL, NULL, 0, -1 }
728 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
729 static flag_insc_table flag_insc_slay[] =
731 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
732 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
733 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
734 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
735 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
736 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
737 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
738 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
739 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
740 { NULL, NULL, 0, -1 }
743 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
744 static flag_insc_table flag_insc_esp1[] =
746 { "感", "Tele", TR_TELEPATHY, -1 },
747 { "邪", "Evil", TR_ESP_EVIL, -1 },
748 { "善", "Good", TR_ESP_GOOD, -1 },
749 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
750 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
751 { NULL, NULL, 0, -1 }
754 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
755 static flag_insc_table flag_insc_esp2[] =
757 { "人", "p", TR_ESP_HUMAN, -1 },
758 { "竜", "D", TR_ESP_DRAGON, -1 },
759 { "オ", "o", TR_ESP_ORC, -1 },
760 { "ト", "T", TR_ESP_TROLL, -1 },
761 { "巨", "P", TR_ESP_GIANT, -1 },
762 { "デ", "U", TR_ESP_DEMON, -1 },
763 { "死", "L", TR_ESP_UNDEAD, -1 },
764 { "動", "Z", TR_ESP_ANIMAL, -1 },
765 { NULL, NULL, 0, -1 }
768 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
769 static flag_insc_table flag_insc_sust[] =
771 { "腕", "St", TR_SUST_STR, -1 },
772 { "知", "In", TR_SUST_INT, -1 },
773 { "賢", "Wi", TR_SUST_WIS, -1 },
774 { "器", "Dx", TR_SUST_DEX, -1 },
775 { "耐", "Cn", TR_SUST_CON, -1 },
776 { "魅", "Ch", TR_SUST_CHR, -1 },
777 { NULL, NULL, 0, -1 }
781 static flag_insc_table flag_insc_plus[] =
783 { "At", TR_BLOWS, -1 },
784 { "Sp", TR_SPEED, -1 },
785 { "St", TR_STR, -1 },
786 { "In", TR_INT, -1 },
787 { "Wi", TR_WIS, -1 },
788 { "Dx", TR_DEX, -1 },
789 { "Cn", TR_CON, -1 },
790 { "Ch", TR_CHR, -1 },
791 { "Md", TR_MAGIC_MASTERY, -1 },
792 { "Sl", TR_STEALTH, -1 },
793 { "Sr", TR_SEARCH, -1 },
794 { "If", TR_INFRA, -1 },
795 { "Dg", TR_TUNNEL, -1 },
799 static flag_insc_table flag_insc_immune[] =
801 { "Ac", TR_IM_ACID, -1 },
802 { "El", TR_IM_ELEC, -1 },
803 { "Fi", TR_IM_FIRE, -1 },
804 { "Co", TR_IM_COLD, -1 },
808 static flag_insc_table flag_insc_resistance[] =
810 { "Ac", TR_RES_ACID, TR_IM_ACID },
811 { "El", TR_RES_ELEC, TR_IM_ELEC },
812 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
813 { "Co", TR_RES_COLD, TR_IM_COLD },
814 { "Po", TR_RES_POIS, -1 },
815 { "Li", TR_RES_LITE, -1 },
816 { "Dk", TR_RES_DARK, -1 },
817 { "Sh", TR_RES_SHARDS, -1 },
818 { "Bl", TR_RES_BLIND, -1 },
819 { "Cf", TR_RES_CONF, -1 },
820 { "So", TR_RES_SOUND, -1 },
821 { "Nt", TR_RES_NETHER, -1 },
822 { "Nx", TR_RES_NEXUS, -1 },
823 { "Ca", TR_RES_CHAOS, -1 },
824 { "Di", TR_RES_DISEN, -1 },
825 { "Fe", TR_RES_FEAR, -1 },
829 static flag_insc_table flag_insc_misc[] =
831 { "Es", TR_EASY_SPELL, -1 },
832 { "Dm", TR_DEC_MANA, -1 },
833 { "Th", TR_THROW, -1 },
834 { "Rf", TR_REFLECT, -1 },
835 { "Fa", TR_FREE_ACT, -1 },
836 { "Si", TR_SEE_INVIS, -1 },
837 { "Hl", TR_HOLD_EXP, -1 },
838 { "Sd", TR_SLOW_DIGEST, -1 },
839 { "Rg", TR_REGEN, -1 },
840 { "Lv", TR_LEVITATION, -1 },
841 { "Lu", TR_LITE_1, -1 },
842 { "Lu", TR_LITE_2, -1 },
843 { "Lu", TR_LITE_3, -1 },
844 { "Dl", TR_LITE_M1, -1 },
845 { "Dl", TR_LITE_M2, -1 },
846 { "Dl", TR_LITE_M3, -1 },
847 { "Wr", TR_WARNING, -1 },
848 { "Xm", TR_XTRA_MIGHT, -1 },
849 { "Xs", TR_XTRA_SHOTS, -1 },
850 { "Te", TR_TELEPORT, -1 },
851 { "Ag", TR_AGGRAVATE, -1 },
852 { "Bs", TR_BLESSED, -1 },
853 { "Ty", TR_TY_CURSE, -1 },
854 { "C-", TR_ADD_L_CURSE, -1 },
855 { "C+", TR_ADD_H_CURSE, -1 },
859 static flag_insc_table flag_insc_aura[] =
861 { "F", TR_SH_FIRE, -1 },
862 { "E", TR_SH_ELEC, -1 },
863 { "C", TR_SH_COLD, -1 },
864 { "M", TR_NO_MAGIC, -1 },
865 { "T", TR_NO_TELE, -1 },
869 static flag_insc_table flag_insc_brand[] =
871 { "A", TR_BRAND_ACID, -1 },
872 { "E", TR_BRAND_ELEC, -1 },
873 { "F", TR_BRAND_FIRE, -1 },
874 { "Co", TR_BRAND_COLD, -1 },
875 { "P", TR_BRAND_POIS, -1 },
876 { "Ca", TR_CHAOTIC, -1 },
877 { "V", TR_VAMPIRIC, -1 },
878 { "Q", TR_IMPACT, -1 },
879 { "S", TR_VORPAL, -1 },
880 { "M", TR_FORCE_WEAPON, -1 },
884 static flag_insc_table flag_insc_kill[] =
886 { "*", TR_KILL_EVIL, -1 },
887 { "p", TR_KILL_HUMAN, -1 },
888 { "D", TR_KILL_DRAGON, -1 },
889 { "o", TR_KILL_ORC, -1 },
890 { "T", TR_KILL_TROLL, -1 },
891 { "P", TR_KILL_GIANT, -1 },
892 { "U", TR_KILL_DEMON, -1 },
893 { "L", TR_KILL_UNDEAD, -1 },
894 { "Z", TR_KILL_ANIMAL, -1 },
898 static flag_insc_table flag_insc_slay[] =
900 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
901 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
902 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
903 { "o", TR_SLAY_ORC, TR_KILL_ORC },
904 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
905 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
906 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
907 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
908 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
912 static flag_insc_table flag_insc_esp1[] =
914 { "Tele", TR_TELEPATHY, -1 },
915 { "Evil", TR_ESP_EVIL, -1 },
916 { "Good", TR_ESP_GOOD, -1 },
917 { "Nolv", TR_ESP_NONLIVING, -1 },
918 { "Uniq", TR_ESP_UNIQUE, -1 },
922 static flag_insc_table flag_insc_esp2[] =
924 { "p", TR_ESP_HUMAN, -1 },
925 { "D", TR_ESP_DRAGON, -1 },
926 { "o", TR_ESP_ORC, -1 },
927 { "T", TR_ESP_TROLL, -1 },
928 { "P", TR_ESP_GIANT, -1 },
929 { "U", TR_ESP_DEMON, -1 },
930 { "L", TR_ESP_UNDEAD, -1 },
931 { "Z", TR_ESP_ANIMAL, -1 },
935 static flag_insc_table flag_insc_sust[] =
937 { "St", TR_SUST_STR, -1 },
938 { "In", TR_SUST_INT, -1 },
939 { "Wi", TR_SUST_WIS, -1 },
940 { "Dx", TR_SUST_DEX, -1 },
941 { "Cn", TR_SUST_CON, -1 },
942 { "Ch", TR_SUST_CHR, -1 },
947 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
948 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
951 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
952 * @param fi_ptr 参照する特性表示記号テーブル
953 * @param flgs 対応するオブジェクトのフラグ文字列
954 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
955 * @param ptr フラグ群を保管する文字列参照ポインタ
956 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
958 * Print an signed number "v" into a string "t", as if by
959 * sprintf(t, "%+d", n), and return a pointer to the terminator.
960 * Note that we always print a sign, either "+" or "-".
962 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
968 while (fi_ptr->english)
970 if (have_flag(flgs, fi_ptr->flag) &&
971 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
973 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
975 ADD_INSC(fi_ptr->english);
985 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
986 * @param fi_ptr 参照する特性表示記号テーブル
987 * @param flgs 対応するオブジェクトのフラグ文字列
988 * @return 1つでも該当の特性があったらTRUEを返す。
990 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
992 while (fi_ptr->english)
994 if (have_flag(flgs, fi_ptr->flag) &&
995 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1004 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1005 * @param ptr 特性短縮表記を格納する文字列ポインタ
1006 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1007 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1008 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1009 * @return ptrと同じアドレス
1011 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1013 char *prev_ptr = ptr;
1014 BIT_FLAGS flgs[TR_FLAG_SIZE];
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 concptr 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)
1195 concptr start = ptr;
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 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1315 /* Extract default "base" string */
1316 concptr basenm = kindname;
1318 /* Assume no "modifier" string */
1319 concptr modstr = "";
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 concptr 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 concptr 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 concptr 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 concptr str = quark_str(o_ptr->inscription);
2162 if (*str == '#') break;
2168 concptr 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 concptr 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);