2 * @file object-flavor.c
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
17 #include "player-status.h"
19 #include "object-hook.h"
20 #include "object-flavor.h"
26 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
28 * @return 簡易名称を明らかにするならTRUEを返す。
30 * This function is used only by "flavor_init()"
32 static bool object_easy_know(int i)
34 object_kind *k_ptr = &k_info[i];
36 /* Analyze the "tval" */
51 case TV_HISSATSU_BOOK:
68 /* All Food, Potions, Scrolls, Rods */
82 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
83 * @param out_string 作成した名を保管する参照ポインタ
85 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
86 * syllables 配列と elvish.txt を組み合わせる。\n
88 void get_table_name_aux(char *out_string)
92 get_rnd_line("aname_j.txt", 1, Syllable);
93 strcpy(out_string, Syllable);
94 get_rnd_line("aname_j.txt", 2, Syllable);
95 strcat(out_string, Syllable);
97 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
99 static concptr syllables[MAX_SYLLABLES] = {
100 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
101 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
102 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
103 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
104 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
105 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
106 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
107 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
108 "kho", "kli", "klis", "la", "lech", "man", "mar",
109 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
110 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
111 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
112 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
113 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
114 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
115 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
116 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
117 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
118 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
119 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
123 int testcounter = randint1(3) + 1;
125 strcpy(out_string, "");
127 if (randint1(3) == 2)
129 while (testcounter--)
130 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
135 testcounter = randint1(2) + 1;
136 while (testcounter--)
138 (void)get_rnd_line("elvish.txt", 0, Syllable);
139 strcat(out_string, Syllable);
143 out_string[0] = toupper(out_string[1]);
145 out_string[16] = '\0';
150 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
151 * @param out_string 作成した名を保管する参照ポインタ
153 * @details get_table_name_aux()ほぼ完全に実装を依存している。
155 void get_table_name(char *out_string)
158 get_table_name_aux(buff);
159 sprintf(out_string, _("『%s』", "'%s'"), buff);
163 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
164 * @param out_string 作成した名を保管する参照ポインタ
166 * @details sname.txtが語幹の辞書となっている。
168 void get_table_sindarin_aux(char *out_string)
175 get_rnd_line("sname.txt", 1, Syllable);
177 strcpy(tmp, Syllable);
179 strcpy(out_string, Syllable);
182 get_rnd_line("sname.txt", 2, Syllable);
184 strcat(tmp, Syllable);
185 sindarin_to_kana(out_string, tmp);
187 strcat(out_string, Syllable);
192 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
193 * @param out_string 作成した名を保管する参照ポインタ
195 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
197 void get_table_sindarin(char *out_string)
200 get_table_sindarin_aux(buff);
201 sprintf(out_string, _("『%s』", "'%s'"), buff);
206 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
207 * @param tval シャッフルしたいtval
209 * @details 巻物、各種魔道具などに利用される。
211 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
213 KIND_OBJECT_IDX *k_idx_list;
214 KIND_OBJECT_IDX k_idx_list_num = 0;
217 /* Allocate an array for a list of k_idx */
218 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
220 /* Search objects with given tval for shuffle */
221 for (i = 0; i < max_k_idx; i++)
223 object_kind *k_ptr = &k_info[i];
226 if (k_ptr->tval != tval) continue;
228 /* Paranoia -- Skip objects without flavor */
229 if (!k_ptr->flavor) continue;
231 /* Skip objects with a fixed flavor name */
232 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
235 k_idx_list[k_idx_list_num] = i;
237 /* Increase number of remembered indices */
241 /* Shuffle flavors */
242 for (i = 0; i < k_idx_list_num; i++)
244 object_kind *k1_ptr = &k_info[k_idx_list[i]];
245 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
247 /* Swap flavors of this pair */
248 s16b tmp = k1_ptr->flavor;
249 k1_ptr->flavor = k2_ptr->flavor;
250 k2_ptr->flavor = tmp;
253 /* Free an array for a list of k_idx */
254 C_KILL(k_idx_list, max_k_idx, s16b);
258 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
261 * Prepare the "variable" part of the "k_info" array.\n
263 * The "color"/"metal"/"type" of an item is its "flavor".\n
264 * For the most part, flavors are assigned randomly each game.\n
266 * Initialize descriptions for the "colored" objects, including:\n
267 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
269 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
270 * Slime Mold Juice, Unused Potion).\n
272 * Scroll titles are always between 6 and 14 letters long. This is\n
273 * ensured because every title is composed of whole words, where every\n
274 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
275 * letters each), and that no scroll is finished until it attempts to\n
276 * grow beyond 15 letters. The first time this can happen is when the\n
277 * current title has 6 letters and the new word has 8 letters, which\n
278 * would result in a 6 letter scroll title.\n
280 * Duplicate titles are avoided by requiring that no two scrolls share\n
281 * the same first four letters (not the most efficient method, and not\n
282 * the least efficient method, but it will always work).\n
284 * Hack -- make sure everything stays the same for each saved game\n
285 * This is accomplished by the use of a saved "random seed", as in\n
286 * "town_gen()". Since no other functions are called while the special\n
287 * seed is in effect, so this function is pretty "safe".\n
289 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
291 void flavor_init(void)
294 u32b state_backup[4];
296 /* Hack -- Backup the RNG state */
297 Rand_state_backup(state_backup);
299 /* Hack -- Induce consistant flavors */
300 Rand_state_set(seed_flavor);
303 /* Initialize flavor index of each object by itself */
304 for (i = 0; i < max_k_idx; i++)
306 object_kind *k_ptr = &k_info[i];
308 /* Skip objects without flavor name */
309 if (!k_ptr->flavor_name) continue;
312 * Initialize flavor index to itself
313 * -> Shuffle it later
319 shuffle_flavors(TV_RING);
321 /* Shuffle Amulets */
322 shuffle_flavors(TV_AMULET);
325 shuffle_flavors(TV_STAFF);
328 shuffle_flavors(TV_WAND);
331 shuffle_flavors(TV_ROD);
333 /* Shuffle Mushrooms */
334 shuffle_flavors(TV_FOOD);
336 /* Shuffle Potions */
337 shuffle_flavors(TV_POTION);
339 /* Shuffle Scrolls */
340 shuffle_flavors(TV_SCROLL);
343 /* Hack -- Restore the RNG state */
344 Rand_state_restore(state_backup);
346 /* Analyze every object */
347 for (i = 1; i < max_k_idx; i++)
349 object_kind *k_ptr = &k_info[i];
351 /* Skip "empty" objects */
352 if (!k_ptr->name) continue;
354 /* No flavor yields aware */
355 if (!k_ptr->flavor) k_ptr->aware = TRUE;
357 /* Check for "easily known" */
358 k_ptr->easy_know = object_easy_know(i);
364 * @brief 対象文字配列に一文字だけをコピーする。
365 * @param t 保管先文字列ポインタ
369 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
370 * and return a pointer to the terminator (t + 1).\n
372 static char *object_desc_chr(char *t, char c)
383 * @brief 対象文字配列に文字列をコピーする。
384 * @param t 保管先文字列ポインタ
385 * @param s コピーしたい文字列ポインタ
388 * Print a string "s" into a string "t", as if by strcpy(t, s),
389 * and return a pointer to the terminator.
391 static char *object_desc_str(char *t, concptr s)
393 /* Copy the string */
394 while (*s) *t++ = *s++;
402 * @brief 対象文字配列に符号なし整数値をコピーする。
403 * @param t 保管先文字列ポインタ
407 * Print an unsigned number "n" into a string "t", as if by
408 * sprintf(t, "%u", n), and return a pointer to the terminator.
410 static char *object_desc_num(char *t, uint n)
414 /* Find "size" of "n" */
415 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
417 /* Dump each digit */
423 /* Remove the digit */
426 /* Process next digit */
440 * @brief 日本語の個数表示ルーチン
441 * @param t 保管先文字列ポインタ
442 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
445 * cmd1.c で流用するために object_desc_japanese から移動した。
447 char *object_desc_kosuu(char *t, object_type *o_ptr)
449 t = object_desc_num(t, o_ptr->number);
461 t = object_desc_str(t, "本");
466 t = object_desc_str(t, "巻");
471 t = object_desc_str(t, "服");
475 case TV_SORCERY_BOOK:
483 case TV_CRUSADE_BOOK:
485 case TV_HISSATSU_BOOK:
488 t = object_desc_str(t, "冊");
496 t = object_desc_str(t, "着");
503 t = object_desc_str(t, "振");
508 t = object_desc_str(t, "足");
513 t = object_desc_str(t, "枚");
519 if(o_ptr->sval == SV_FOOD_JERKY)
521 t = object_desc_str(t, "切れ");
527 if (o_ptr->number < 10)
529 t = object_desc_str(t, "つ");
533 t = object_desc_str(t, "個");
543 * @brief 対象文字配列に符号あり整数値をコピーする。
544 * @param t 保管先文字列ポインタ
548 * Print an signed number "v" into a string "t", as if by
549 * sprintf(t, "%+d", n), and return a pointer to the terminator.
550 * Note that we always print a sign, either "+" or "-".
552 static char *object_desc_int(char *t, sint v)
559 /* Take the absolute value */
562 /* Use a "minus" sign */
566 /* Positive (or zero) */
569 /* Use the actual number */
572 /* Use a "plus" sign */
576 /* Find "size" of "n" */
577 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
579 /* Dump each digit */
585 /* Remove the digit */
588 /* Process next digit */
599 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
601 typedef struct flag_insc_table
612 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
613 static flag_insc_table flag_insc_plus[] =
615 { "攻", "At", TR_BLOWS, -1 },
616 { "速", "Sp", TR_SPEED, -1 },
617 { "腕", "St", TR_STR, -1 },
618 { "知", "In", TR_INT, -1 },
619 { "賢", "Wi", TR_WIS, -1 },
620 { "器", "Dx", TR_DEX, -1 },
621 { "耐", "Cn", TR_CON, -1 },
622 { "魅", "Ch", TR_CHR, -1 },
623 { "道", "Md", TR_MAGIC_MASTERY, -1 },
624 { "隠", "Sl", TR_STEALTH, -1 },
625 { "探", "Sr", TR_SEARCH, -1 },
626 { "赤", "If", TR_INFRA, -1 },
627 { "掘", "Dg", TR_TUNNEL, -1 },
628 { NULL, NULL, 0, -1 }
631 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
632 static flag_insc_table flag_insc_immune[] =
634 { "酸", "Ac", TR_IM_ACID, -1 },
635 { "電", "El", TR_IM_ELEC, -1 },
636 { "火", "Fi", TR_IM_FIRE, -1 },
637 { "冷", "Co", TR_IM_COLD, -1 },
638 { NULL, NULL, 0, -1 }
641 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
642 static flag_insc_table flag_insc_resistance[] =
644 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
645 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
646 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
647 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
648 { "毒", "Po", TR_RES_POIS, -1 },
649 { "閃", "Li", TR_RES_LITE, -1 },
650 { "暗", "Dk", TR_RES_DARK, -1 },
651 { "破", "Sh", TR_RES_SHARDS, -1 },
652 { "盲", "Bl", TR_RES_BLIND, -1 },
653 { "乱", "Cf", TR_RES_CONF, -1 },
654 { "轟", "So", TR_RES_SOUND, -1 },
655 { "獄", "Nt", TR_RES_NETHER, -1 },
656 { "因", "Nx", TR_RES_NEXUS, -1 },
657 { "沌", "Ca", TR_RES_CHAOS, -1 },
658 { "劣", "Di", TR_RES_DISEN, -1 },
659 { "恐", "Fe", TR_RES_FEAR, -1 },
660 { NULL, NULL, 0, -1 }
663 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
664 static flag_insc_table flag_insc_misc[] =
666 { "易", "Es", TR_EASY_SPELL, -1 },
667 { "減", "Dm", TR_DEC_MANA, -1 },
668 { "投", "Th", TR_THROW, -1 },
669 { "反", "Rf", TR_REFLECT, -1 },
670 { "麻", "Fa", TR_FREE_ACT, -1 },
671 { "視", "Si", TR_SEE_INVIS, -1 },
672 { "経", "Hl", TR_HOLD_EXP, -1 },
673 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
674 { "活", "Rg", TR_REGEN, -1 },
675 { "浮", "Lv", TR_LEVITATION, -1 },
676 { "明", "Lu", TR_LITE_1, -1 },
677 { "明", "Lu", TR_LITE_2, -1 },
678 { "明", "Lu", TR_LITE_3, -1 },
679 { "闇", "Dl", TR_LITE_M1, -1 },
680 { "闇", "Dl", TR_LITE_M2, -1 },
681 { "闇", "Dl", TR_LITE_M3, -1 },
682 { "警", "Wr", TR_WARNING, -1 },
683 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
684 { "射", "Xs", TR_XTRA_SHOTS, -1 },
685 { "瞬", "Te", TR_TELEPORT, -1 },
686 { "怒", "Ag", TR_AGGRAVATE, -1 },
687 { "祝", "Bs", TR_BLESSED, -1 },
688 { "忌", "Ty", TR_TY_CURSE, -1 },
689 { "呪", "C-", TR_ADD_L_CURSE, -1 },
690 { "詛", "C+", TR_ADD_H_CURSE, -1 },
691 { NULL, NULL, 0, -1 }
694 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
695 static flag_insc_table flag_insc_aura[] =
697 { "炎", "F", TR_SH_FIRE, -1 },
698 { "電", "E", TR_SH_ELEC, -1 },
699 { "冷", "C", TR_SH_COLD, -1 },
700 { "魔", "M", TR_NO_MAGIC, -1 },
701 { "瞬", "T", TR_NO_TELE, -1 },
702 { NULL, NULL, 0, -1 }
705 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
706 static flag_insc_table flag_insc_brand[] =
708 { "酸", "A", TR_BRAND_ACID, -1 },
709 { "電", "E", TR_BRAND_ELEC, -1 },
710 { "焼", "F", TR_BRAND_FIRE, -1 },
711 { "凍", "Co", TR_BRAND_COLD, -1 },
712 { "毒", "P", TR_BRAND_POIS, -1 },
713 { "沌", "Ca", TR_CHAOTIC, -1 },
714 { "吸", "V", TR_VAMPIRIC, -1 },
715 { "震", "Q", TR_IMPACT, -1 },
716 { "切", "S", TR_VORPAL, -1 },
717 { "理", "M", TR_FORCE_WEAPON, -1 },
718 { NULL, NULL, 0, -1 }
721 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
722 static flag_insc_table flag_insc_kill[] =
724 { "邪", "*", TR_KILL_EVIL, -1 },
725 { "人", "p", TR_KILL_HUMAN, -1 },
726 { "龍", "D", TR_KILL_DRAGON, -1 },
727 { "オ", "o", TR_KILL_ORC, -1 },
728 { "ト", "T", TR_KILL_TROLL, -1 },
729 { "巨", "P", TR_KILL_GIANT, -1 },
730 { "デ", "U", TR_KILL_DEMON, -1 },
731 { "死", "L", TR_KILL_UNDEAD, -1 },
732 { "動", "Z", TR_KILL_ANIMAL, -1 },
733 { NULL, NULL, 0, -1 }
736 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
737 static flag_insc_table flag_insc_slay[] =
739 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
740 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
741 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
742 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
743 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
744 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
745 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
746 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
747 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
748 { NULL, NULL, 0, -1 }
751 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
752 static flag_insc_table flag_insc_esp1[] =
754 { "感", "Tele", TR_TELEPATHY, -1 },
755 { "邪", "Evil", TR_ESP_EVIL, -1 },
756 { "善", "Good", TR_ESP_GOOD, -1 },
757 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
758 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
759 { NULL, NULL, 0, -1 }
762 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
763 static flag_insc_table flag_insc_esp2[] =
765 { "人", "p", TR_ESP_HUMAN, -1 },
766 { "竜", "D", TR_ESP_DRAGON, -1 },
767 { "オ", "o", TR_ESP_ORC, -1 },
768 { "ト", "T", TR_ESP_TROLL, -1 },
769 { "巨", "P", TR_ESP_GIANT, -1 },
770 { "デ", "U", TR_ESP_DEMON, -1 },
771 { "死", "L", TR_ESP_UNDEAD, -1 },
772 { "動", "Z", TR_ESP_ANIMAL, -1 },
773 { NULL, NULL, 0, -1 }
776 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
777 static flag_insc_table flag_insc_sust[] =
779 { "腕", "St", TR_SUST_STR, -1 },
780 { "知", "In", TR_SUST_INT, -1 },
781 { "賢", "Wi", TR_SUST_WIS, -1 },
782 { "器", "Dx", TR_SUST_DEX, -1 },
783 { "耐", "Cn", TR_SUST_CON, -1 },
784 { "魅", "Ch", TR_SUST_CHR, -1 },
785 { NULL, NULL, 0, -1 }
789 static flag_insc_table flag_insc_plus[] =
791 { "At", TR_BLOWS, -1 },
792 { "Sp", TR_SPEED, -1 },
793 { "St", TR_STR, -1 },
794 { "In", TR_INT, -1 },
795 { "Wi", TR_WIS, -1 },
796 { "Dx", TR_DEX, -1 },
797 { "Cn", TR_CON, -1 },
798 { "Ch", TR_CHR, -1 },
799 { "Md", TR_MAGIC_MASTERY, -1 },
800 { "Sl", TR_STEALTH, -1 },
801 { "Sr", TR_SEARCH, -1 },
802 { "If", TR_INFRA, -1 },
803 { "Dg", TR_TUNNEL, -1 },
807 static flag_insc_table flag_insc_immune[] =
809 { "Ac", TR_IM_ACID, -1 },
810 { "El", TR_IM_ELEC, -1 },
811 { "Fi", TR_IM_FIRE, -1 },
812 { "Co", TR_IM_COLD, -1 },
816 static flag_insc_table flag_insc_resistance[] =
818 { "Ac", TR_RES_ACID, TR_IM_ACID },
819 { "El", TR_RES_ELEC, TR_IM_ELEC },
820 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
821 { "Co", TR_RES_COLD, TR_IM_COLD },
822 { "Po", TR_RES_POIS, -1 },
823 { "Li", TR_RES_LITE, -1 },
824 { "Dk", TR_RES_DARK, -1 },
825 { "Sh", TR_RES_SHARDS, -1 },
826 { "Bl", TR_RES_BLIND, -1 },
827 { "Cf", TR_RES_CONF, -1 },
828 { "So", TR_RES_SOUND, -1 },
829 { "Nt", TR_RES_NETHER, -1 },
830 { "Nx", TR_RES_NEXUS, -1 },
831 { "Ca", TR_RES_CHAOS, -1 },
832 { "Di", TR_RES_DISEN, -1 },
833 { "Fe", TR_RES_FEAR, -1 },
837 static flag_insc_table flag_insc_misc[] =
839 { "Es", TR_EASY_SPELL, -1 },
840 { "Dm", TR_DEC_MANA, -1 },
841 { "Th", TR_THROW, -1 },
842 { "Rf", TR_REFLECT, -1 },
843 { "Fa", TR_FREE_ACT, -1 },
844 { "Si", TR_SEE_INVIS, -1 },
845 { "Hl", TR_HOLD_EXP, -1 },
846 { "Sd", TR_SLOW_DIGEST, -1 },
847 { "Rg", TR_REGEN, -1 },
848 { "Lv", TR_LEVITATION, -1 },
849 { "Lu", TR_LITE_1, -1 },
850 { "Lu", TR_LITE_2, -1 },
851 { "Lu", TR_LITE_3, -1 },
852 { "Dl", TR_LITE_M1, -1 },
853 { "Dl", TR_LITE_M2, -1 },
854 { "Dl", TR_LITE_M3, -1 },
855 { "Wr", TR_WARNING, -1 },
856 { "Xm", TR_XTRA_MIGHT, -1 },
857 { "Xs", TR_XTRA_SHOTS, -1 },
858 { "Te", TR_TELEPORT, -1 },
859 { "Ag", TR_AGGRAVATE, -1 },
860 { "Bs", TR_BLESSED, -1 },
861 { "Ty", TR_TY_CURSE, -1 },
862 { "C-", TR_ADD_L_CURSE, -1 },
863 { "C+", TR_ADD_H_CURSE, -1 },
867 static flag_insc_table flag_insc_aura[] =
869 { "F", TR_SH_FIRE, -1 },
870 { "E", TR_SH_ELEC, -1 },
871 { "C", TR_SH_COLD, -1 },
872 { "M", TR_NO_MAGIC, -1 },
873 { "T", TR_NO_TELE, -1 },
877 static flag_insc_table flag_insc_brand[] =
879 { "A", TR_BRAND_ACID, -1 },
880 { "E", TR_BRAND_ELEC, -1 },
881 { "F", TR_BRAND_FIRE, -1 },
882 { "Co", TR_BRAND_COLD, -1 },
883 { "P", TR_BRAND_POIS, -1 },
884 { "Ca", TR_CHAOTIC, -1 },
885 { "V", TR_VAMPIRIC, -1 },
886 { "Q", TR_IMPACT, -1 },
887 { "S", TR_VORPAL, -1 },
888 { "M", TR_FORCE_WEAPON, -1 },
892 static flag_insc_table flag_insc_kill[] =
894 { "*", TR_KILL_EVIL, -1 },
895 { "p", TR_KILL_HUMAN, -1 },
896 { "D", TR_KILL_DRAGON, -1 },
897 { "o", TR_KILL_ORC, -1 },
898 { "T", TR_KILL_TROLL, -1 },
899 { "P", TR_KILL_GIANT, -1 },
900 { "U", TR_KILL_DEMON, -1 },
901 { "L", TR_KILL_UNDEAD, -1 },
902 { "Z", TR_KILL_ANIMAL, -1 },
906 static flag_insc_table flag_insc_slay[] =
908 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
909 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
910 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
911 { "o", TR_SLAY_ORC, TR_KILL_ORC },
912 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
913 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
914 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
915 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
916 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
920 static flag_insc_table flag_insc_esp1[] =
922 { "Tele", TR_TELEPATHY, -1 },
923 { "Evil", TR_ESP_EVIL, -1 },
924 { "Good", TR_ESP_GOOD, -1 },
925 { "Nolv", TR_ESP_NONLIVING, -1 },
926 { "Uniq", TR_ESP_UNIQUE, -1 },
930 static flag_insc_table flag_insc_esp2[] =
932 { "p", TR_ESP_HUMAN, -1 },
933 { "D", TR_ESP_DRAGON, -1 },
934 { "o", TR_ESP_ORC, -1 },
935 { "T", TR_ESP_TROLL, -1 },
936 { "P", TR_ESP_GIANT, -1 },
937 { "U", TR_ESP_DEMON, -1 },
938 { "L", TR_ESP_UNDEAD, -1 },
939 { "Z", TR_ESP_ANIMAL, -1 },
943 static flag_insc_table flag_insc_sust[] =
945 { "St", TR_SUST_STR, -1 },
946 { "In", TR_SUST_INT, -1 },
947 { "Wi", TR_SUST_WIS, -1 },
948 { "Dx", TR_SUST_DEX, -1 },
949 { "Cn", TR_SUST_CON, -1 },
950 { "Ch", TR_SUST_CHR, -1 },
955 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
956 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
959 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
960 * @param fi_ptr 参照する特性表示記号テーブル
961 * @param flgs 対応するオブジェクトのフラグ文字列
962 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
963 * @param ptr フラグ群を保管する文字列参照ポインタ
964 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
966 * Print an signed number "v" into a string "t", as if by
967 * sprintf(t, "%+d", n), and return a pointer to the terminator.
968 * Note that we always print a sign, either "+" or "-".
970 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
976 while (fi_ptr->english)
978 if (have_flag(flgs, fi_ptr->flag) &&
979 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
981 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
983 ADD_INSC(fi_ptr->english);
993 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
994 * @param fi_ptr 参照する特性表示記号テーブル
995 * @param flgs 対応するオブジェクトのフラグ文字列
996 * @return 1つでも該当の特性があったらTRUEを返す。
998 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
1000 while (fi_ptr->english)
1002 if (have_flag(flgs, fi_ptr->flag) &&
1003 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1012 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1013 * @param ptr 特性短縮表記を格納する文字列ポインタ
1014 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1015 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1016 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1017 * @return ptrと同じアドレス
1019 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1021 char *prev_ptr = ptr;
1022 BIT_FLAGS flgs[TR_FLAG_SIZE];
1023 object_flags(o_ptr, flgs);
1025 /* Remove obvious flags */
1028 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1032 for (j = 0; j < TR_FLAG_SIZE; j++)
1033 flgs[j] &= ~k_ptr->flags[j];
1035 if (object_is_fixed_artifact(o_ptr))
1037 artifact_type *a_ptr = &a_info[o_ptr->name1];
1039 for (j = 0; j < TR_FLAG_SIZE; j++)
1040 flgs[j] &= ~a_ptr->flags[j];
1043 if (object_is_ego(o_ptr))
1045 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1047 for (j = 0; j < TR_FLAG_SIZE; j++)
1048 flgs[j] &= ~e_ptr->flags[j];
1052 /* Remove lite flags when this is a dark lite object */
1053 if (have_dark_flag(flgs))
1055 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1056 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1057 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1059 else if (have_lite_flag(flgs))
1061 add_flag(flgs, TR_LITE_1);
1062 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1063 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1067 if (have_flag_of(flag_insc_plus, flgs))
1072 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1075 if (have_flag_of(flag_insc_immune, flgs))
1077 if (!kanji && ptr != prev_ptr)
1084 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1087 if (have_flag_of(flag_insc_resistance, flgs))
1091 else if (ptr != prev_ptr)
1097 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1100 if (have_flag_of(flag_insc_misc, flgs))
1102 if (ptr != prev_ptr)
1108 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1111 if (have_flag_of(flag_insc_aura, flgs))
1115 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1118 if (have_flag_of(flag_insc_brand, flgs))
1120 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1123 if (have_flag_of(flag_insc_kill, flgs))
1125 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1128 if (have_flag_of(flag_insc_slay, flgs))
1130 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1135 if (have_flag_of(flag_insc_esp1, flgs) ||
1136 have_flag_of(flag_insc_esp2, flgs))
1138 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1139 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1143 if (have_flag_of(flag_insc_esp1, flgs))
1145 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1146 if (have_flag_of(flag_insc_esp2, flgs))
1148 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1152 if (have_flag_of(flag_insc_sust, flgs))
1156 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1165 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1166 * @param buff 特性短縮表記を格納する文字列ポインタ
1167 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1170 static void get_inscription(char *buff, object_type *o_ptr)
1172 concptr insc = quark_str(o_ptr->inscription);
1175 /* Not fully identified */
1176 if (!(o_ptr->ident & IDENT_MENTAL))
1178 /* Copy until end of line or '#' */
1181 if (*insc == '#') break;
1183 if (iskanji(*insc)) *buff++ = *insc++;
1193 for (; *insc; insc++)
1195 /* Ignore fake artifact inscription */
1196 if (*insc == '#') break;
1198 /* {%} will be automatically converted */
1199 else if ('%' == *insc)
1203 concptr start = ptr;
1205 /* check for too long inscription */
1206 if (ptr >= buff + MAX_NLEN) continue;
1219 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1229 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1244 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1245 * @param buf 表記を返すための文字列参照ポインタ
1246 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1247 * @param mode 表記に関するオプション指定
1248 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1250 * One can choose the "verbosity" of the description, including whether\n
1251 * or not the "number" of items should be described, and how much detail\n
1252 * should be used when describing the item.\n
1254 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1255 * description, which can get pretty long, including incriptions, such as:\n
1256 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1257 * Note that the inscription will be clipped to keep the total description\n
1258 * under MAX_NLEN-1 chars (plus a terminator).\n
1260 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1261 * portable, versions of some common "sprintf()" commands.\n
1263 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1264 * the item is also an artifact, which should NEVER happen.\n
1266 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1267 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1268 * The "Specials" never use "modifiers" if they are "known", since they\n
1269 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1271 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1272 * plus the artifact name, just like any other artifact, if known.\n
1274 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1275 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1276 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1277 * they will append the artifact name, just like any artifact, if known.\n
1279 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1282 * OD_NAME_ONLY : The Cloak of Death\n
1283 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1284 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1285 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1287 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1288 * OD_NO_PLURAL : Forbidden use of plural \n
1289 * OD_STORE : Assume to be aware and known\n
1290 * OD_NO_FLAVOR : Allow to hidden flavor\n
1291 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1293 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1295 /* Extract object kind name */
1296 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1298 /* Extract default "base" string */
1299 concptr basenm = kindname;
1301 /* Assume no "modifier" string */
1302 concptr modstr = "";
1311 bool show_weapon = FALSE;
1312 bool show_armour = FALSE;
1317 char p1 = '(', p2 = ')';
1318 char b1 = '[', b2 = ']';
1319 char c1 = '{', c2 = '}';
1321 char tmp_val[MAX_NLEN+160];
1322 char tmp_val2[MAX_NLEN+10];
1323 char fake_insc_buf[30];
1325 BIT_FLAGS flgs[TR_FLAG_SIZE];
1327 object_type *bow_ptr;
1329 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1330 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1332 /* Extract some flags */
1333 object_flags(o_ptr, flgs);
1335 /* See if the object is "aware" */
1336 if (object_is_aware(o_ptr)) aware = TRUE;
1338 /* See if the object is "known" */
1339 if (object_is_known(o_ptr)) known = TRUE;
1341 /* Allow flavors to be hidden when aware */
1342 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1344 /* Object is in the inventory of a store or spoiler */
1345 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1347 /* Don't show flavors */
1350 /* Pretend known and aware */
1355 /* Force to be flavor name only */
1356 if (mode & OD_FORCE_FLAVOR)
1362 /* Cancel shuffling */
1363 flavor_k_ptr = k_ptr;
1366 /* Analyze the object */
1367 switch (o_ptr->tval)
1369 /* Some objects are easy to describe */
1383 monster_race *r_ptr = &r_info[o_ptr->pval];
1389 modstr = _(" (空)", " (empty)");
1394 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1397 concptr t = r_name + r_ptr->name;
1399 if (!(r_ptr->flags1 & RF1_UNIQUE))
1401 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1407 sprintf(tmp_val2, "(%s)", t);
1417 /* Figurines/Statues */
1421 monster_race *r_ptr = &r_info[o_ptr->pval];
1424 modstr = r_name + r_ptr->name;
1426 concptr t = r_name + r_ptr->name;
1428 if (!(r_ptr->flags1 & RF1_UNIQUE))
1430 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1447 monster_race *r_ptr = &r_info[o_ptr->pval];
1449 modstr = r_name + r_ptr->name;
1454 if (r_ptr->flags1 & RF1_UNIQUE)
1455 basenm = "& % of #";
1463 /* Missiles/ Bows/ Weapons */
1492 /* Lites (including a few "Specials") */
1498 /* Amulets (including a few "Specials") */
1501 /* Known artifacts */
1504 if (object_is_fixed_artifact(o_ptr)) break;
1505 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1508 /* Color the object */
1509 modstr = k_name + flavor_k_ptr->flavor_name;
1512 if (!flavor) basenm = "%のアミュレット";
1513 else if (aware) basenm = "%の#アミュレット";
1514 else basenm = "#アミュレット";
1516 if (!flavor) basenm = "& Amulet~ of %";
1517 else if (aware) basenm = "& # Amulet~ of %";
1518 else basenm = "& # Amulet~";
1524 /* Rings (including a few "Specials") */
1527 /* Known artifacts */
1530 if (object_is_fixed_artifact(o_ptr)) break;
1531 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1534 /* Color the object */
1535 modstr = k_name + flavor_k_ptr->flavor_name;
1538 if (!flavor) basenm = "%の指輪";
1539 else if (aware) basenm = "%の#指輪";
1540 else basenm = "#指輪";
1542 if (!flavor) basenm = "& Ring~ of %";
1543 else if (aware) basenm = "& # Ring~ of %";
1544 else basenm = "& # Ring~";
1547 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1559 /* Color the object */
1560 modstr = k_name + flavor_k_ptr->flavor_name;
1563 if (!flavor) basenm = "%の杖";
1564 else if (aware) basenm = "%の#杖";
1567 if (!flavor) basenm = "& Staff~ of %";
1568 else if (aware) basenm = "& # Staff~ of %";
1569 else basenm = "& # Staff~";
1577 /* Color the object */
1578 modstr = k_name + flavor_k_ptr->flavor_name;
1581 if (!flavor) basenm = "%の魔法棒";
1582 else if (aware) basenm = "%の#魔法棒";
1583 else basenm = "#魔法棒";
1585 if (!flavor) basenm = "& Wand~ of %";
1586 else if (aware) basenm = "& # Wand~ of %";
1587 else basenm = "& # Wand~";
1595 /* Color the object */
1596 modstr = k_name + flavor_k_ptr->flavor_name;
1599 if (!flavor) basenm = "%のロッド";
1600 else if (aware) basenm = "%の#ロッド";
1601 else basenm = "#ロッド";
1603 if (!flavor) basenm = "& Rod~ of %";
1604 else if (aware) basenm = "& # Rod~ of %";
1605 else basenm = "& # Rod~";
1613 /* Color the object */
1614 modstr = k_name + flavor_k_ptr->flavor_name;
1617 if (!flavor) basenm = "%の巻物";
1618 else if (aware) basenm = "「#」と書かれた%の巻物";
1619 else basenm = "「#」と書かれた巻物";
1621 if (!flavor) basenm = "& Scroll~ of %";
1622 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1623 else basenm = "& Scroll~ titled \"#\"";
1631 /* Color the object */
1632 modstr = k_name + flavor_k_ptr->flavor_name;
1635 if (!flavor) basenm = "%の薬";
1636 else if (aware) basenm = "%の#薬";
1639 if (!flavor) basenm = "& Potion~ of %";
1640 else if (aware) basenm = "& # Potion~ of %";
1641 else basenm = "& # Potion~";
1649 /* Ordinary food is "boring" */
1650 if (!k_ptr->flavor_name) break;
1652 /* Color the object */
1653 modstr = k_name + flavor_k_ptr->flavor_name;
1656 if (!flavor) basenm = "%のキノコ";
1657 else if (aware) basenm = "%の#キノコ";
1658 else basenm = "#キノコ";
1660 if (!flavor) basenm = "& Mushroom~ of %";
1661 else if (aware) basenm = "& # Mushroom~ of %";
1662 else basenm = "& # Mushroom~";
1670 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1680 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1681 basenm = "& Book~ of Life Magic %";
1683 basenm = "& Life Spellbook~ %";
1689 case TV_SORCERY_BOOK:
1694 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1695 basenm = "& Book~ of Sorcery %";
1697 basenm = "& Sorcery Spellbook~ %";
1703 case TV_NATURE_BOOK:
1708 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1709 basenm = "& Book~ of Nature Magic %";
1711 basenm = "& Nature Spellbook~ %";
1720 basenm = "カオスの魔法書%";
1722 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1723 basenm = "& Book~ of Chaos Magic %";
1725 basenm = "& Chaos Spellbook~ %";
1736 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1737 basenm = "& Book~ of Death Magic %";
1739 basenm = "& Death Spellbook~ %";
1748 basenm = "トランプの魔法書%";
1750 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1751 basenm = "& Book~ of Trump Magic %";
1753 basenm = "& Trump Spellbook~ %";
1759 case TV_ARCANE_BOOK:
1764 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1765 basenm = "& Book~ of Arcane Magic %";
1767 basenm = "& Arcane Spellbook~ %";
1778 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1779 basenm = "& Book~ of Craft Magic %";
1781 basenm = "& Craft Spellbook~ %";
1787 case TV_DAEMON_BOOK:
1792 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1793 basenm = "& Book~ of Daemon Magic %";
1795 basenm = "& Daemon Spellbook~ %";
1801 case TV_CRUSADE_BOOK:
1806 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1807 basenm = "& Book~ of Crusade Magic %";
1809 basenm = "& Crusade Spellbook~ %";
1817 basenm = _("歌集%", "& Song Book~ %");
1821 case TV_HISSATSU_BOOK:
1823 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1832 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1833 basenm = "& Book~ of Hex Magic %";
1835 basenm = "& Hex Spellbook~ %";
1841 /* Hack -- Gold/Gems */
1844 strcpy(buf, basenm);
1848 /* Used in the "inventory" routine */
1851 strcpy(buf, _("(なし)", "(nothing)"));
1856 /* Use full name from k_info or a_info */
1857 if (aware && have_flag(flgs, TR_FULL_NAME))
1859 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1860 else basenm = kindname;
1863 /* Start dumping the result */
1867 if (basenm[0] == '&')
1873 if (mode & OD_OMIT_PREFIX)
1877 else if (o_ptr->number > 1)
1879 t = object_desc_kosuu(t, o_ptr);
1880 t = object_desc_str(t, "の ");
1883 /* 英語の場合アーティファクトは The が付くので分かるが
1884 * 日本語では分からないのでマークをつける
1888 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1889 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1894 /* The object "expects" a "number" */
1895 if (basenm[0] == '&')
1897 /* Skip the ampersand (and space) */
1901 if (mode & OD_OMIT_PREFIX)
1906 /* Hack -- None left */
1907 else if (o_ptr->number <= 0)
1909 t = object_desc_str(t, "no more ");
1912 /* Extract the number */
1913 else if (o_ptr->number > 1)
1915 t = object_desc_num(t, o_ptr->number);
1916 t = object_desc_chr(t, ' ');
1919 /* Hack -- The only one of its kind */
1920 else if ((known && object_is_artifact(o_ptr)) ||
1921 ((o_ptr->tval == TV_CORPSE) &&
1922 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1924 t = object_desc_str(t, "The ");
1934 case '#': vowel = is_a_vowel(modstr[0]); break;
1935 case '%': vowel = is_a_vowel(*kindname); break;
1936 default: vowel = is_a_vowel(*s); break;
1941 /* A single one, with a vowel */
1942 t = object_desc_str(t, "an ");
1946 /* A single one, without a vowel */
1947 t = object_desc_str(t, "a ");
1952 /* Hack -- objects that "never" take an article */
1959 if (mode & OD_OMIT_PREFIX)
1964 /* Hack -- all gone */
1965 else if (o_ptr->number <= 0)
1967 t = object_desc_str(t, "no more ");
1970 /* Prefix a number if required */
1971 else if (o_ptr->number > 1)
1973 t = object_desc_num(t, o_ptr->number);
1974 t = object_desc_chr(t, ' ');
1977 /* Hack -- The only one of its kind */
1978 else if (known && object_is_artifact(o_ptr))
1980 t = object_desc_str(t, "The ");
1983 /* Hack -- single items get no prefix */
1991 /* Paranoia -- skip illegal tildes */
1992 /* while (*s == '~') s++; */
1995 if (object_is_smith(o_ptr))
1997 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2000 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2004 if (o_ptr->art_name)
2006 concptr temp = quark_str(o_ptr->art_name);
2008 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2009 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2010 if (strncmp(temp, "of ", 3) == 0)
2012 t = object_desc_str(t, &temp[3]);
2013 t = object_desc_str(t, "の");
2015 else if ((strncmp(temp, "『", 2) != 0) &&
2016 (strncmp(temp, "《", 2) != 0) &&
2018 t = object_desc_str(t, temp);
2021 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2023 artifact_type *a_ptr = &a_info[o_ptr->name1];
2024 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2025 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2027 t = object_desc_str(t, a_name + a_ptr->name);
2031 else if (object_is_ego(o_ptr))
2033 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2034 t = object_desc_str(t, e_name + e_ptr->name);
2039 /* Copy the string */
2040 for (s0 = NULL; *s || s0; )
2042 /* The end of the flavour/kind string. */
2049 /* Begin to append the modifier (flavor) */
2050 else if ((*s == '#') && !s0)
2055 /* Paranoia -- Never append multiple modstrs */
2059 /* Begin to append the kind name */
2060 else if ((*s == '%') && !s0)
2065 /* Paranoia -- Never append multiple kindnames */
2073 /* Add a plural if needed */
2074 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2080 /* Hack -- "Cutlass-es" and "Torch-es" */
2081 if ((k == 's') || (k == 'h')) *t++ = 'e';
2103 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2106 /* ランダムアーティファクトの名前はセーブファイルに記録
2107 されるので、英語版の名前もそれらしく変換する */
2108 if (o_ptr->art_name)
2112 strcpy(temp, quark_str(o_ptr->art_name));
2113 /* MEGA HACK by ita */
2114 if (strncmp(temp, "『", 2) == 0 ||
2115 strncmp(temp, "《", 2) == 0)
2116 t = object_desc_str(t, temp);
2117 else if (temp[0] == '\'')
2119 itemp = strlen(temp);
2120 temp[itemp - 1] = 0;
2121 t = object_desc_str(t, "『");
2122 t = object_desc_str(t, &temp[1]);
2123 t = object_desc_str(t, "』");
2126 else if (object_is_fixed_artifact(o_ptr))
2128 artifact_type *a_ptr = &a_info[o_ptr->name1];
2129 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2131 t = object_desc_str(t, a_name + a_ptr->name);
2134 else if (o_ptr->inscription)
2136 concptr str = quark_str(o_ptr->inscription);
2145 if (*str == '#') break;
2151 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2153 /* Add the false name */
2154 t = object_desc_str(t,"『");
2155 t = object_desc_str(t, &str_aux[1]);
2156 t = object_desc_str(t,"』");
2161 if (object_is_smith(o_ptr))
2163 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2166 /* Hack -- Append "Artifact" or "Special" names */
2167 if (known && !have_flag(flgs, TR_FULL_NAME))
2169 /* Is it a new random artifact ? */
2170 if (o_ptr->art_name)
2172 t = object_desc_chr(t, ' ');
2173 t = object_desc_str(t, quark_str(o_ptr->art_name));
2176 /* Grab any artifact name */
2177 else if (object_is_fixed_artifact(o_ptr))
2179 artifact_type *a_ptr = &a_info[o_ptr->name1];
2181 t = object_desc_chr(t, ' ');
2182 t = object_desc_str(t, a_name + a_ptr->name);
2185 /* Grab any ego-item name */
2188 if (object_is_ego(o_ptr))
2190 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2192 t = object_desc_chr(t, ' ');
2193 t = object_desc_str(t, e_name + e_ptr->name);
2196 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2199 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2201 /* Add the false name */
2202 t = object_desc_chr(t, ' ');
2203 t = object_desc_str(t, &str[1]);
2210 /* No more details wanted */
2211 if (mode & OD_NAME_ONLY) goto object_desc_done;
2213 /* Hack -- Chests must be described in detail */
2214 if (o_ptr->tval == TV_CHEST)
2216 /* Not searched yet */
2222 /* May be "empty" */
2223 else if (!o_ptr->pval)
2225 t = object_desc_str(t, _("(空)", " (empty)"));
2228 /* May be "disarmed" */
2229 else if (o_ptr->pval < 0)
2231 if (chest_traps[0 - o_ptr->pval])
2233 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2237 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2241 /* Describe the traps, if any */
2244 /* Describe the traps */
2245 switch (chest_traps[o_ptr->pval])
2249 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2252 case CHEST_LOSE_STR:
2254 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2257 case CHEST_LOSE_CON:
2259 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2264 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2267 case CHEST_PARALYZE:
2269 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2274 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2278 case CHEST_BIRD_STORM:
2279 case CHEST_E_SUMMON:
2280 case CHEST_H_SUMMON:
2282 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2285 case CHEST_RUNES_OF_EVIL:
2287 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2292 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2297 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2305 /* Display the item like a weapon */
2306 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2308 /* Display the item like a weapon */
2309 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2312 /* Display the item like a weapon */
2313 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2315 /* Display the item like armour */
2316 if (o_ptr->ac) show_armour = TRUE;
2319 /* Dump base weapon info */
2320 switch (o_ptr->tval)
2322 /* Missiles and Weapons */
2331 /* In Vault Quest, hide the dice of target weapon. */
2332 if(object_is_quest_target(o_ptr) && !known)
2337 /* Append a "damage" string */
2338 t = object_desc_chr(t, ' ');
2339 t = object_desc_chr(t, p1);
2340 t = object_desc_num(t, o_ptr->dd);
2341 t = object_desc_chr(t, 'd');
2342 t = object_desc_num(t, o_ptr->ds);
2343 t = object_desc_chr(t, p2);
2349 /* Bows get a special "damage string" */
2352 /* Mega-Hack -- Extract the "base power" */
2353 power = bow_tmul(o_ptr->sval);
2355 /* Apply the "Extra Might" flag */
2356 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2358 /* Append a special "damage" string */
2359 t = object_desc_chr(t, ' ');
2360 t = object_desc_chr(t, p1);
2361 t = object_desc_chr(t, 'x');
2362 t = object_desc_num(t, power);
2363 t = object_desc_chr(t, p2);
2365 fire_rate = calc_num_fire(o_ptr);
2366 /* Show Fire rate */
2367 if (fire_rate != 0 && power > 0 && known)
2369 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2371 t = object_desc_chr(t, ' ');
2372 t = object_desc_chr(t, p1);
2373 t = object_desc_num(t, fire_rate/100);
2374 t = object_desc_chr(t, '.');
2375 t = object_desc_num(t, fire_rate%100);
2376 t = object_desc_str(t, "turn");
2377 t = object_desc_chr(t, p2);
2385 /* Add the weapon bonuses */
2388 /* Show the tohit/todam on request */
2391 t = object_desc_chr(t, ' ');
2392 t = object_desc_chr(t, p1);
2393 t = object_desc_int(t, o_ptr->to_h);
2394 t = object_desc_chr(t, ',');
2395 t = object_desc_int(t, o_ptr->to_d);
2396 t = object_desc_chr(t, p2);
2399 /* Show the tohit if needed */
2400 else if (o_ptr->to_h)
2402 t = object_desc_chr(t, ' ');
2403 t = object_desc_chr(t, p1);
2404 t = object_desc_int(t, o_ptr->to_h);
2405 t = object_desc_chr(t, p2);
2408 /* Show the todam if needed */
2409 else if (o_ptr->to_d)
2411 t = object_desc_chr(t, ' ');
2412 t = object_desc_chr(t, p1);
2413 t = object_desc_int(t, o_ptr->to_d);
2414 t = object_desc_chr(t, p2);
2418 bow_ptr = &inventory[INVEN_BOW];
2420 /* If have a firing weapon + ammo matches bow */
2421 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2423 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2424 int tmul = bow_tmul(bow_ptr->sval);
2425 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2427 /* See if the bow is "known" - then set damage bonus */
2428 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2430 /* Effect of ammo */
2431 if (known) avgdam += (o_ptr->to_d * 10);
2433 /* Get extra "power" from "extra might" */
2434 if (p_ptr->xtra_might) tmul++;
2436 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2438 /* Launcher multiplier */
2440 avgdam /= (100 * 10);
2442 /* Get extra damage from concentration */
2443 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2445 if (avgdam < 0) avgdam = 0;
2447 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2448 t = object_desc_chr(t, ' ');
2449 t = object_desc_chr(t, p1);
2451 if(show_ammo_no_crit)
2453 /* Damage with no-crit */
2454 t = object_desc_num(t, avgdam);
2455 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2458 /* Apply Expect damage of Critical */
2459 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2460 t = object_desc_num(t, avgdam);
2462 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2463 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2465 if (p_ptr->num_fire == 0)
2467 t = object_desc_chr(t, '0');
2471 /* Calc effects of energy */
2472 avgdam *= (p_ptr->num_fire * 100);
2473 avgdam /= energy_fire;
2474 t = object_desc_num(t, avgdam);
2475 t = object_desc_str(t, show_ammo_detail ? "/current_world_ptr->game_turn" : "");
2477 if(show_ammo_crit_ratio)
2479 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2481 t = object_desc_chr(t, '/');
2482 t = object_desc_num(t, percent / 100);
2483 t = object_desc_chr(t, '.');
2484 if(percent % 100 < 10)
2486 t = object_desc_chr(t, '0');
2488 t = object_desc_num(t, percent % 100);
2489 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2493 t = object_desc_chr(t, p2);
2495 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2497 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2498 s16b energy_fire = 100 - p_ptr->lev;
2500 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2502 /* Display (shot damage/ avg damage) */
2503 t = object_desc_chr(t, ' ');
2504 t = object_desc_chr(t, p1);
2505 t = object_desc_num(t, avgdam);
2506 t = object_desc_chr(t, '/');
2508 /* Calc effects of energy */
2509 avgdam = 100 * avgdam / energy_fire;
2511 t = object_desc_num(t, avgdam);
2512 t = object_desc_chr(t, p2);
2515 /* Add the armor bonuses */
2518 /* Show the armor class info */
2521 t = object_desc_chr(t, ' ');
2522 t = object_desc_chr(t, b1);
2523 t = object_desc_num(t, o_ptr->ac);
2524 t = object_desc_chr(t, ',');
2525 t = object_desc_int(t, o_ptr->to_a);
2526 t = object_desc_chr(t, b2);
2529 /* No base armor, but does increase armor */
2530 else if (o_ptr->to_a)
2532 t = object_desc_chr(t, ' ');
2533 t = object_desc_chr(t, b1);
2534 t = object_desc_int(t, o_ptr->to_a);
2535 t = object_desc_chr(t, b2);
2539 /* Hack -- always show base armor */
2540 else if (show_armour)
2542 t = object_desc_chr(t, ' ');
2543 t = object_desc_chr(t, b1);
2544 t = object_desc_num(t, o_ptr->ac);
2545 t = object_desc_chr(t, b2);
2549 /* No more details wanted */
2550 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2553 if (known) /* Known item only */
2556 * Hack -- Wands and Staffs have charges. Make certain how many charges
2557 * a stack of staffs really has is clear. -LM-
2559 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2561 /* Dump " (N charges)" */
2562 t = object_desc_chr(t, ' ');
2563 t = object_desc_chr(t, p1);
2565 /* Clear explaination for staffs. */
2566 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2568 t = object_desc_num(t, o_ptr->number);
2569 t = object_desc_str(t, "x ");
2571 t = object_desc_num(t, o_ptr->pval);
2573 t = object_desc_str(t, "回分");
2575 t = object_desc_str(t, " charge");
2576 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2579 t = object_desc_chr(t, p2);
2581 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2582 * be in any state of charge or discharge, this now includes a number. -LM-
2584 else if (o_ptr->tval == TV_ROD)
2586 /* Hack -- Dump " (# charging)" if relevant */
2589 /* Stacks of rods display an exact count of charging rods. */
2590 if (o_ptr->number > 1)
2593 if (k_ptr->pval == 0) k_ptr->pval = 1;
2595 /* Find out how many rods are charging, by dividing
2596 * current timeout by each rod's maximum timeout.
2597 * Ensure that any remainder is rounded up. Display
2598 * very discharged stacks as merely fully discharged.
2600 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2601 if (power > o_ptr->number) power = o_ptr->number;
2603 /* Display prettily. */
2604 t = object_desc_str(t, " (");
2605 t = object_desc_num(t, power);
2606 t = object_desc_str(t, _("本 充填中)", " charging)"));
2609 /* "one Rod of Perception (1 charging)" would look tacky. */
2612 t = object_desc_str(t, _("(充填中)", " (charging)"));
2617 /* Dump "pval" flags for wearable items */
2618 if (have_pval_flags(flgs))
2620 /* Start the display */
2621 t = object_desc_chr(t, ' ');
2622 t = object_desc_chr(t, p1);
2624 /* Dump the "pval" itself */
2625 t = object_desc_int(t, o_ptr->pval);
2627 /* Do not display the "pval" flags */
2628 if (have_flag(flgs, TR_HIDE_TYPE))
2633 else if (have_flag(flgs, TR_SPEED))
2635 /* Dump " to speed" */
2636 t = object_desc_str(t, _("加速", " to speed"));
2640 else if (have_flag(flgs, TR_BLOWS))
2644 t = object_desc_str(t, "攻撃");
2646 t = object_desc_str(t, " attack");
2649 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2654 else if (have_flag(flgs, TR_STEALTH))
2656 /* Dump " to stealth" */
2657 t = object_desc_str(t, _("隠密", " to stealth"));
2661 else if (have_flag(flgs, TR_SEARCH))
2663 /* Dump " to searching" */
2664 t = object_desc_str(t, _("探索", " to searching"));
2668 else if (have_flag(flgs, TR_INFRA))
2670 /* Dump " to infravision" */
2671 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2674 /* Finish the display */
2675 t = object_desc_chr(t, p2);
2678 /* Hack -- Process Lanterns/Torches */
2679 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2681 /* Hack -- Turns of light for normal lites */
2683 t = object_desc_chr(t, '(');
2685 t = object_desc_str(t, " (with ");
2688 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2689 else t = object_desc_num(t, o_ptr->xtra4);
2690 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2693 /* Indicate charging objects, but not rods. */
2694 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2696 /* Hack -- Dump " (charging)" if relevant */
2697 t = object_desc_str(t, _("(充填中)", " (charging)"));
2702 /* No more details wanted */
2703 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2706 /* Prepare real inscriptions in a buffer */
2709 /* Auto abbreviation inscribe */
2710 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2712 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2723 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2727 /* Use the standard inscription if available */
2728 if (o_ptr->inscription)
2732 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2734 /* Get inscription and convert {%} */
2735 get_inscription(buff, o_ptr);
2737 /* strcat with correct treating of kanji */
2738 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2742 /* No fake inscription yet */
2743 fake_insc_buf[0] = '\0';
2745 /* Use the game-generated "feeling" otherwise, if available */
2748 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2751 /* Note "cursed" if the item is known to be cursed */
2752 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2754 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2757 /* Note "unidentified" if the item is unidentified */
2758 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2759 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2761 && !(o_ptr->ident & IDENT_SENSE))
2763 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2766 /* Mega-Hack -- note empty wands/staffs */
2767 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2769 strcpy(fake_insc_buf, _("空", "empty"));
2772 /* Note "tried" if the object has been tested unsuccessfully */
2773 else if (!aware && object_is_tried(o_ptr))
2775 strcpy(fake_insc_buf, _("未判明", "tried"));
2778 /* Note the discount, if any */
2779 if (o_ptr->discount)
2781 /* Hidden by real inscription unless in a store */
2782 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2784 char discount_num_buf[4];
2786 /* Append to other fake inscriptions if any */
2787 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2789 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2790 strcat(fake_insc_buf, discount_num_buf);
2791 strcat(fake_insc_buf, _("%引き", "% off"));
2796 /* Append the inscription, if any */
2797 if (fake_insc_buf[0] || tmp_val2[0])
2799 /* Append the inscription */
2800 t = object_desc_chr(t, ' ');
2801 t = object_desc_chr(t, c1);
2803 /* Append fake inscriptions */
2804 if (fake_insc_buf[0])
2806 t = object_desc_str(t, fake_insc_buf);
2809 /* Append a separater */
2810 if (fake_insc_buf[0] && tmp_val2[0])
2812 t = object_desc_chr(t, ',');
2813 t = object_desc_chr(t, ' ');
2816 /* Append real inscriptions */
2819 t = object_desc_str(t, tmp_val2);
2822 t = object_desc_chr(t, c2);
2826 my_strcpy(buf, tmp_val, MAX_NLEN);