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 "objectkind.h"
20 #include "object-hook.h"
21 #include "object-flavor.h"
28 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
30 * @return 簡易名称を明らかにするならTRUEを返す。
32 * This function is used only by "flavor_init()"
34 static bool object_easy_know(int i)
36 object_kind *k_ptr = &k_info[i];
38 /* Analyze the "tval" */
53 case TV_HISSATSU_BOOK:
70 /* All Food, Potions, Scrolls, Rods */
84 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
85 * @param out_string 作成した名を保管する参照ポインタ
87 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
88 * syllables 配列と elvish.txt を組み合わせる。\n
90 void get_table_name_aux(char *out_string)
94 get_rnd_line("aname_j.txt", 1, Syllable);
95 strcpy(out_string, Syllable);
96 get_rnd_line("aname_j.txt", 2, Syllable);
97 strcat(out_string, Syllable);
99 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
101 static concptr syllables[MAX_SYLLABLES] = {
102 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
103 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
104 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
105 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
106 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
107 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
108 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
109 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
110 "kho", "kli", "klis", "la", "lech", "man", "mar",
111 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
112 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
113 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
114 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
115 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
116 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
117 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
118 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
119 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
120 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
121 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
125 int testcounter = randint1(3) + 1;
127 strcpy(out_string, "");
129 if (randint1(3) == 2)
131 while (testcounter--)
132 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
137 testcounter = randint1(2) + 1;
138 while (testcounter--)
140 (void)get_rnd_line("elvish.txt", 0, Syllable);
141 strcat(out_string, Syllable);
145 out_string[0] = toupper(out_string[1]);
147 out_string[16] = '\0';
152 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
153 * @param out_string 作成した名を保管する参照ポインタ
155 * @details get_table_name_aux()ほぼ完全に実装を依存している。
157 void get_table_name(char *out_string)
160 get_table_name_aux(buff);
161 sprintf(out_string, _("『%s』", "'%s'"), buff);
165 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
166 * @param out_string 作成した名を保管する参照ポインタ
168 * @details sname.txtが語幹の辞書となっている。
170 void get_table_sindarin_aux(char *out_string)
177 get_rnd_line("sname.txt", 1, Syllable);
179 strcpy(tmp, Syllable);
181 strcpy(out_string, Syllable);
184 get_rnd_line("sname.txt", 2, Syllable);
186 strcat(tmp, Syllable);
187 sindarin_to_kana(out_string, tmp);
189 strcat(out_string, Syllable);
194 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
195 * @param out_string 作成した名を保管する参照ポインタ
197 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
199 void get_table_sindarin(char *out_string)
202 get_table_sindarin_aux(buff);
203 sprintf(out_string, _("『%s』", "'%s'"), buff);
208 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
209 * @param tval シャッフルしたいtval
211 * @details 巻物、各種魔道具などに利用される。
213 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
215 KIND_OBJECT_IDX *k_idx_list;
216 KIND_OBJECT_IDX k_idx_list_num = 0;
219 /* Allocate an array for a list of k_idx */
220 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
222 /* Search objects with given tval for shuffle */
223 for (i = 0; i < max_k_idx; i++)
225 object_kind *k_ptr = &k_info[i];
228 if (k_ptr->tval != tval) continue;
230 /* Paranoia -- Skip objects without flavor */
231 if (!k_ptr->flavor) continue;
233 /* Skip objects with a fixed flavor name */
234 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
237 k_idx_list[k_idx_list_num] = i;
239 /* Increase number of remembered indices */
243 /* Shuffle flavors */
244 for (i = 0; i < k_idx_list_num; i++)
246 object_kind *k1_ptr = &k_info[k_idx_list[i]];
247 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
249 /* Swap flavors of this pair */
250 s16b tmp = k1_ptr->flavor;
251 k1_ptr->flavor = k2_ptr->flavor;
252 k2_ptr->flavor = tmp;
255 /* Free an array for a list of k_idx */
256 C_KILL(k_idx_list, max_k_idx, s16b);
260 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
263 * Prepare the "variable" part of the "k_info" array.\n
265 * The "color"/"metal"/"type" of an item is its "flavor".\n
266 * For the most part, flavors are assigned randomly each game.\n
268 * Initialize descriptions for the "colored" objects, including:\n
269 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
271 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
272 * Slime Mold Juice, Unused Potion).\n
274 * Scroll titles are always between 6 and 14 letters long. This is\n
275 * ensured because every title is composed of whole words, where every\n
276 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
277 * letters each), and that no scroll is finished until it attempts to\n
278 * grow beyond 15 letters. The first time this can happen is when the\n
279 * current title has 6 letters and the new word has 8 letters, which\n
280 * would result in a 6 letter scroll title.\n
282 * Duplicate titles are avoided by requiring that no two scrolls share\n
283 * the same first four letters (not the most efficient method, and not\n
284 * the least efficient method, but it will always work).\n
286 * Hack -- make sure everything stays the same for each saved game\n
287 * This is accomplished by the use of a saved "random seed", as in\n
288 * "town_gen()". Since no other functions are called while the special\n
289 * seed is in effect, so this function is pretty "safe".\n
291 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
293 void flavor_init(void)
296 u32b state_backup[4];
298 /* Hack -- Backup the RNG state */
299 Rand_state_backup(state_backup);
301 /* Hack -- Induce consistant flavors */
302 Rand_state_set(current_world_ptr->seed_flavor);
305 /* Initialize flavor index of each object by itself */
306 for (i = 0; i < max_k_idx; i++)
308 object_kind *k_ptr = &k_info[i];
310 /* Skip objects without flavor name */
311 if (!k_ptr->flavor_name) continue;
314 * Initialize flavor index to itself
315 * -> Shuffle it later
321 shuffle_flavors(TV_RING);
323 /* Shuffle Amulets */
324 shuffle_flavors(TV_AMULET);
327 shuffle_flavors(TV_STAFF);
330 shuffle_flavors(TV_WAND);
333 shuffle_flavors(TV_ROD);
335 /* Shuffle Mushrooms */
336 shuffle_flavors(TV_FOOD);
338 /* Shuffle Potions */
339 shuffle_flavors(TV_POTION);
341 /* Shuffle Scrolls */
342 shuffle_flavors(TV_SCROLL);
345 /* Hack -- Restore the RNG state */
346 Rand_state_restore(state_backup);
348 /* Analyze every object */
349 for (i = 1; i < max_k_idx; i++)
351 object_kind *k_ptr = &k_info[i];
353 /* Skip "empty" objects */
354 if (!k_ptr->name) continue;
356 /* No flavor yields aware */
357 if (!k_ptr->flavor) k_ptr->aware = TRUE;
359 /* Check for "easily known" */
360 k_ptr->easy_know = object_easy_know(i);
366 * @brief 対象文字配列に一文字だけをコピーする。
367 * @param t 保管先文字列ポインタ
371 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
372 * and return a pointer to the terminator (t + 1).\n
374 static char *object_desc_chr(char *t, char c)
385 * @brief 対象文字配列に文字列をコピーする。
386 * @param t 保管先文字列ポインタ
387 * @param s コピーしたい文字列ポインタ
390 * Print a string "s" into a string "t", as if by strcpy(t, s),
391 * and return a pointer to the terminator.
393 static char *object_desc_str(char *t, concptr s)
395 /* Copy the string */
396 while (*s) *t++ = *s++;
404 * @brief 対象文字配列に符号なし整数値をコピーする。
405 * @param t 保管先文字列ポインタ
409 * Print an unsigned number "n" into a string "t", as if by
410 * sprintf(t, "%u", n), and return a pointer to the terminator.
412 static char *object_desc_num(char *t, uint n)
416 /* Find "size" of "n" */
417 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
419 /* Dump each digit */
425 /* Remove the digit */
428 /* Process next digit */
442 * @brief 日本語の個数表示ルーチン
443 * @param t 保管先文字列ポインタ
444 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
447 * cmd1.c で流用するために object_desc_japanese から移動した。
449 char *object_desc_kosuu(char *t, object_type *o_ptr)
451 t = object_desc_num(t, o_ptr->number);
463 t = object_desc_str(t, "本");
468 t = object_desc_str(t, "巻");
473 t = object_desc_str(t, "服");
477 case TV_SORCERY_BOOK:
485 case TV_CRUSADE_BOOK:
487 case TV_HISSATSU_BOOK:
490 t = object_desc_str(t, "冊");
498 t = object_desc_str(t, "着");
505 t = object_desc_str(t, "振");
510 t = object_desc_str(t, "足");
515 t = object_desc_str(t, "枚");
521 if(o_ptr->sval == SV_FOOD_JERKY)
523 t = object_desc_str(t, "切れ");
529 if (o_ptr->number < 10)
531 t = object_desc_str(t, "つ");
535 t = object_desc_str(t, "個");
545 * @brief 対象文字配列に符号あり整数値をコピーする。
546 * @param t 保管先文字列ポインタ
550 * Print an signed number "v" into a string "t", as if by
551 * sprintf(t, "%+d", n), and return a pointer to the terminator.
552 * Note that we always print a sign, either "+" or "-".
554 static char *object_desc_int(char *t, sint v)
561 /* Take the absolute value */
564 /* Use a "minus" sign */
568 /* Positive (or zero) */
571 /* Use the actual number */
574 /* Use a "plus" sign */
578 /* Find "size" of "n" */
579 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
581 /* Dump each digit */
587 /* Remove the digit */
590 /* Process next digit */
601 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
603 typedef struct flag_insc_table
614 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
615 static flag_insc_table flag_insc_plus[] =
617 { "攻", "At", TR_BLOWS, -1 },
618 { "速", "Sp", TR_SPEED, -1 },
619 { "腕", "St", TR_STR, -1 },
620 { "知", "In", TR_INT, -1 },
621 { "賢", "Wi", TR_WIS, -1 },
622 { "器", "Dx", TR_DEX, -1 },
623 { "耐", "Cn", TR_CON, -1 },
624 { "魅", "Ch", TR_CHR, -1 },
625 { "道", "Md", TR_MAGIC_MASTERY, -1 },
626 { "隠", "Sl", TR_STEALTH, -1 },
627 { "探", "Sr", TR_SEARCH, -1 },
628 { "赤", "If", TR_INFRA, -1 },
629 { "掘", "Dg", TR_TUNNEL, -1 },
630 { NULL, NULL, 0, -1 }
633 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
634 static flag_insc_table flag_insc_immune[] =
636 { "酸", "Ac", TR_IM_ACID, -1 },
637 { "電", "El", TR_IM_ELEC, -1 },
638 { "火", "Fi", TR_IM_FIRE, -1 },
639 { "冷", "Co", TR_IM_COLD, -1 },
640 { NULL, NULL, 0, -1 }
643 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
644 static flag_insc_table flag_insc_resistance[] =
646 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
647 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
648 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
649 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
650 { "毒", "Po", TR_RES_POIS, -1 },
651 { "閃", "Li", TR_RES_LITE, -1 },
652 { "暗", "Dk", TR_RES_DARK, -1 },
653 { "破", "Sh", TR_RES_SHARDS, -1 },
654 { "盲", "Bl", TR_RES_BLIND, -1 },
655 { "乱", "Cf", TR_RES_CONF, -1 },
656 { "轟", "So", TR_RES_SOUND, -1 },
657 { "獄", "Nt", TR_RES_NETHER, -1 },
658 { "因", "Nx", TR_RES_NEXUS, -1 },
659 { "沌", "Ca", TR_RES_CHAOS, -1 },
660 { "劣", "Di", TR_RES_DISEN, -1 },
661 { "恐", "Fe", TR_RES_FEAR, -1 },
662 { NULL, NULL, 0, -1 }
665 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
666 static flag_insc_table flag_insc_misc[] =
668 { "易", "Es", TR_EASY_SPELL, -1 },
669 { "減", "Dm", TR_DEC_MANA, -1 },
670 { "投", "Th", TR_THROW, -1 },
671 { "反", "Rf", TR_REFLECT, -1 },
672 { "麻", "Fa", TR_FREE_ACT, -1 },
673 { "視", "Si", TR_SEE_INVIS, -1 },
674 { "経", "Hl", TR_HOLD_EXP, -1 },
675 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
676 { "活", "Rg", TR_REGEN, -1 },
677 { "浮", "Lv", TR_LEVITATION, -1 },
678 { "明", "Lu", TR_LITE_1, -1 },
679 { "明", "Lu", TR_LITE_2, -1 },
680 { "明", "Lu", TR_LITE_3, -1 },
681 { "闇", "Dl", TR_LITE_M1, -1 },
682 { "闇", "Dl", TR_LITE_M2, -1 },
683 { "闇", "Dl", TR_LITE_M3, -1 },
684 { "警", "Wr", TR_WARNING, -1 },
685 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
686 { "射", "Xs", TR_XTRA_SHOTS, -1 },
687 { "瞬", "Te", TR_TELEPORT, -1 },
688 { "怒", "Ag", TR_AGGRAVATE, -1 },
689 { "祝", "Bs", TR_BLESSED, -1 },
690 { "忌", "Ty", TR_TY_CURSE, -1 },
691 { "呪", "C-", TR_ADD_L_CURSE, -1 },
692 { "詛", "C+", TR_ADD_H_CURSE, -1 },
693 { NULL, NULL, 0, -1 }
696 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
697 static flag_insc_table flag_insc_aura[] =
699 { "炎", "F", TR_SH_FIRE, -1 },
700 { "電", "E", TR_SH_ELEC, -1 },
701 { "冷", "C", TR_SH_COLD, -1 },
702 { "魔", "M", TR_NO_MAGIC, -1 },
703 { "瞬", "T", TR_NO_TELE, -1 },
704 { NULL, NULL, 0, -1 }
707 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
708 static flag_insc_table flag_insc_brand[] =
710 { "酸", "A", TR_BRAND_ACID, -1 },
711 { "電", "E", TR_BRAND_ELEC, -1 },
712 { "焼", "F", TR_BRAND_FIRE, -1 },
713 { "凍", "Co", TR_BRAND_COLD, -1 },
714 { "毒", "P", TR_BRAND_POIS, -1 },
715 { "沌", "Ca", TR_CHAOTIC, -1 },
716 { "吸", "V", TR_VAMPIRIC, -1 },
717 { "震", "Q", TR_IMPACT, -1 },
718 { "切", "S", TR_VORPAL, -1 },
719 { "理", "M", TR_FORCE_WEAPON, -1 },
720 { NULL, NULL, 0, -1 }
723 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
724 static flag_insc_table flag_insc_kill[] =
726 { "邪", "*", TR_KILL_EVIL, -1 },
727 { "人", "p", TR_KILL_HUMAN, -1 },
728 { "龍", "D", TR_KILL_DRAGON, -1 },
729 { "オ", "o", TR_KILL_ORC, -1 },
730 { "ト", "T", TR_KILL_TROLL, -1 },
731 { "巨", "P", TR_KILL_GIANT, -1 },
732 { "デ", "U", TR_KILL_DEMON, -1 },
733 { "死", "L", TR_KILL_UNDEAD, -1 },
734 { "動", "Z", TR_KILL_ANIMAL, -1 },
735 { NULL, NULL, 0, -1 }
738 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
739 static flag_insc_table flag_insc_slay[] =
741 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
742 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
743 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
744 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
745 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
746 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
747 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
748 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
749 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
750 { NULL, NULL, 0, -1 }
753 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
754 static flag_insc_table flag_insc_esp1[] =
756 { "感", "Tele", TR_TELEPATHY, -1 },
757 { "邪", "Evil", TR_ESP_EVIL, -1 },
758 { "善", "Good", TR_ESP_GOOD, -1 },
759 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
760 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
761 { NULL, NULL, 0, -1 }
764 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
765 static flag_insc_table flag_insc_esp2[] =
767 { "人", "p", TR_ESP_HUMAN, -1 },
768 { "竜", "D", TR_ESP_DRAGON, -1 },
769 { "オ", "o", TR_ESP_ORC, -1 },
770 { "ト", "T", TR_ESP_TROLL, -1 },
771 { "巨", "P", TR_ESP_GIANT, -1 },
772 { "デ", "U", TR_ESP_DEMON, -1 },
773 { "死", "L", TR_ESP_UNDEAD, -1 },
774 { "動", "Z", TR_ESP_ANIMAL, -1 },
775 { NULL, NULL, 0, -1 }
778 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
779 static flag_insc_table flag_insc_sust[] =
781 { "腕", "St", TR_SUST_STR, -1 },
782 { "知", "In", TR_SUST_INT, -1 },
783 { "賢", "Wi", TR_SUST_WIS, -1 },
784 { "器", "Dx", TR_SUST_DEX, -1 },
785 { "耐", "Cn", TR_SUST_CON, -1 },
786 { "魅", "Ch", TR_SUST_CHR, -1 },
787 { NULL, NULL, 0, -1 }
791 static flag_insc_table flag_insc_plus[] =
793 { "At", TR_BLOWS, -1 },
794 { "Sp", TR_SPEED, -1 },
795 { "St", TR_STR, -1 },
796 { "In", TR_INT, -1 },
797 { "Wi", TR_WIS, -1 },
798 { "Dx", TR_DEX, -1 },
799 { "Cn", TR_CON, -1 },
800 { "Ch", TR_CHR, -1 },
801 { "Md", TR_MAGIC_MASTERY, -1 },
802 { "Sl", TR_STEALTH, -1 },
803 { "Sr", TR_SEARCH, -1 },
804 { "If", TR_INFRA, -1 },
805 { "Dg", TR_TUNNEL, -1 },
809 static flag_insc_table flag_insc_immune[] =
811 { "Ac", TR_IM_ACID, -1 },
812 { "El", TR_IM_ELEC, -1 },
813 { "Fi", TR_IM_FIRE, -1 },
814 { "Co", TR_IM_COLD, -1 },
818 static flag_insc_table flag_insc_resistance[] =
820 { "Ac", TR_RES_ACID, TR_IM_ACID },
821 { "El", TR_RES_ELEC, TR_IM_ELEC },
822 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
823 { "Co", TR_RES_COLD, TR_IM_COLD },
824 { "Po", TR_RES_POIS, -1 },
825 { "Li", TR_RES_LITE, -1 },
826 { "Dk", TR_RES_DARK, -1 },
827 { "Sh", TR_RES_SHARDS, -1 },
828 { "Bl", TR_RES_BLIND, -1 },
829 { "Cf", TR_RES_CONF, -1 },
830 { "So", TR_RES_SOUND, -1 },
831 { "Nt", TR_RES_NETHER, -1 },
832 { "Nx", TR_RES_NEXUS, -1 },
833 { "Ca", TR_RES_CHAOS, -1 },
834 { "Di", TR_RES_DISEN, -1 },
835 { "Fe", TR_RES_FEAR, -1 },
839 static flag_insc_table flag_insc_misc[] =
841 { "Es", TR_EASY_SPELL, -1 },
842 { "Dm", TR_DEC_MANA, -1 },
843 { "Th", TR_THROW, -1 },
844 { "Rf", TR_REFLECT, -1 },
845 { "Fa", TR_FREE_ACT, -1 },
846 { "Si", TR_SEE_INVIS, -1 },
847 { "Hl", TR_HOLD_EXP, -1 },
848 { "Sd", TR_SLOW_DIGEST, -1 },
849 { "Rg", TR_REGEN, -1 },
850 { "Lv", TR_LEVITATION, -1 },
851 { "Lu", TR_LITE_1, -1 },
852 { "Lu", TR_LITE_2, -1 },
853 { "Lu", TR_LITE_3, -1 },
854 { "Dl", TR_LITE_M1, -1 },
855 { "Dl", TR_LITE_M2, -1 },
856 { "Dl", TR_LITE_M3, -1 },
857 { "Wr", TR_WARNING, -1 },
858 { "Xm", TR_XTRA_MIGHT, -1 },
859 { "Xs", TR_XTRA_SHOTS, -1 },
860 { "Te", TR_TELEPORT, -1 },
861 { "Ag", TR_AGGRAVATE, -1 },
862 { "Bs", TR_BLESSED, -1 },
863 { "Ty", TR_TY_CURSE, -1 },
864 { "C-", TR_ADD_L_CURSE, -1 },
865 { "C+", TR_ADD_H_CURSE, -1 },
869 static flag_insc_table flag_insc_aura[] =
871 { "F", TR_SH_FIRE, -1 },
872 { "E", TR_SH_ELEC, -1 },
873 { "C", TR_SH_COLD, -1 },
874 { "M", TR_NO_MAGIC, -1 },
875 { "T", TR_NO_TELE, -1 },
879 static flag_insc_table flag_insc_brand[] =
881 { "A", TR_BRAND_ACID, -1 },
882 { "E", TR_BRAND_ELEC, -1 },
883 { "F", TR_BRAND_FIRE, -1 },
884 { "Co", TR_BRAND_COLD, -1 },
885 { "P", TR_BRAND_POIS, -1 },
886 { "Ca", TR_CHAOTIC, -1 },
887 { "V", TR_VAMPIRIC, -1 },
888 { "Q", TR_IMPACT, -1 },
889 { "S", TR_VORPAL, -1 },
890 { "M", TR_FORCE_WEAPON, -1 },
894 static flag_insc_table flag_insc_kill[] =
896 { "*", TR_KILL_EVIL, -1 },
897 { "p", TR_KILL_HUMAN, -1 },
898 { "D", TR_KILL_DRAGON, -1 },
899 { "o", TR_KILL_ORC, -1 },
900 { "T", TR_KILL_TROLL, -1 },
901 { "P", TR_KILL_GIANT, -1 },
902 { "U", TR_KILL_DEMON, -1 },
903 { "L", TR_KILL_UNDEAD, -1 },
904 { "Z", TR_KILL_ANIMAL, -1 },
908 static flag_insc_table flag_insc_slay[] =
910 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
911 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
912 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
913 { "o", TR_SLAY_ORC, TR_KILL_ORC },
914 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
915 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
916 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
917 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
918 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
922 static flag_insc_table flag_insc_esp1[] =
924 { "Tele", TR_TELEPATHY, -1 },
925 { "Evil", TR_ESP_EVIL, -1 },
926 { "Good", TR_ESP_GOOD, -1 },
927 { "Nolv", TR_ESP_NONLIVING, -1 },
928 { "Uniq", TR_ESP_UNIQUE, -1 },
932 static flag_insc_table flag_insc_esp2[] =
934 { "p", TR_ESP_HUMAN, -1 },
935 { "D", TR_ESP_DRAGON, -1 },
936 { "o", TR_ESP_ORC, -1 },
937 { "T", TR_ESP_TROLL, -1 },
938 { "P", TR_ESP_GIANT, -1 },
939 { "U", TR_ESP_DEMON, -1 },
940 { "L", TR_ESP_UNDEAD, -1 },
941 { "Z", TR_ESP_ANIMAL, -1 },
945 static flag_insc_table flag_insc_sust[] =
947 { "St", TR_SUST_STR, -1 },
948 { "In", TR_SUST_INT, -1 },
949 { "Wi", TR_SUST_WIS, -1 },
950 { "Dx", TR_SUST_DEX, -1 },
951 { "Cn", TR_SUST_CON, -1 },
952 { "Ch", TR_SUST_CHR, -1 },
957 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
958 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
961 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
962 * @param fi_ptr 参照する特性表示記号テーブル
963 * @param flgs 対応するオブジェクトのフラグ文字列
964 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
965 * @param ptr フラグ群を保管する文字列参照ポインタ
966 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
968 * Print an signed number "v" into a string "t", as if by
969 * sprintf(t, "%+d", n), and return a pointer to the terminator.
970 * Note that we always print a sign, either "+" or "-".
972 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
978 while (fi_ptr->english)
980 if (have_flag(flgs, fi_ptr->flag) &&
981 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
983 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
985 ADD_INSC(fi_ptr->english);
995 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
996 * @param fi_ptr 参照する特性表示記号テーブル
997 * @param flgs 対応するオブジェクトのフラグ文字列
998 * @return 1つでも該当の特性があったらTRUEを返す。
1000 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
1002 while (fi_ptr->english)
1004 if (have_flag(flgs, fi_ptr->flag) &&
1005 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1014 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1015 * @param ptr 特性短縮表記を格納する文字列ポインタ
1016 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1017 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1018 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1019 * @return ptrと同じアドレス
1021 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1023 char *prev_ptr = ptr;
1024 BIT_FLAGS flgs[TR_FLAG_SIZE];
1025 object_flags(o_ptr, flgs);
1027 /* Remove obvious flags */
1030 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1034 for (j = 0; j < TR_FLAG_SIZE; j++)
1035 flgs[j] &= ~k_ptr->flags[j];
1037 if (object_is_fixed_artifact(o_ptr))
1039 artifact_type *a_ptr = &a_info[o_ptr->name1];
1041 for (j = 0; j < TR_FLAG_SIZE; j++)
1042 flgs[j] &= ~a_ptr->flags[j];
1045 if (object_is_ego(o_ptr))
1047 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1049 for (j = 0; j < TR_FLAG_SIZE; j++)
1050 flgs[j] &= ~e_ptr->flags[j];
1054 /* Remove lite flags when this is a dark lite object */
1055 if (have_dark_flag(flgs))
1057 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1058 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1059 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1061 else if (have_lite_flag(flgs))
1063 add_flag(flgs, TR_LITE_1);
1064 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1065 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1069 if (have_flag_of(flag_insc_plus, flgs))
1074 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1077 if (have_flag_of(flag_insc_immune, flgs))
1079 if (!kanji && ptr != prev_ptr)
1086 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1089 if (have_flag_of(flag_insc_resistance, flgs))
1093 else if (ptr != prev_ptr)
1099 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1102 if (have_flag_of(flag_insc_misc, flgs))
1104 if (ptr != prev_ptr)
1110 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1113 if (have_flag_of(flag_insc_aura, flgs))
1117 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1120 if (have_flag_of(flag_insc_brand, flgs))
1122 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1125 if (have_flag_of(flag_insc_kill, flgs))
1127 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1130 if (have_flag_of(flag_insc_slay, flgs))
1132 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1137 if (have_flag_of(flag_insc_esp1, flgs) ||
1138 have_flag_of(flag_insc_esp2, flgs))
1140 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1141 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1145 if (have_flag_of(flag_insc_esp1, flgs))
1147 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1148 if (have_flag_of(flag_insc_esp2, flgs))
1150 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1154 if (have_flag_of(flag_insc_sust, flgs))
1158 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1167 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1168 * @param buff 特性短縮表記を格納する文字列ポインタ
1169 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1172 static void get_inscription(char *buff, object_type *o_ptr)
1174 concptr insc = quark_str(o_ptr->inscription);
1177 /* Not fully identified */
1178 if (!(o_ptr->ident & IDENT_MENTAL))
1180 /* Copy until end of line or '#' */
1183 if (*insc == '#') break;
1185 if (iskanji(*insc)) *buff++ = *insc++;
1195 for (; *insc; insc++)
1197 /* Ignore fake artifact inscription */
1198 if (*insc == '#') break;
1200 /* {%} will be automatically converted */
1201 else if ('%' == *insc)
1205 concptr start = ptr;
1207 /* check for too long inscription */
1208 if (ptr >= buff + MAX_NLEN) continue;
1221 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1231 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1246 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1247 * @param buf 表記を返すための文字列参照ポインタ
1248 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1249 * @param mode 表記に関するオプション指定
1250 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1252 * One can choose the "verbosity" of the description, including whether\n
1253 * or not the "number" of items should be described, and how much detail\n
1254 * should be used when describing the item.\n
1256 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1257 * description, which can get pretty long, including incriptions, such as:\n
1258 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1259 * Note that the inscription will be clipped to keep the total description\n
1260 * under MAX_NLEN-1 chars (plus a terminator).\n
1262 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1263 * portable, versions of some common "sprintf()" commands.\n
1265 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1266 * the item is also an artifact, which should NEVER happen.\n
1268 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1269 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1270 * The "Specials" never use "modifiers" if they are "known", since they\n
1271 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1273 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1274 * plus the artifact name, just like any other artifact, if known.\n
1276 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1277 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1278 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1279 * they will append the artifact name, just like any artifact, if known.\n
1281 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1284 * OD_NAME_ONLY : The Cloak of Death\n
1285 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1286 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1287 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1289 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1290 * OD_NO_PLURAL : Forbidden use of plural \n
1291 * OD_STORE : Assume to be aware and known\n
1292 * OD_NO_FLAVOR : Allow to hidden flavor\n
1293 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1295 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1297 /* Extract object kind name */
1298 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1300 /* Extract default "base" string */
1301 concptr basenm = kindname;
1303 /* Assume no "modifier" string */
1304 concptr modstr = "";
1313 bool show_weapon = FALSE;
1314 bool show_armour = FALSE;
1319 char p1 = '(', p2 = ')';
1320 char b1 = '[', b2 = ']';
1321 char c1 = '{', c2 = '}';
1323 char tmp_val[MAX_NLEN+160];
1324 char tmp_val2[MAX_NLEN+10];
1325 char fake_insc_buf[30];
1327 BIT_FLAGS flgs[TR_FLAG_SIZE];
1329 object_type *bow_ptr;
1331 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1332 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1334 /* Extract some flags */
1335 object_flags(o_ptr, flgs);
1337 /* See if the object is "aware" */
1338 if (object_is_aware(o_ptr)) aware = TRUE;
1340 /* See if the object is "known" */
1341 if (object_is_known(o_ptr)) known = TRUE;
1343 /* Allow flavors to be hidden when aware */
1344 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1346 /* Object is in the p_ptr->inventory_list of a store or spoiler */
1347 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1349 /* Don't show flavors */
1352 /* Pretend known and aware */
1357 /* Force to be flavor name only */
1358 if (mode & OD_FORCE_FLAVOR)
1364 /* Cancel shuffling */
1365 flavor_k_ptr = k_ptr;
1368 /* Analyze the object */
1369 switch (o_ptr->tval)
1371 /* Some objects are easy to describe */
1385 monster_race *r_ptr = &r_info[o_ptr->pval];
1391 modstr = _(" (空)", " (empty)");
1396 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1399 concptr t = r_name + r_ptr->name;
1401 if (!(r_ptr->flags1 & RF1_UNIQUE))
1403 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1409 sprintf(tmp_val2, "(%s)", t);
1419 /* Figurines/Statues */
1423 monster_race *r_ptr = &r_info[o_ptr->pval];
1426 modstr = r_name + r_ptr->name;
1428 concptr t = r_name + r_ptr->name;
1430 if (!(r_ptr->flags1 & RF1_UNIQUE))
1432 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1449 monster_race *r_ptr = &r_info[o_ptr->pval];
1451 modstr = r_name + r_ptr->name;
1456 if (r_ptr->flags1 & RF1_UNIQUE)
1457 basenm = "& % of #";
1465 /* Missiles/ Bows/ Weapons */
1494 /* Lites (including a few "Specials") */
1500 /* Amulets (including a few "Specials") */
1503 /* Known artifacts */
1506 if (object_is_fixed_artifact(o_ptr)) break;
1507 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1510 /* Color the object */
1511 modstr = k_name + flavor_k_ptr->flavor_name;
1514 if (!flavor) basenm = "%のアミュレット";
1515 else if (aware) basenm = "%の#アミュレット";
1516 else basenm = "#アミュレット";
1518 if (!flavor) basenm = "& Amulet~ of %";
1519 else if (aware) basenm = "& # Amulet~ of %";
1520 else basenm = "& # Amulet~";
1526 /* Rings (including a few "Specials") */
1529 /* Known artifacts */
1532 if (object_is_fixed_artifact(o_ptr)) break;
1533 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1536 /* Color the object */
1537 modstr = k_name + flavor_k_ptr->flavor_name;
1540 if (!flavor) basenm = "%の指輪";
1541 else if (aware) basenm = "%の#指輪";
1542 else basenm = "#指輪";
1544 if (!flavor) basenm = "& Ring~ of %";
1545 else if (aware) basenm = "& # Ring~ of %";
1546 else basenm = "& # Ring~";
1549 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1561 /* Color the object */
1562 modstr = k_name + flavor_k_ptr->flavor_name;
1565 if (!flavor) basenm = "%の杖";
1566 else if (aware) basenm = "%の#杖";
1569 if (!flavor) basenm = "& Staff~ of %";
1570 else if (aware) basenm = "& # Staff~ of %";
1571 else basenm = "& # Staff~";
1579 /* Color the object */
1580 modstr = k_name + flavor_k_ptr->flavor_name;
1583 if (!flavor) basenm = "%の魔法棒";
1584 else if (aware) basenm = "%の#魔法棒";
1585 else basenm = "#魔法棒";
1587 if (!flavor) basenm = "& Wand~ of %";
1588 else if (aware) basenm = "& # Wand~ of %";
1589 else basenm = "& # Wand~";
1597 /* Color the object */
1598 modstr = k_name + flavor_k_ptr->flavor_name;
1601 if (!flavor) basenm = "%のロッド";
1602 else if (aware) basenm = "%の#ロッド";
1603 else basenm = "#ロッド";
1605 if (!flavor) basenm = "& Rod~ of %";
1606 else if (aware) basenm = "& # Rod~ of %";
1607 else basenm = "& # Rod~";
1615 /* Color the object */
1616 modstr = k_name + flavor_k_ptr->flavor_name;
1619 if (!flavor) basenm = "%の巻物";
1620 else if (aware) basenm = "「#」と書かれた%の巻物";
1621 else basenm = "「#」と書かれた巻物";
1623 if (!flavor) basenm = "& Scroll~ of %";
1624 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1625 else basenm = "& Scroll~ titled \"#\"";
1633 /* Color the object */
1634 modstr = k_name + flavor_k_ptr->flavor_name;
1637 if (!flavor) basenm = "%の薬";
1638 else if (aware) basenm = "%の#薬";
1641 if (!flavor) basenm = "& Potion~ of %";
1642 else if (aware) basenm = "& # Potion~ of %";
1643 else basenm = "& # Potion~";
1651 /* Ordinary food is "boring" */
1652 if (!k_ptr->flavor_name) break;
1654 /* Color the object */
1655 modstr = k_name + flavor_k_ptr->flavor_name;
1658 if (!flavor) basenm = "%のキノコ";
1659 else if (aware) basenm = "%の#キノコ";
1660 else basenm = "#キノコ";
1662 if (!flavor) basenm = "& Mushroom~ of %";
1663 else if (aware) basenm = "& # Mushroom~ of %";
1664 else basenm = "& # Mushroom~";
1672 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1682 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1683 basenm = "& Book~ of Life Magic %";
1685 basenm = "& Life Spellbook~ %";
1691 case TV_SORCERY_BOOK:
1696 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1697 basenm = "& Book~ of Sorcery %";
1699 basenm = "& Sorcery Spellbook~ %";
1705 case TV_NATURE_BOOK:
1710 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1711 basenm = "& Book~ of Nature Magic %";
1713 basenm = "& Nature Spellbook~ %";
1722 basenm = "カオスの魔法書%";
1724 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1725 basenm = "& Book~ of Chaos Magic %";
1727 basenm = "& Chaos Spellbook~ %";
1738 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1739 basenm = "& Book~ of Death Magic %";
1741 basenm = "& Death Spellbook~ %";
1750 basenm = "トランプの魔法書%";
1752 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1753 basenm = "& Book~ of Trump Magic %";
1755 basenm = "& Trump Spellbook~ %";
1761 case TV_ARCANE_BOOK:
1766 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1767 basenm = "& Book~ of Arcane Magic %";
1769 basenm = "& Arcane Spellbook~ %";
1780 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1781 basenm = "& Book~ of Craft Magic %";
1783 basenm = "& Craft Spellbook~ %";
1789 case TV_DAEMON_BOOK:
1794 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1795 basenm = "& Book~ of Daemon Magic %";
1797 basenm = "& Daemon Spellbook~ %";
1803 case TV_CRUSADE_BOOK:
1808 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1809 basenm = "& Book~ of Crusade Magic %";
1811 basenm = "& Crusade Spellbook~ %";
1819 basenm = _("歌集%", "& Song Book~ %");
1823 case TV_HISSATSU_BOOK:
1825 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1834 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1835 basenm = "& Book~ of Hex Magic %";
1837 basenm = "& Hex Spellbook~ %";
1843 /* Hack -- Gold/Gems */
1846 strcpy(buf, basenm);
1850 /* Used in the "p_ptr->inventory_list" routine */
1853 strcpy(buf, _("(なし)", "(nothing)"));
1858 /* Use full name from k_info or a_info */
1859 if (aware && have_flag(flgs, TR_FULL_NAME))
1861 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1862 else basenm = kindname;
1865 /* Start dumping the result */
1869 if (basenm[0] == '&')
1875 if (mode & OD_OMIT_PREFIX)
1879 else if (o_ptr->number > 1)
1881 t = object_desc_kosuu(t, o_ptr);
1882 t = object_desc_str(t, "の ");
1885 /* 英語の場合アーティファクトは The が付くので分かるが
1886 * 日本語では分からないのでマークをつける
1890 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1891 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1896 /* The object "expects" a "number" */
1897 if (basenm[0] == '&')
1899 /* Skip the ampersand (and space) */
1903 if (mode & OD_OMIT_PREFIX)
1908 /* Hack -- None left */
1909 else if (o_ptr->number <= 0)
1911 t = object_desc_str(t, "no more ");
1914 /* Extract the number */
1915 else if (o_ptr->number > 1)
1917 t = object_desc_num(t, o_ptr->number);
1918 t = object_desc_chr(t, ' ');
1921 /* Hack -- The only one of its kind */
1922 else if ((known && object_is_artifact(o_ptr)) ||
1923 ((o_ptr->tval == TV_CORPSE) &&
1924 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1926 t = object_desc_str(t, "The ");
1936 case '#': vowel = is_a_vowel(modstr[0]); break;
1937 case '%': vowel = is_a_vowel(*kindname); break;
1938 default: vowel = is_a_vowel(*s); break;
1943 /* A single one, with a vowel */
1944 t = object_desc_str(t, "an ");
1948 /* A single one, without a vowel */
1949 t = object_desc_str(t, "a ");
1954 /* Hack -- objects that "never" take an article */
1961 if (mode & OD_OMIT_PREFIX)
1966 /* Hack -- all gone */
1967 else if (o_ptr->number <= 0)
1969 t = object_desc_str(t, "no more ");
1972 /* Prefix a number if required */
1973 else if (o_ptr->number > 1)
1975 t = object_desc_num(t, o_ptr->number);
1976 t = object_desc_chr(t, ' ');
1979 /* Hack -- The only one of its kind */
1980 else if (known && object_is_artifact(o_ptr))
1982 t = object_desc_str(t, "The ");
1985 /* Hack -- single items get no prefix */
1993 /* Paranoia -- skip illegal tildes */
1994 /* while (*s == '~') s++; */
1997 if (object_is_smith(o_ptr))
1999 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2002 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2006 if (o_ptr->art_name)
2008 concptr temp = quark_str(o_ptr->art_name);
2010 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2011 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2012 if (strncmp(temp, "of ", 3) == 0)
2014 t = object_desc_str(t, &temp[3]);
2015 t = object_desc_str(t, "の");
2017 else if ((strncmp(temp, "『", 2) != 0) &&
2018 (strncmp(temp, "《", 2) != 0) &&
2020 t = object_desc_str(t, temp);
2023 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2025 artifact_type *a_ptr = &a_info[o_ptr->name1];
2026 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2027 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2029 t = object_desc_str(t, a_name + a_ptr->name);
2033 else if (object_is_ego(o_ptr))
2035 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2036 t = object_desc_str(t, e_name + e_ptr->name);
2041 /* Copy the string */
2042 for (s0 = NULL; *s || s0; )
2044 /* The end of the flavour/kind string. */
2051 /* Begin to append the modifier (flavor) */
2052 else if ((*s == '#') && !s0)
2057 /* Paranoia -- Never append multiple modstrs */
2061 /* Begin to append the kind name */
2062 else if ((*s == '%') && !s0)
2067 /* Paranoia -- Never append multiple kindnames */
2075 /* Add a plural if needed */
2076 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2082 /* Hack -- "Cutlass-es" and "Torch-es" */
2083 if ((k == 's') || (k == 'h')) *t++ = 'e';
2105 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2108 /* ランダムアーティファクトの名前はセーブファイルに記録
2109 されるので、英語版の名前もそれらしく変換する */
2110 if (o_ptr->art_name)
2114 strcpy(temp, quark_str(o_ptr->art_name));
2115 /* MEGA HACK by ita */
2116 if (strncmp(temp, "『", 2) == 0 ||
2117 strncmp(temp, "《", 2) == 0)
2118 t = object_desc_str(t, temp);
2119 else if (temp[0] == '\'')
2121 itemp = strlen(temp);
2122 temp[itemp - 1] = 0;
2123 t = object_desc_str(t, "『");
2124 t = object_desc_str(t, &temp[1]);
2125 t = object_desc_str(t, "』");
2128 else if (object_is_fixed_artifact(o_ptr))
2130 artifact_type *a_ptr = &a_info[o_ptr->name1];
2131 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2133 t = object_desc_str(t, a_name + a_ptr->name);
2136 else if (o_ptr->inscription)
2138 concptr str = quark_str(o_ptr->inscription);
2147 if (*str == '#') break;
2153 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2155 /* Add the false name */
2156 t = object_desc_str(t,"『");
2157 t = object_desc_str(t, &str_aux[1]);
2158 t = object_desc_str(t,"』");
2163 if (object_is_smith(o_ptr))
2165 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2168 /* Hack -- Append "Artifact" or "Special" names */
2169 if (known && !have_flag(flgs, TR_FULL_NAME))
2171 /* Is it a new random artifact ? */
2172 if (o_ptr->art_name)
2174 t = object_desc_chr(t, ' ');
2175 t = object_desc_str(t, quark_str(o_ptr->art_name));
2178 /* Grab any artifact name */
2179 else if (object_is_fixed_artifact(o_ptr))
2181 artifact_type *a_ptr = &a_info[o_ptr->name1];
2183 t = object_desc_chr(t, ' ');
2184 t = object_desc_str(t, a_name + a_ptr->name);
2187 /* Grab any ego-item name */
2190 if (object_is_ego(o_ptr))
2192 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2194 t = object_desc_chr(t, ' ');
2195 t = object_desc_str(t, e_name + e_ptr->name);
2198 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2201 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2203 /* Add the false name */
2204 t = object_desc_chr(t, ' ');
2205 t = object_desc_str(t, &str[1]);
2212 /* No more details wanted */
2213 if (mode & OD_NAME_ONLY) goto object_desc_done;
2215 /* Hack -- Chests must be described in detail */
2216 if (o_ptr->tval == TV_CHEST)
2218 /* Not searched yet */
2224 /* May be "empty" */
2225 else if (!o_ptr->pval)
2227 t = object_desc_str(t, _("(空)", " (empty)"));
2230 /* May be "disarmed" */
2231 else if (o_ptr->pval < 0)
2233 if (chest_traps[0 - o_ptr->pval])
2235 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2239 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2243 /* Describe the traps, if any */
2246 /* Describe the traps */
2247 switch (chest_traps[o_ptr->pval])
2251 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2254 case CHEST_LOSE_STR:
2256 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2259 case CHEST_LOSE_CON:
2261 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2266 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2269 case CHEST_PARALYZE:
2271 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2276 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2280 case CHEST_BIRD_STORM:
2281 case CHEST_E_SUMMON:
2282 case CHEST_H_SUMMON:
2284 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2287 case CHEST_RUNES_OF_EVIL:
2289 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2294 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2299 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2307 /* Display the item like a weapon */
2308 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2310 /* Display the item like a weapon */
2311 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2314 /* Display the item like a weapon */
2315 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2317 /* Display the item like armour */
2318 if (o_ptr->ac) show_armour = TRUE;
2321 /* Dump base weapon info */
2322 switch (o_ptr->tval)
2324 /* Missiles and Weapons */
2333 /* In Vault Quest, hide the dice of target weapon. */
2334 if(object_is_quest_target(o_ptr) && !known)
2339 /* Append a "damage" string */
2340 t = object_desc_chr(t, ' ');
2341 t = object_desc_chr(t, p1);
2342 t = object_desc_num(t, o_ptr->dd);
2343 t = object_desc_chr(t, 'd');
2344 t = object_desc_num(t, o_ptr->ds);
2345 t = object_desc_chr(t, p2);
2351 /* Bows get a special "damage string" */
2354 /* Mega-Hack -- Extract the "base power" */
2355 power = bow_tmul(o_ptr->sval);
2357 /* Apply the "Extra Might" flag */
2358 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2360 /* Append a special "damage" string */
2361 t = object_desc_chr(t, ' ');
2362 t = object_desc_chr(t, p1);
2363 t = object_desc_chr(t, 'x');
2364 t = object_desc_num(t, power);
2365 t = object_desc_chr(t, p2);
2367 fire_rate = calc_num_fire(o_ptr);
2368 /* Show Fire rate */
2369 if (fire_rate != 0 && power > 0 && known)
2371 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2373 t = object_desc_chr(t, ' ');
2374 t = object_desc_chr(t, p1);
2375 t = object_desc_num(t, fire_rate/100);
2376 t = object_desc_chr(t, '.');
2377 t = object_desc_num(t, fire_rate%100);
2378 t = object_desc_str(t, "turn");
2379 t = object_desc_chr(t, p2);
2387 /* Add the weapon bonuses */
2390 /* Show the tohit/todam on request */
2393 t = object_desc_chr(t, ' ');
2394 t = object_desc_chr(t, p1);
2395 t = object_desc_int(t, o_ptr->to_h);
2396 t = object_desc_chr(t, ',');
2397 t = object_desc_int(t, o_ptr->to_d);
2398 t = object_desc_chr(t, p2);
2401 /* Show the tohit if needed */
2402 else if (o_ptr->to_h)
2404 t = object_desc_chr(t, ' ');
2405 t = object_desc_chr(t, p1);
2406 t = object_desc_int(t, o_ptr->to_h);
2407 t = object_desc_chr(t, p2);
2410 /* Show the todam if needed */
2411 else if (o_ptr->to_d)
2413 t = object_desc_chr(t, ' ');
2414 t = object_desc_chr(t, p1);
2415 t = object_desc_int(t, o_ptr->to_d);
2416 t = object_desc_chr(t, p2);
2420 bow_ptr = &p_ptr->inventory_list[INVEN_BOW];
2422 /* If have a firing weapon + ammo matches bow */
2423 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2425 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2426 int tmul = bow_tmul(bow_ptr->sval);
2427 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2429 /* See if the bow is "known" - then set damage bonus */
2430 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2432 /* Effect of ammo */
2433 if (known) avgdam += (o_ptr->to_d * 10);
2435 /* Get extra "power" from "extra might" */
2436 if (p_ptr->xtra_might) tmul++;
2438 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2440 /* Launcher multiplier */
2442 avgdam /= (100 * 10);
2444 /* Get extra damage from concentration */
2445 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2447 if (avgdam < 0) avgdam = 0;
2449 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2450 t = object_desc_chr(t, ' ');
2451 t = object_desc_chr(t, p1);
2453 if(show_ammo_no_crit)
2455 /* Damage with no-crit */
2456 t = object_desc_num(t, avgdam);
2457 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2460 /* Apply Expect damage of Critical */
2461 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2462 t = object_desc_num(t, avgdam);
2464 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2465 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2467 if (p_ptr->num_fire == 0)
2469 t = object_desc_chr(t, '0');
2473 /* Calc effects of energy */
2474 avgdam *= (p_ptr->num_fire * 100);
2475 avgdam /= energy_fire;
2476 t = object_desc_num(t, avgdam);
2477 t = object_desc_str(t, show_ammo_detail ? "/current_world_ptr->game_turn" : "");
2479 if(show_ammo_crit_ratio)
2481 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2483 t = object_desc_chr(t, '/');
2484 t = object_desc_num(t, percent / 100);
2485 t = object_desc_chr(t, '.');
2486 if(percent % 100 < 10)
2488 t = object_desc_chr(t, '0');
2490 t = object_desc_num(t, percent % 100);
2491 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2495 t = object_desc_chr(t, p2);
2497 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2499 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2500 s16b energy_fire = 100 - p_ptr->lev;
2502 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2504 /* Display (shot damage/ avg damage) */
2505 t = object_desc_chr(t, ' ');
2506 t = object_desc_chr(t, p1);
2507 t = object_desc_num(t, avgdam);
2508 t = object_desc_chr(t, '/');
2510 /* Calc effects of energy */
2511 avgdam = 100 * avgdam / energy_fire;
2513 t = object_desc_num(t, avgdam);
2514 t = object_desc_chr(t, p2);
2517 /* Add the armor bonuses */
2520 /* Show the armor class info */
2523 t = object_desc_chr(t, ' ');
2524 t = object_desc_chr(t, b1);
2525 t = object_desc_num(t, o_ptr->ac);
2526 t = object_desc_chr(t, ',');
2527 t = object_desc_int(t, o_ptr->to_a);
2528 t = object_desc_chr(t, b2);
2531 /* No base armor, but does increase armor */
2532 else if (o_ptr->to_a)
2534 t = object_desc_chr(t, ' ');
2535 t = object_desc_chr(t, b1);
2536 t = object_desc_int(t, o_ptr->to_a);
2537 t = object_desc_chr(t, b2);
2541 /* Hack -- always show base armor */
2542 else if (show_armour)
2544 t = object_desc_chr(t, ' ');
2545 t = object_desc_chr(t, b1);
2546 t = object_desc_num(t, o_ptr->ac);
2547 t = object_desc_chr(t, b2);
2551 /* No more details wanted */
2552 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2555 if (known) /* Known item only */
2558 * Hack -- Wands and Staffs have charges. Make certain how many charges
2559 * a stack of staffs really has is clear. -LM-
2561 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2563 /* Dump " (N charges)" */
2564 t = object_desc_chr(t, ' ');
2565 t = object_desc_chr(t, p1);
2567 /* Clear explaination for staffs. */
2568 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2570 t = object_desc_num(t, o_ptr->number);
2571 t = object_desc_str(t, "x ");
2573 t = object_desc_num(t, o_ptr->pval);
2575 t = object_desc_str(t, "回分");
2577 t = object_desc_str(t, " charge");
2578 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2581 t = object_desc_chr(t, p2);
2583 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2584 * be in any state of charge or discharge, this now includes a number. -LM-
2586 else if (o_ptr->tval == TV_ROD)
2588 /* Hack -- Dump " (# charging)" if relevant */
2591 /* Stacks of rods display an exact count of charging rods. */
2592 if (o_ptr->number > 1)
2595 if (k_ptr->pval == 0) k_ptr->pval = 1;
2597 /* Find out how many rods are charging, by dividing
2598 * current timeout by each rod's maximum timeout.
2599 * Ensure that any remainder is rounded up. Display
2600 * very discharged stacks as merely fully discharged.
2602 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2603 if (power > o_ptr->number) power = o_ptr->number;
2605 /* Display prettily. */
2606 t = object_desc_str(t, " (");
2607 t = object_desc_num(t, power);
2608 t = object_desc_str(t, _("本 充填中)", " charging)"));
2611 /* "one Rod of Perception (1 charging)" would look tacky. */
2614 t = object_desc_str(t, _("(充填中)", " (charging)"));
2619 /* Dump "pval" flags for wearable items */
2620 if (have_pval_flags(flgs))
2622 /* Start the display */
2623 t = object_desc_chr(t, ' ');
2624 t = object_desc_chr(t, p1);
2626 /* Dump the "pval" itself */
2627 t = object_desc_int(t, o_ptr->pval);
2629 /* Do not display the "pval" flags */
2630 if (have_flag(flgs, TR_HIDE_TYPE))
2635 else if (have_flag(flgs, TR_SPEED))
2637 /* Dump " to speed" */
2638 t = object_desc_str(t, _("加速", " to speed"));
2642 else if (have_flag(flgs, TR_BLOWS))
2646 t = object_desc_str(t, "攻撃");
2648 t = object_desc_str(t, " attack");
2651 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2656 else if (have_flag(flgs, TR_STEALTH))
2658 /* Dump " to stealth" */
2659 t = object_desc_str(t, _("隠密", " to stealth"));
2663 else if (have_flag(flgs, TR_SEARCH))
2665 /* Dump " to searching" */
2666 t = object_desc_str(t, _("探索", " to searching"));
2670 else if (have_flag(flgs, TR_INFRA))
2672 /* Dump " to infravision" */
2673 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2676 /* Finish the display */
2677 t = object_desc_chr(t, p2);
2680 /* Hack -- Process Lanterns/Torches */
2681 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2683 /* Hack -- Turns of light for normal lites */
2685 t = object_desc_chr(t, '(');
2687 t = object_desc_str(t, " (with ");
2690 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2691 else t = object_desc_num(t, o_ptr->xtra4);
2692 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2695 /* Indicate charging objects, but not rods. */
2696 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2698 /* Hack -- Dump " (charging)" if relevant */
2699 t = object_desc_str(t, _("(充填中)", " (charging)"));
2704 /* No more details wanted */
2705 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2708 /* Prepare real inscriptions in a buffer */
2711 /* Auto abbreviation inscribe */
2712 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2714 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2725 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2729 /* Use the standard inscription if available */
2730 if (o_ptr->inscription)
2734 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2736 /* Get inscription and convert {%} */
2737 get_inscription(buff, o_ptr);
2739 /* strcat with correct treating of kanji */
2740 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2744 /* No fake inscription yet */
2745 fake_insc_buf[0] = '\0';
2747 /* Use the game-generated "feeling" otherwise, if available */
2750 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2753 /* Note "cursed" if the item is known to be cursed */
2754 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2756 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2759 /* Note "unidentified" if the item is unidentified */
2760 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2761 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2763 && !(o_ptr->ident & IDENT_SENSE))
2765 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2768 /* Mega-Hack -- note empty wands/staffs */
2769 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2771 strcpy(fake_insc_buf, _("空", "empty"));
2774 /* Note "tried" if the object has been tested unsuccessfully */
2775 else if (!aware && object_is_tried(o_ptr))
2777 strcpy(fake_insc_buf, _("未判明", "tried"));
2780 /* Note the discount, if any */
2781 if (o_ptr->discount)
2783 /* Hidden by real inscription unless in a store */
2784 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2786 char discount_num_buf[4];
2788 /* Append to other fake inscriptions if any */
2789 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2791 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2792 strcat(fake_insc_buf, discount_num_buf);
2793 strcat(fake_insc_buf, _("%引き", "% off"));
2798 /* Append the inscription, if any */
2799 if (fake_insc_buf[0] || tmp_val2[0])
2801 /* Append the inscription */
2802 t = object_desc_chr(t, ' ');
2803 t = object_desc_chr(t, c1);
2805 /* Append fake inscriptions */
2806 if (fake_insc_buf[0])
2808 t = object_desc_str(t, fake_insc_buf);
2811 /* Append a separater */
2812 if (fake_insc_buf[0] && tmp_val2[0])
2814 t = object_desc_chr(t, ',');
2815 t = object_desc_chr(t, ' ');
2818 /* Append real inscriptions */
2821 t = object_desc_str(t, tmp_val2);
2824 t = object_desc_chr(t, c2);
2828 my_strcpy(buf, tmp_val, MAX_NLEN);