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
16 #include "player-status.h"
18 #include "object-hook.h"
19 #include "object-flavor.h"
25 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
27 * @return 簡易名称を明らかにするならTRUEを返す。
29 * This function is used only by "flavor_init()"
31 static bool object_easy_know(int i)
33 object_kind *k_ptr = &k_info[i];
35 /* Analyze the "tval" */
50 case TV_HISSATSU_BOOK:
67 /* All Food, Potions, Scrolls, Rods */
81 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
82 * @param out_string 作成した名を保管する参照ポインタ
84 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
85 * syllables 配列と elvish.txt を組み合わせる。\n
87 void get_table_name_aux(char *out_string)
91 get_rnd_line("aname_j.txt", 1, Syllable);
92 strcpy(out_string, Syllable);
93 get_rnd_line("aname_j.txt", 2, Syllable);
94 strcat(out_string, Syllable);
96 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
98 static concptr syllables[MAX_SYLLABLES] = {
99 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
100 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
101 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
102 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
103 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
104 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
105 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
106 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
107 "kho", "kli", "klis", "la", "lech", "man", "mar",
108 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
109 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
110 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
111 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
112 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
113 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
114 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
115 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
116 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
117 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
118 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
122 int testcounter = randint1(3) + 1;
124 strcpy(out_string, "");
126 if (randint1(3) == 2)
128 while (testcounter--)
129 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
134 testcounter = randint1(2) + 1;
135 while (testcounter--)
137 (void)get_rnd_line("elvish.txt", 0, Syllable);
138 strcat(out_string, Syllable);
142 out_string[0] = toupper(out_string[1]);
144 out_string[16] = '\0';
149 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
150 * @param out_string 作成した名を保管する参照ポインタ
152 * @details get_table_name_aux()ほぼ完全に実装を依存している。
154 void get_table_name(char *out_string)
157 get_table_name_aux(buff);
158 sprintf(out_string, _("『%s』", "'%s'"), buff);
162 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
163 * @param out_string 作成した名を保管する参照ポインタ
165 * @details sname.txtが語幹の辞書となっている。
167 void get_table_sindarin_aux(char *out_string)
174 get_rnd_line("sname.txt", 1, Syllable);
176 strcpy(tmp, Syllable);
178 strcpy(out_string, Syllable);
181 get_rnd_line("sname.txt", 2, Syllable);
183 strcat(tmp, Syllable);
184 sindarin_to_kana(out_string, tmp);
186 strcat(out_string, Syllable);
191 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
192 * @param out_string 作成した名を保管する参照ポインタ
194 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
196 void get_table_sindarin(char *out_string)
199 get_table_sindarin_aux(buff);
200 sprintf(out_string, _("『%s』", "'%s'"), buff);
205 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
206 * @param tval シャッフルしたいtval
208 * @details 巻物、各種魔道具などに利用される。
210 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
212 KIND_OBJECT_IDX *k_idx_list;
213 KIND_OBJECT_IDX k_idx_list_num = 0;
216 /* Allocate an array for a list of k_idx */
217 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
219 /* Search objects with given tval for shuffle */
220 for (i = 0; i < max_k_idx; i++)
222 object_kind *k_ptr = &k_info[i];
225 if (k_ptr->tval != tval) continue;
227 /* Paranoia -- Skip objects without flavor */
228 if (!k_ptr->flavor) continue;
230 /* Skip objects with a fixed flavor name */
231 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
234 k_idx_list[k_idx_list_num] = i;
236 /* Increase number of remembered indices */
240 /* Shuffle flavors */
241 for (i = 0; i < k_idx_list_num; i++)
243 object_kind *k1_ptr = &k_info[k_idx_list[i]];
244 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
246 /* Swap flavors of this pair */
247 s16b tmp = k1_ptr->flavor;
248 k1_ptr->flavor = k2_ptr->flavor;
249 k2_ptr->flavor = tmp;
252 /* Free an array for a list of k_idx */
253 C_KILL(k_idx_list, max_k_idx, s16b);
257 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
260 * Prepare the "variable" part of the "k_info" array.\n
262 * The "color"/"metal"/"type" of an item is its "flavor".\n
263 * For the most part, flavors are assigned randomly each game.\n
265 * Initialize descriptions for the "colored" objects, including:\n
266 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
268 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
269 * Slime Mold Juice, Unused Potion).\n
271 * Scroll titles are always between 6 and 14 letters long. This is\n
272 * ensured because every title is composed of whole words, where every\n
273 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
274 * letters each), and that no scroll is finished until it attempts to\n
275 * grow beyond 15 letters. The first time this can happen is when the\n
276 * current title has 6 letters and the new word has 8 letters, which\n
277 * would result in a 6 letter scroll title.\n
279 * Duplicate titles are avoided by requiring that no two scrolls share\n
280 * the same first four letters (not the most efficient method, and not\n
281 * the least efficient method, but it will always work).\n
283 * Hack -- make sure everything stays the same for each saved game\n
284 * This is accomplished by the use of a saved "random seed", as in\n
285 * "town_gen()". Since no other functions are called while the special\n
286 * seed is in effect, so this function is pretty "safe".\n
288 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
290 void flavor_init(void)
293 u32b state_backup[4];
295 /* Hack -- Backup the RNG state */
296 Rand_state_backup(state_backup);
298 /* Hack -- Induce consistant flavors */
299 Rand_state_set(seed_flavor);
302 /* Initialize flavor index of each object by itself */
303 for (i = 0; i < max_k_idx; i++)
305 object_kind *k_ptr = &k_info[i];
307 /* Skip objects without flavor name */
308 if (!k_ptr->flavor_name) continue;
311 * Initialize flavor index to itself
312 * -> Shuffle it later
318 shuffle_flavors(TV_RING);
320 /* Shuffle Amulets */
321 shuffle_flavors(TV_AMULET);
324 shuffle_flavors(TV_STAFF);
327 shuffle_flavors(TV_WAND);
330 shuffle_flavors(TV_ROD);
332 /* Shuffle Mushrooms */
333 shuffle_flavors(TV_FOOD);
335 /* Shuffle Potions */
336 shuffle_flavors(TV_POTION);
338 /* Shuffle Scrolls */
339 shuffle_flavors(TV_SCROLL);
342 /* Hack -- Restore the RNG state */
343 Rand_state_restore(state_backup);
345 /* Analyze every object */
346 for (i = 1; i < max_k_idx; i++)
348 object_kind *k_ptr = &k_info[i];
350 /* Skip "empty" objects */
351 if (!k_ptr->name) continue;
353 /* No flavor yields aware */
354 if (!k_ptr->flavor) k_ptr->aware = TRUE;
356 /* Check for "easily known" */
357 k_ptr->easy_know = object_easy_know(i);
363 * @brief 対象文字配列に一文字だけをコピーする。
364 * @param t 保管先文字列ポインタ
368 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
369 * and return a pointer to the terminator (t + 1).\n
371 static char *object_desc_chr(char *t, char c)
382 * @brief 対象文字配列に文字列をコピーする。
383 * @param t 保管先文字列ポインタ
384 * @param s コピーしたい文字列ポインタ
387 * Print a string "s" into a string "t", as if by strcpy(t, s),
388 * and return a pointer to the terminator.
390 static char *object_desc_str(char *t, concptr s)
392 /* Copy the string */
393 while (*s) *t++ = *s++;
401 * @brief 対象文字配列に符号なし整数値をコピーする。
402 * @param t 保管先文字列ポインタ
406 * Print an unsigned number "n" into a string "t", as if by
407 * sprintf(t, "%u", n), and return a pointer to the terminator.
409 static char *object_desc_num(char *t, uint n)
413 /* Find "size" of "n" */
414 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
416 /* Dump each digit */
422 /* Remove the digit */
425 /* Process next digit */
439 * @brief 日本語の個数表示ルーチン
440 * @param t 保管先文字列ポインタ
441 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
444 * cmd1.c で流用するために object_desc_japanese から移動した。
446 char *object_desc_kosuu(char *t, object_type *o_ptr)
448 t = object_desc_num(t, o_ptr->number);
460 t = object_desc_str(t, "本");
465 t = object_desc_str(t, "巻");
470 t = object_desc_str(t, "服");
474 case TV_SORCERY_BOOK:
482 case TV_CRUSADE_BOOK:
484 case TV_HISSATSU_BOOK:
487 t = object_desc_str(t, "冊");
495 t = object_desc_str(t, "着");
502 t = object_desc_str(t, "振");
507 t = object_desc_str(t, "足");
512 t = object_desc_str(t, "枚");
518 if(o_ptr->sval == SV_FOOD_JERKY)
520 t = object_desc_str(t, "切れ");
526 if (o_ptr->number < 10)
528 t = object_desc_str(t, "つ");
532 t = object_desc_str(t, "個");
542 * @brief 対象文字配列に符号あり整数値をコピーする。
543 * @param t 保管先文字列ポインタ
547 * Print an signed number "v" into a string "t", as if by
548 * sprintf(t, "%+d", n), and return a pointer to the terminator.
549 * Note that we always print a sign, either "+" or "-".
551 static char *object_desc_int(char *t, sint v)
558 /* Take the absolute value */
561 /* Use a "minus" sign */
565 /* Positive (or zero) */
568 /* Use the actual number */
571 /* Use a "plus" sign */
575 /* Find "size" of "n" */
576 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
578 /* Dump each digit */
584 /* Remove the digit */
587 /* Process next digit */
598 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
600 typedef struct flag_insc_table
611 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
612 static flag_insc_table flag_insc_plus[] =
614 { "攻", "At", TR_BLOWS, -1 },
615 { "速", "Sp", TR_SPEED, -1 },
616 { "腕", "St", TR_STR, -1 },
617 { "知", "In", TR_INT, -1 },
618 { "賢", "Wi", TR_WIS, -1 },
619 { "器", "Dx", TR_DEX, -1 },
620 { "耐", "Cn", TR_CON, -1 },
621 { "魅", "Ch", TR_CHR, -1 },
622 { "道", "Md", TR_MAGIC_MASTERY, -1 },
623 { "隠", "Sl", TR_STEALTH, -1 },
624 { "探", "Sr", TR_SEARCH, -1 },
625 { "赤", "If", TR_INFRA, -1 },
626 { "掘", "Dg", TR_TUNNEL, -1 },
627 { NULL, NULL, 0, -1 }
630 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
631 static flag_insc_table flag_insc_immune[] =
633 { "酸", "Ac", TR_IM_ACID, -1 },
634 { "電", "El", TR_IM_ELEC, -1 },
635 { "火", "Fi", TR_IM_FIRE, -1 },
636 { "冷", "Co", TR_IM_COLD, -1 },
637 { NULL, NULL, 0, -1 }
640 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
641 static flag_insc_table flag_insc_resistance[] =
643 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
644 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
645 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
646 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
647 { "毒", "Po", TR_RES_POIS, -1 },
648 { "閃", "Li", TR_RES_LITE, -1 },
649 { "暗", "Dk", TR_RES_DARK, -1 },
650 { "破", "Sh", TR_RES_SHARDS, -1 },
651 { "盲", "Bl", TR_RES_BLIND, -1 },
652 { "乱", "Cf", TR_RES_CONF, -1 },
653 { "轟", "So", TR_RES_SOUND, -1 },
654 { "獄", "Nt", TR_RES_NETHER, -1 },
655 { "因", "Nx", TR_RES_NEXUS, -1 },
656 { "沌", "Ca", TR_RES_CHAOS, -1 },
657 { "劣", "Di", TR_RES_DISEN, -1 },
658 { "恐", "Fe", TR_RES_FEAR, -1 },
659 { NULL, NULL, 0, -1 }
662 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
663 static flag_insc_table flag_insc_misc[] =
665 { "易", "Es", TR_EASY_SPELL, -1 },
666 { "減", "Dm", TR_DEC_MANA, -1 },
667 { "投", "Th", TR_THROW, -1 },
668 { "反", "Rf", TR_REFLECT, -1 },
669 { "麻", "Fa", TR_FREE_ACT, -1 },
670 { "視", "Si", TR_SEE_INVIS, -1 },
671 { "経", "Hl", TR_HOLD_EXP, -1 },
672 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
673 { "活", "Rg", TR_REGEN, -1 },
674 { "浮", "Lv", TR_LEVITATION, -1 },
675 { "明", "Lu", TR_LITE_1, -1 },
676 { "明", "Lu", TR_LITE_2, -1 },
677 { "明", "Lu", TR_LITE_3, -1 },
678 { "闇", "Dl", TR_LITE_M1, -1 },
679 { "闇", "Dl", TR_LITE_M2, -1 },
680 { "闇", "Dl", TR_LITE_M3, -1 },
681 { "警", "Wr", TR_WARNING, -1 },
682 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
683 { "射", "Xs", TR_XTRA_SHOTS, -1 },
684 { "瞬", "Te", TR_TELEPORT, -1 },
685 { "怒", "Ag", TR_AGGRAVATE, -1 },
686 { "祝", "Bs", TR_BLESSED, -1 },
687 { "忌", "Ty", TR_TY_CURSE, -1 },
688 { "呪", "C-", TR_ADD_L_CURSE, -1 },
689 { "詛", "C+", TR_ADD_H_CURSE, -1 },
690 { NULL, NULL, 0, -1 }
693 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
694 static flag_insc_table flag_insc_aura[] =
696 { "炎", "F", TR_SH_FIRE, -1 },
697 { "電", "E", TR_SH_ELEC, -1 },
698 { "冷", "C", TR_SH_COLD, -1 },
699 { "魔", "M", TR_NO_MAGIC, -1 },
700 { "瞬", "T", TR_NO_TELE, -1 },
701 { NULL, NULL, 0, -1 }
704 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
705 static flag_insc_table flag_insc_brand[] =
707 { "酸", "A", TR_BRAND_ACID, -1 },
708 { "電", "E", TR_BRAND_ELEC, -1 },
709 { "焼", "F", TR_BRAND_FIRE, -1 },
710 { "凍", "Co", TR_BRAND_COLD, -1 },
711 { "毒", "P", TR_BRAND_POIS, -1 },
712 { "沌", "Ca", TR_CHAOTIC, -1 },
713 { "吸", "V", TR_VAMPIRIC, -1 },
714 { "震", "Q", TR_IMPACT, -1 },
715 { "切", "S", TR_VORPAL, -1 },
716 { "理", "M", TR_FORCE_WEAPON, -1 },
717 { NULL, NULL, 0, -1 }
720 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
721 static flag_insc_table flag_insc_kill[] =
723 { "邪", "*", TR_KILL_EVIL, -1 },
724 { "人", "p", TR_KILL_HUMAN, -1 },
725 { "龍", "D", TR_KILL_DRAGON, -1 },
726 { "オ", "o", TR_KILL_ORC, -1 },
727 { "ト", "T", TR_KILL_TROLL, -1 },
728 { "巨", "P", TR_KILL_GIANT, -1 },
729 { "デ", "U", TR_KILL_DEMON, -1 },
730 { "死", "L", TR_KILL_UNDEAD, -1 },
731 { "動", "Z", TR_KILL_ANIMAL, -1 },
732 { NULL, NULL, 0, -1 }
735 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
736 static flag_insc_table flag_insc_slay[] =
738 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
739 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
740 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
741 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
742 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
743 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
744 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
745 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
746 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
747 { NULL, NULL, 0, -1 }
750 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
751 static flag_insc_table flag_insc_esp1[] =
753 { "感", "Tele", TR_TELEPATHY, -1 },
754 { "邪", "Evil", TR_ESP_EVIL, -1 },
755 { "善", "Good", TR_ESP_GOOD, -1 },
756 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
757 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
758 { NULL, NULL, 0, -1 }
761 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
762 static flag_insc_table flag_insc_esp2[] =
764 { "人", "p", TR_ESP_HUMAN, -1 },
765 { "竜", "D", TR_ESP_DRAGON, -1 },
766 { "オ", "o", TR_ESP_ORC, -1 },
767 { "ト", "T", TR_ESP_TROLL, -1 },
768 { "巨", "P", TR_ESP_GIANT, -1 },
769 { "デ", "U", TR_ESP_DEMON, -1 },
770 { "死", "L", TR_ESP_UNDEAD, -1 },
771 { "動", "Z", TR_ESP_ANIMAL, -1 },
772 { NULL, NULL, 0, -1 }
775 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
776 static flag_insc_table flag_insc_sust[] =
778 { "腕", "St", TR_SUST_STR, -1 },
779 { "知", "In", TR_SUST_INT, -1 },
780 { "賢", "Wi", TR_SUST_WIS, -1 },
781 { "器", "Dx", TR_SUST_DEX, -1 },
782 { "耐", "Cn", TR_SUST_CON, -1 },
783 { "魅", "Ch", TR_SUST_CHR, -1 },
784 { NULL, NULL, 0, -1 }
788 static flag_insc_table flag_insc_plus[] =
790 { "At", TR_BLOWS, -1 },
791 { "Sp", TR_SPEED, -1 },
792 { "St", TR_STR, -1 },
793 { "In", TR_INT, -1 },
794 { "Wi", TR_WIS, -1 },
795 { "Dx", TR_DEX, -1 },
796 { "Cn", TR_CON, -1 },
797 { "Ch", TR_CHR, -1 },
798 { "Md", TR_MAGIC_MASTERY, -1 },
799 { "Sl", TR_STEALTH, -1 },
800 { "Sr", TR_SEARCH, -1 },
801 { "If", TR_INFRA, -1 },
802 { "Dg", TR_TUNNEL, -1 },
806 static flag_insc_table flag_insc_immune[] =
808 { "Ac", TR_IM_ACID, -1 },
809 { "El", TR_IM_ELEC, -1 },
810 { "Fi", TR_IM_FIRE, -1 },
811 { "Co", TR_IM_COLD, -1 },
815 static flag_insc_table flag_insc_resistance[] =
817 { "Ac", TR_RES_ACID, TR_IM_ACID },
818 { "El", TR_RES_ELEC, TR_IM_ELEC },
819 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
820 { "Co", TR_RES_COLD, TR_IM_COLD },
821 { "Po", TR_RES_POIS, -1 },
822 { "Li", TR_RES_LITE, -1 },
823 { "Dk", TR_RES_DARK, -1 },
824 { "Sh", TR_RES_SHARDS, -1 },
825 { "Bl", TR_RES_BLIND, -1 },
826 { "Cf", TR_RES_CONF, -1 },
827 { "So", TR_RES_SOUND, -1 },
828 { "Nt", TR_RES_NETHER, -1 },
829 { "Nx", TR_RES_NEXUS, -1 },
830 { "Ca", TR_RES_CHAOS, -1 },
831 { "Di", TR_RES_DISEN, -1 },
832 { "Fe", TR_RES_FEAR, -1 },
836 static flag_insc_table flag_insc_misc[] =
838 { "Es", TR_EASY_SPELL, -1 },
839 { "Dm", TR_DEC_MANA, -1 },
840 { "Th", TR_THROW, -1 },
841 { "Rf", TR_REFLECT, -1 },
842 { "Fa", TR_FREE_ACT, -1 },
843 { "Si", TR_SEE_INVIS, -1 },
844 { "Hl", TR_HOLD_EXP, -1 },
845 { "Sd", TR_SLOW_DIGEST, -1 },
846 { "Rg", TR_REGEN, -1 },
847 { "Lv", TR_LEVITATION, -1 },
848 { "Lu", TR_LITE_1, -1 },
849 { "Lu", TR_LITE_2, -1 },
850 { "Lu", TR_LITE_3, -1 },
851 { "Dl", TR_LITE_M1, -1 },
852 { "Dl", TR_LITE_M2, -1 },
853 { "Dl", TR_LITE_M3, -1 },
854 { "Wr", TR_WARNING, -1 },
855 { "Xm", TR_XTRA_MIGHT, -1 },
856 { "Xs", TR_XTRA_SHOTS, -1 },
857 { "Te", TR_TELEPORT, -1 },
858 { "Ag", TR_AGGRAVATE, -1 },
859 { "Bs", TR_BLESSED, -1 },
860 { "Ty", TR_TY_CURSE, -1 },
861 { "C-", TR_ADD_L_CURSE, -1 },
862 { "C+", TR_ADD_H_CURSE, -1 },
866 static flag_insc_table flag_insc_aura[] =
868 { "F", TR_SH_FIRE, -1 },
869 { "E", TR_SH_ELEC, -1 },
870 { "C", TR_SH_COLD, -1 },
871 { "M", TR_NO_MAGIC, -1 },
872 { "T", TR_NO_TELE, -1 },
876 static flag_insc_table flag_insc_brand[] =
878 { "A", TR_BRAND_ACID, -1 },
879 { "E", TR_BRAND_ELEC, -1 },
880 { "F", TR_BRAND_FIRE, -1 },
881 { "Co", TR_BRAND_COLD, -1 },
882 { "P", TR_BRAND_POIS, -1 },
883 { "Ca", TR_CHAOTIC, -1 },
884 { "V", TR_VAMPIRIC, -1 },
885 { "Q", TR_IMPACT, -1 },
886 { "S", TR_VORPAL, -1 },
887 { "M", TR_FORCE_WEAPON, -1 },
891 static flag_insc_table flag_insc_kill[] =
893 { "*", TR_KILL_EVIL, -1 },
894 { "p", TR_KILL_HUMAN, -1 },
895 { "D", TR_KILL_DRAGON, -1 },
896 { "o", TR_KILL_ORC, -1 },
897 { "T", TR_KILL_TROLL, -1 },
898 { "P", TR_KILL_GIANT, -1 },
899 { "U", TR_KILL_DEMON, -1 },
900 { "L", TR_KILL_UNDEAD, -1 },
901 { "Z", TR_KILL_ANIMAL, -1 },
905 static flag_insc_table flag_insc_slay[] =
907 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
908 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
909 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
910 { "o", TR_SLAY_ORC, TR_KILL_ORC },
911 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
912 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
913 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
914 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
915 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
919 static flag_insc_table flag_insc_esp1[] =
921 { "Tele", TR_TELEPATHY, -1 },
922 { "Evil", TR_ESP_EVIL, -1 },
923 { "Good", TR_ESP_GOOD, -1 },
924 { "Nolv", TR_ESP_NONLIVING, -1 },
925 { "Uniq", TR_ESP_UNIQUE, -1 },
929 static flag_insc_table flag_insc_esp2[] =
931 { "p", TR_ESP_HUMAN, -1 },
932 { "D", TR_ESP_DRAGON, -1 },
933 { "o", TR_ESP_ORC, -1 },
934 { "T", TR_ESP_TROLL, -1 },
935 { "P", TR_ESP_GIANT, -1 },
936 { "U", TR_ESP_DEMON, -1 },
937 { "L", TR_ESP_UNDEAD, -1 },
938 { "Z", TR_ESP_ANIMAL, -1 },
942 static flag_insc_table flag_insc_sust[] =
944 { "St", TR_SUST_STR, -1 },
945 { "In", TR_SUST_INT, -1 },
946 { "Wi", TR_SUST_WIS, -1 },
947 { "Dx", TR_SUST_DEX, -1 },
948 { "Cn", TR_SUST_CON, -1 },
949 { "Ch", TR_SUST_CHR, -1 },
954 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
955 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
958 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
959 * @param fi_ptr 参照する特性表示記号テーブル
960 * @param flgs 対応するオブジェクトのフラグ文字列
961 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
962 * @param ptr フラグ群を保管する文字列参照ポインタ
963 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
965 * Print an signed number "v" into a string "t", as if by
966 * sprintf(t, "%+d", n), and return a pointer to the terminator.
967 * Note that we always print a sign, either "+" or "-".
969 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
975 while (fi_ptr->english)
977 if (have_flag(flgs, fi_ptr->flag) &&
978 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
980 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
982 ADD_INSC(fi_ptr->english);
992 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
993 * @param fi_ptr 参照する特性表示記号テーブル
994 * @param flgs 対応するオブジェクトのフラグ文字列
995 * @return 1つでも該当の特性があったらTRUEを返す。
997 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
999 while (fi_ptr->english)
1001 if (have_flag(flgs, fi_ptr->flag) &&
1002 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1011 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1012 * @param ptr 特性短縮表記を格納する文字列ポインタ
1013 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1014 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1015 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1016 * @return ptrと同じアドレス
1018 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1020 char *prev_ptr = ptr;
1021 BIT_FLAGS flgs[TR_FLAG_SIZE];
1022 object_flags(o_ptr, flgs);
1024 /* Remove obvious flags */
1027 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1031 for (j = 0; j < TR_FLAG_SIZE; j++)
1032 flgs[j] &= ~k_ptr->flags[j];
1034 if (object_is_fixed_artifact(o_ptr))
1036 artifact_type *a_ptr = &a_info[o_ptr->name1];
1038 for (j = 0; j < TR_FLAG_SIZE; j++)
1039 flgs[j] &= ~a_ptr->flags[j];
1042 if (object_is_ego(o_ptr))
1044 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1046 for (j = 0; j < TR_FLAG_SIZE; j++)
1047 flgs[j] &= ~e_ptr->flags[j];
1051 /* Remove lite flags when this is a dark lite object */
1052 if (have_dark_flag(flgs))
1054 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1055 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1056 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1058 else if (have_lite_flag(flgs))
1060 add_flag(flgs, TR_LITE_1);
1061 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1062 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1066 if (have_flag_of(flag_insc_plus, flgs))
1071 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1074 if (have_flag_of(flag_insc_immune, flgs))
1076 if (!kanji && ptr != prev_ptr)
1083 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1086 if (have_flag_of(flag_insc_resistance, flgs))
1090 else if (ptr != prev_ptr)
1096 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1099 if (have_flag_of(flag_insc_misc, flgs))
1101 if (ptr != prev_ptr)
1107 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1110 if (have_flag_of(flag_insc_aura, flgs))
1114 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1117 if (have_flag_of(flag_insc_brand, flgs))
1119 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1122 if (have_flag_of(flag_insc_kill, flgs))
1124 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1127 if (have_flag_of(flag_insc_slay, flgs))
1129 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1134 if (have_flag_of(flag_insc_esp1, flgs) ||
1135 have_flag_of(flag_insc_esp2, flgs))
1137 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1138 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1142 if (have_flag_of(flag_insc_esp1, flgs))
1144 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1145 if (have_flag_of(flag_insc_esp2, flgs))
1147 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1151 if (have_flag_of(flag_insc_sust, flgs))
1155 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1164 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1165 * @param buff 特性短縮表記を格納する文字列ポインタ
1166 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1169 static void get_inscription(char *buff, object_type *o_ptr)
1171 concptr insc = quark_str(o_ptr->inscription);
1174 /* Not fully identified */
1175 if (!(o_ptr->ident & IDENT_MENTAL))
1177 /* Copy until end of line or '#' */
1180 if (*insc == '#') break;
1182 if (iskanji(*insc)) *buff++ = *insc++;
1192 for (; *insc; insc++)
1194 /* Ignore fake artifact inscription */
1195 if (*insc == '#') break;
1197 /* {%} will be automatically converted */
1198 else if ('%' == *insc)
1202 concptr start = ptr;
1204 /* check for too long inscription */
1205 if (ptr >= buff + MAX_NLEN) continue;
1218 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1228 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1243 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1244 * @param buf 表記を返すための文字列参照ポインタ
1245 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1246 * @param mode 表記に関するオプション指定
1247 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1249 * One can choose the "verbosity" of the description, including whether\n
1250 * or not the "number" of items should be described, and how much detail\n
1251 * should be used when describing the item.\n
1253 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1254 * description, which can get pretty long, including incriptions, such as:\n
1255 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1256 * Note that the inscription will be clipped to keep the total description\n
1257 * under MAX_NLEN-1 chars (plus a terminator).\n
1259 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1260 * portable, versions of some common "sprintf()" commands.\n
1262 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1263 * the item is also an artifact, which should NEVER happen.\n
1265 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1266 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1267 * The "Specials" never use "modifiers" if they are "known", since they\n
1268 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1270 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1271 * plus the artifact name, just like any other artifact, if known.\n
1273 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1274 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1275 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1276 * they will append the artifact name, just like any artifact, if known.\n
1278 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1281 * OD_NAME_ONLY : The Cloak of Death\n
1282 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1283 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1284 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1286 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1287 * OD_NO_PLURAL : Forbidden use of plural \n
1288 * OD_STORE : Assume to be aware and known\n
1289 * OD_NO_FLAVOR : Allow to hidden flavor\n
1290 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1292 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1294 /* Extract object kind name */
1295 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1297 /* Extract default "base" string */
1298 concptr basenm = kindname;
1300 /* Assume no "modifier" string */
1301 concptr modstr = "";
1310 bool show_weapon = FALSE;
1311 bool show_armour = FALSE;
1316 char p1 = '(', p2 = ')';
1317 char b1 = '[', b2 = ']';
1318 char c1 = '{', c2 = '}';
1320 char tmp_val[MAX_NLEN+160];
1321 char tmp_val2[MAX_NLEN+10];
1322 char fake_insc_buf[30];
1324 BIT_FLAGS flgs[TR_FLAG_SIZE];
1326 object_type *bow_ptr;
1328 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1329 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1331 /* Extract some flags */
1332 object_flags(o_ptr, flgs);
1334 /* See if the object is "aware" */
1335 if (object_is_aware(o_ptr)) aware = TRUE;
1337 /* See if the object is "known" */
1338 if (object_is_known(o_ptr)) known = TRUE;
1340 /* Allow flavors to be hidden when aware */
1341 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1343 /* Object is in the inventory of a store or spoiler */
1344 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1346 /* Don't show flavors */
1349 /* Pretend known and aware */
1354 /* Force to be flavor name only */
1355 if (mode & OD_FORCE_FLAVOR)
1361 /* Cancel shuffling */
1362 flavor_k_ptr = k_ptr;
1365 /* Analyze the object */
1366 switch (o_ptr->tval)
1368 /* Some objects are easy to describe */
1382 monster_race *r_ptr = &r_info[o_ptr->pval];
1388 modstr = _(" (空)", " (empty)");
1393 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1396 concptr t = r_name + r_ptr->name;
1398 if (!(r_ptr->flags1 & RF1_UNIQUE))
1400 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1406 sprintf(tmp_val2, "(%s)", t);
1416 /* Figurines/Statues */
1420 monster_race *r_ptr = &r_info[o_ptr->pval];
1423 modstr = r_name + r_ptr->name;
1425 concptr t = r_name + r_ptr->name;
1427 if (!(r_ptr->flags1 & RF1_UNIQUE))
1429 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1446 monster_race *r_ptr = &r_info[o_ptr->pval];
1448 modstr = r_name + r_ptr->name;
1453 if (r_ptr->flags1 & RF1_UNIQUE)
1454 basenm = "& % of #";
1462 /* Missiles/ Bows/ Weapons */
1491 /* Lites (including a few "Specials") */
1497 /* Amulets (including a few "Specials") */
1500 /* Known artifacts */
1503 if (object_is_fixed_artifact(o_ptr)) break;
1504 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1507 /* Color the object */
1508 modstr = k_name + flavor_k_ptr->flavor_name;
1511 if (!flavor) basenm = "%のアミュレット";
1512 else if (aware) basenm = "%の#アミュレット";
1513 else basenm = "#アミュレット";
1515 if (!flavor) basenm = "& Amulet~ of %";
1516 else if (aware) basenm = "& # Amulet~ of %";
1517 else basenm = "& # Amulet~";
1523 /* Rings (including a few "Specials") */
1526 /* Known artifacts */
1529 if (object_is_fixed_artifact(o_ptr)) break;
1530 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1533 /* Color the object */
1534 modstr = k_name + flavor_k_ptr->flavor_name;
1537 if (!flavor) basenm = "%の指輪";
1538 else if (aware) basenm = "%の#指輪";
1539 else basenm = "#指輪";
1541 if (!flavor) basenm = "& Ring~ of %";
1542 else if (aware) basenm = "& # Ring~ of %";
1543 else basenm = "& # Ring~";
1546 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1558 /* Color the object */
1559 modstr = k_name + flavor_k_ptr->flavor_name;
1562 if (!flavor) basenm = "%の杖";
1563 else if (aware) basenm = "%の#杖";
1566 if (!flavor) basenm = "& Staff~ of %";
1567 else if (aware) basenm = "& # Staff~ of %";
1568 else basenm = "& # Staff~";
1576 /* Color the object */
1577 modstr = k_name + flavor_k_ptr->flavor_name;
1580 if (!flavor) basenm = "%の魔法棒";
1581 else if (aware) basenm = "%の#魔法棒";
1582 else basenm = "#魔法棒";
1584 if (!flavor) basenm = "& Wand~ of %";
1585 else if (aware) basenm = "& # Wand~ of %";
1586 else basenm = "& # Wand~";
1594 /* Color the object */
1595 modstr = k_name + flavor_k_ptr->flavor_name;
1598 if (!flavor) basenm = "%のロッド";
1599 else if (aware) basenm = "%の#ロッド";
1600 else basenm = "#ロッド";
1602 if (!flavor) basenm = "& Rod~ of %";
1603 else if (aware) basenm = "& # Rod~ of %";
1604 else basenm = "& # Rod~";
1612 /* Color the object */
1613 modstr = k_name + flavor_k_ptr->flavor_name;
1616 if (!flavor) basenm = "%の巻物";
1617 else if (aware) basenm = "「#」と書かれた%の巻物";
1618 else basenm = "「#」と書かれた巻物";
1620 if (!flavor) basenm = "& Scroll~ of %";
1621 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1622 else basenm = "& Scroll~ titled \"#\"";
1630 /* Color the object */
1631 modstr = k_name + flavor_k_ptr->flavor_name;
1634 if (!flavor) basenm = "%の薬";
1635 else if (aware) basenm = "%の#薬";
1638 if (!flavor) basenm = "& Potion~ of %";
1639 else if (aware) basenm = "& # Potion~ of %";
1640 else basenm = "& # Potion~";
1648 /* Ordinary food is "boring" */
1649 if (!k_ptr->flavor_name) break;
1651 /* Color the object */
1652 modstr = k_name + flavor_k_ptr->flavor_name;
1655 if (!flavor) basenm = "%のキノコ";
1656 else if (aware) basenm = "%の#キノコ";
1657 else basenm = "#キノコ";
1659 if (!flavor) basenm = "& Mushroom~ of %";
1660 else if (aware) basenm = "& # Mushroom~ of %";
1661 else basenm = "& # Mushroom~";
1669 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1679 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1680 basenm = "& Book~ of Life Magic %";
1682 basenm = "& Life Spellbook~ %";
1688 case TV_SORCERY_BOOK:
1693 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1694 basenm = "& Book~ of Sorcery %";
1696 basenm = "& Sorcery Spellbook~ %";
1702 case TV_NATURE_BOOK:
1707 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1708 basenm = "& Book~ of Nature Magic %";
1710 basenm = "& Nature Spellbook~ %";
1719 basenm = "カオスの魔法書%";
1721 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1722 basenm = "& Book~ of Chaos Magic %";
1724 basenm = "& Chaos Spellbook~ %";
1735 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1736 basenm = "& Book~ of Death Magic %";
1738 basenm = "& Death Spellbook~ %";
1747 basenm = "トランプの魔法書%";
1749 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1750 basenm = "& Book~ of Trump Magic %";
1752 basenm = "& Trump Spellbook~ %";
1758 case TV_ARCANE_BOOK:
1763 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1764 basenm = "& Book~ of Arcane Magic %";
1766 basenm = "& Arcane Spellbook~ %";
1777 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1778 basenm = "& Book~ of Craft Magic %";
1780 basenm = "& Craft Spellbook~ %";
1786 case TV_DAEMON_BOOK:
1791 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1792 basenm = "& Book~ of Daemon Magic %";
1794 basenm = "& Daemon Spellbook~ %";
1800 case TV_CRUSADE_BOOK:
1805 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1806 basenm = "& Book~ of Crusade Magic %";
1808 basenm = "& Crusade Spellbook~ %";
1816 basenm = _("歌集%", "& Song Book~ %");
1820 case TV_HISSATSU_BOOK:
1822 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1831 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1832 basenm = "& Book~ of Hex Magic %";
1834 basenm = "& Hex Spellbook~ %";
1840 /* Hack -- Gold/Gems */
1843 strcpy(buf, basenm);
1847 /* Used in the "inventory" routine */
1850 strcpy(buf, _("(なし)", "(nothing)"));
1855 /* Use full name from k_info or a_info */
1856 if (aware && have_flag(flgs, TR_FULL_NAME))
1858 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1859 else basenm = kindname;
1862 /* Start dumping the result */
1866 if (basenm[0] == '&')
1872 if (mode & OD_OMIT_PREFIX)
1876 else if (o_ptr->number > 1)
1878 t = object_desc_kosuu(t, o_ptr);
1879 t = object_desc_str(t, "の ");
1882 /* 英語の場合アーティファクトは The が付くので分かるが
1883 * 日本語では分からないのでマークをつける
1887 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1888 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1893 /* The object "expects" a "number" */
1894 if (basenm[0] == '&')
1896 /* Skip the ampersand (and space) */
1900 if (mode & OD_OMIT_PREFIX)
1905 /* Hack -- None left */
1906 else if (o_ptr->number <= 0)
1908 t = object_desc_str(t, "no more ");
1911 /* Extract the number */
1912 else if (o_ptr->number > 1)
1914 t = object_desc_num(t, o_ptr->number);
1915 t = object_desc_chr(t, ' ');
1918 /* Hack -- The only one of its kind */
1919 else if ((known && object_is_artifact(o_ptr)) ||
1920 ((o_ptr->tval == TV_CORPSE) &&
1921 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1923 t = object_desc_str(t, "The ");
1933 case '#': vowel = is_a_vowel(modstr[0]); break;
1934 case '%': vowel = is_a_vowel(*kindname); break;
1935 default: vowel = is_a_vowel(*s); break;
1940 /* A single one, with a vowel */
1941 t = object_desc_str(t, "an ");
1945 /* A single one, without a vowel */
1946 t = object_desc_str(t, "a ");
1951 /* Hack -- objects that "never" take an article */
1958 if (mode & OD_OMIT_PREFIX)
1963 /* Hack -- all gone */
1964 else if (o_ptr->number <= 0)
1966 t = object_desc_str(t, "no more ");
1969 /* Prefix a number if required */
1970 else if (o_ptr->number > 1)
1972 t = object_desc_num(t, o_ptr->number);
1973 t = object_desc_chr(t, ' ');
1976 /* Hack -- The only one of its kind */
1977 else if (known && object_is_artifact(o_ptr))
1979 t = object_desc_str(t, "The ");
1982 /* Hack -- single items get no prefix */
1990 /* Paranoia -- skip illegal tildes */
1991 /* while (*s == '~') s++; */
1994 if (object_is_smith(o_ptr))
1996 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
1999 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2003 if (o_ptr->art_name)
2005 concptr temp = quark_str(o_ptr->art_name);
2007 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2008 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2009 if (strncmp(temp, "of ", 3) == 0)
2011 t = object_desc_str(t, &temp[3]);
2012 t = object_desc_str(t, "の");
2014 else if ((strncmp(temp, "『", 2) != 0) &&
2015 (strncmp(temp, "《", 2) != 0) &&
2017 t = object_desc_str(t, temp);
2020 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2022 artifact_type *a_ptr = &a_info[o_ptr->name1];
2023 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2024 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2026 t = object_desc_str(t, a_name + a_ptr->name);
2030 else if (object_is_ego(o_ptr))
2032 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2033 t = object_desc_str(t, e_name + e_ptr->name);
2038 /* Copy the string */
2039 for (s0 = NULL; *s || s0; )
2041 /* The end of the flavour/kind string. */
2048 /* Begin to append the modifier (flavor) */
2049 else if ((*s == '#') && !s0)
2054 /* Paranoia -- Never append multiple modstrs */
2058 /* Begin to append the kind name */
2059 else if ((*s == '%') && !s0)
2064 /* Paranoia -- Never append multiple kindnames */
2072 /* Add a plural if needed */
2073 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2079 /* Hack -- "Cutlass-es" and "Torch-es" */
2080 if ((k == 's') || (k == 'h')) *t++ = 'e';
2102 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2105 /* ランダムアーティファクトの名前はセーブファイルに記録
2106 されるので、英語版の名前もそれらしく変換する */
2107 if (o_ptr->art_name)
2111 strcpy(temp, quark_str(o_ptr->art_name));
2112 /* MEGA HACK by ita */
2113 if (strncmp(temp, "『", 2) == 0 ||
2114 strncmp(temp, "《", 2) == 0)
2115 t = object_desc_str(t, temp);
2116 else if (temp[0] == '\'')
2118 itemp = strlen(temp);
2119 temp[itemp - 1] = 0;
2120 t = object_desc_str(t, "『");
2121 t = object_desc_str(t, &temp[1]);
2122 t = object_desc_str(t, "』");
2125 else if (object_is_fixed_artifact(o_ptr))
2127 artifact_type *a_ptr = &a_info[o_ptr->name1];
2128 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2130 t = object_desc_str(t, a_name + a_ptr->name);
2133 else if (o_ptr->inscription)
2135 concptr str = quark_str(o_ptr->inscription);
2144 if (*str == '#') break;
2150 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2152 /* Add the false name */
2153 t = object_desc_str(t,"『");
2154 t = object_desc_str(t, &str_aux[1]);
2155 t = object_desc_str(t,"』");
2160 if (object_is_smith(o_ptr))
2162 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2165 /* Hack -- Append "Artifact" or "Special" names */
2166 if (known && !have_flag(flgs, TR_FULL_NAME))
2168 /* Is it a new random artifact ? */
2169 if (o_ptr->art_name)
2171 t = object_desc_chr(t, ' ');
2172 t = object_desc_str(t, quark_str(o_ptr->art_name));
2175 /* Grab any artifact name */
2176 else if (object_is_fixed_artifact(o_ptr))
2178 artifact_type *a_ptr = &a_info[o_ptr->name1];
2180 t = object_desc_chr(t, ' ');
2181 t = object_desc_str(t, a_name + a_ptr->name);
2184 /* Grab any ego-item name */
2187 if (object_is_ego(o_ptr))
2189 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2191 t = object_desc_chr(t, ' ');
2192 t = object_desc_str(t, e_name + e_ptr->name);
2195 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2198 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2200 /* Add the false name */
2201 t = object_desc_chr(t, ' ');
2202 t = object_desc_str(t, &str[1]);
2209 /* No more details wanted */
2210 if (mode & OD_NAME_ONLY) goto object_desc_done;
2212 /* Hack -- Chests must be described in detail */
2213 if (o_ptr->tval == TV_CHEST)
2215 /* Not searched yet */
2221 /* May be "empty" */
2222 else if (!o_ptr->pval)
2224 t = object_desc_str(t, _("(空)", " (empty)"));
2227 /* May be "disarmed" */
2228 else if (o_ptr->pval < 0)
2230 if (chest_traps[0 - o_ptr->pval])
2232 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2236 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2240 /* Describe the traps, if any */
2243 /* Describe the traps */
2244 switch (chest_traps[o_ptr->pval])
2248 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2251 case CHEST_LOSE_STR:
2253 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2256 case CHEST_LOSE_CON:
2258 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2263 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2266 case CHEST_PARALYZE:
2268 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2273 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2277 case CHEST_BIRD_STORM:
2278 case CHEST_E_SUMMON:
2279 case CHEST_H_SUMMON:
2281 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2284 case CHEST_RUNES_OF_EVIL:
2286 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2291 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2296 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2304 /* Display the item like a weapon */
2305 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2307 /* Display the item like a weapon */
2308 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2311 /* Display the item like a weapon */
2312 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2314 /* Display the item like armour */
2315 if (o_ptr->ac) show_armour = TRUE;
2318 /* Dump base weapon info */
2319 switch (o_ptr->tval)
2321 /* Missiles and Weapons */
2330 /* In Vault Quest, hide the dice of target weapon. */
2331 if(object_is_quest_target(o_ptr) && !known)
2336 /* Append a "damage" string */
2337 t = object_desc_chr(t, ' ');
2338 t = object_desc_chr(t, p1);
2339 t = object_desc_num(t, o_ptr->dd);
2340 t = object_desc_chr(t, 'd');
2341 t = object_desc_num(t, o_ptr->ds);
2342 t = object_desc_chr(t, p2);
2348 /* Bows get a special "damage string" */
2351 /* Mega-Hack -- Extract the "base power" */
2352 power = bow_tmul(o_ptr->sval);
2354 /* Apply the "Extra Might" flag */
2355 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2357 /* Append a special "damage" string */
2358 t = object_desc_chr(t, ' ');
2359 t = object_desc_chr(t, p1);
2360 t = object_desc_chr(t, 'x');
2361 t = object_desc_num(t, power);
2362 t = object_desc_chr(t, p2);
2364 fire_rate = calc_num_fire(o_ptr);
2365 /* Show Fire rate */
2366 if (fire_rate != 0 && power > 0 && known)
2368 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2370 t = object_desc_chr(t, ' ');
2371 t = object_desc_chr(t, p1);
2372 t = object_desc_num(t, fire_rate/100);
2373 t = object_desc_chr(t, '.');
2374 t = object_desc_num(t, fire_rate%100);
2375 t = object_desc_str(t, "turn");
2376 t = object_desc_chr(t, p2);
2384 /* Add the weapon bonuses */
2387 /* Show the tohit/todam on request */
2390 t = object_desc_chr(t, ' ');
2391 t = object_desc_chr(t, p1);
2392 t = object_desc_int(t, o_ptr->to_h);
2393 t = object_desc_chr(t, ',');
2394 t = object_desc_int(t, o_ptr->to_d);
2395 t = object_desc_chr(t, p2);
2398 /* Show the tohit if needed */
2399 else if (o_ptr->to_h)
2401 t = object_desc_chr(t, ' ');
2402 t = object_desc_chr(t, p1);
2403 t = object_desc_int(t, o_ptr->to_h);
2404 t = object_desc_chr(t, p2);
2407 /* Show the todam if needed */
2408 else if (o_ptr->to_d)
2410 t = object_desc_chr(t, ' ');
2411 t = object_desc_chr(t, p1);
2412 t = object_desc_int(t, o_ptr->to_d);
2413 t = object_desc_chr(t, p2);
2417 bow_ptr = &inventory[INVEN_BOW];
2419 /* If have a firing weapon + ammo matches bow */
2420 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2422 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2423 int tmul = bow_tmul(bow_ptr->sval);
2424 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2426 /* See if the bow is "known" - then set damage bonus */
2427 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2429 /* Effect of ammo */
2430 if (known) avgdam += (o_ptr->to_d * 10);
2432 /* Get extra "power" from "extra might" */
2433 if (p_ptr->xtra_might) tmul++;
2435 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2437 /* Launcher multiplier */
2439 avgdam /= (100 * 10);
2441 /* Get extra damage from concentration */
2442 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2444 if (avgdam < 0) avgdam = 0;
2446 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2447 t = object_desc_chr(t, ' ');
2448 t = object_desc_chr(t, p1);
2450 if(show_ammo_no_crit)
2452 /* Damage with no-crit */
2453 t = object_desc_num(t, avgdam);
2454 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2457 /* Apply Expect damage of Critical */
2458 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2459 t = object_desc_num(t, avgdam);
2461 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2462 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2464 if (p_ptr->num_fire == 0)
2466 t = object_desc_chr(t, '0');
2470 /* Calc effects of energy */
2471 avgdam *= (p_ptr->num_fire * 100);
2472 avgdam /= energy_fire;
2473 t = object_desc_num(t, avgdam);
2474 t = object_desc_str(t, show_ammo_detail ? "/current_world_ptr->game_turn" : "");
2476 if(show_ammo_crit_ratio)
2478 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2480 t = object_desc_chr(t, '/');
2481 t = object_desc_num(t, percent / 100);
2482 t = object_desc_chr(t, '.');
2483 if(percent % 100 < 10)
2485 t = object_desc_chr(t, '0');
2487 t = object_desc_num(t, percent % 100);
2488 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2492 t = object_desc_chr(t, p2);
2494 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2496 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2497 s16b energy_fire = 100 - p_ptr->lev;
2499 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2501 /* Display (shot damage/ avg damage) */
2502 t = object_desc_chr(t, ' ');
2503 t = object_desc_chr(t, p1);
2504 t = object_desc_num(t, avgdam);
2505 t = object_desc_chr(t, '/');
2507 /* Calc effects of energy */
2508 avgdam = 100 * avgdam / energy_fire;
2510 t = object_desc_num(t, avgdam);
2511 t = object_desc_chr(t, p2);
2514 /* Add the armor bonuses */
2517 /* Show the armor class info */
2520 t = object_desc_chr(t, ' ');
2521 t = object_desc_chr(t, b1);
2522 t = object_desc_num(t, o_ptr->ac);
2523 t = object_desc_chr(t, ',');
2524 t = object_desc_int(t, o_ptr->to_a);
2525 t = object_desc_chr(t, b2);
2528 /* No base armor, but does increase armor */
2529 else if (o_ptr->to_a)
2531 t = object_desc_chr(t, ' ');
2532 t = object_desc_chr(t, b1);
2533 t = object_desc_int(t, o_ptr->to_a);
2534 t = object_desc_chr(t, b2);
2538 /* Hack -- always show base armor */
2539 else if (show_armour)
2541 t = object_desc_chr(t, ' ');
2542 t = object_desc_chr(t, b1);
2543 t = object_desc_num(t, o_ptr->ac);
2544 t = object_desc_chr(t, b2);
2548 /* No more details wanted */
2549 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2552 if (known) /* Known item only */
2555 * Hack -- Wands and Staffs have charges. Make certain how many charges
2556 * a stack of staffs really has is clear. -LM-
2558 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2560 /* Dump " (N charges)" */
2561 t = object_desc_chr(t, ' ');
2562 t = object_desc_chr(t, p1);
2564 /* Clear explaination for staffs. */
2565 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2567 t = object_desc_num(t, o_ptr->number);
2568 t = object_desc_str(t, "x ");
2570 t = object_desc_num(t, o_ptr->pval);
2572 t = object_desc_str(t, "回分");
2574 t = object_desc_str(t, " charge");
2575 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2578 t = object_desc_chr(t, p2);
2580 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2581 * be in any state of charge or discharge, this now includes a number. -LM-
2583 else if (o_ptr->tval == TV_ROD)
2585 /* Hack -- Dump " (# charging)" if relevant */
2588 /* Stacks of rods display an exact count of charging rods. */
2589 if (o_ptr->number > 1)
2592 if (k_ptr->pval == 0) k_ptr->pval = 1;
2594 /* Find out how many rods are charging, by dividing
2595 * current timeout by each rod's maximum timeout.
2596 * Ensure that any remainder is rounded up. Display
2597 * very discharged stacks as merely fully discharged.
2599 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2600 if (power > o_ptr->number) power = o_ptr->number;
2602 /* Display prettily. */
2603 t = object_desc_str(t, " (");
2604 t = object_desc_num(t, power);
2605 t = object_desc_str(t, _("本 充填中)", " charging)"));
2608 /* "one Rod of Perception (1 charging)" would look tacky. */
2611 t = object_desc_str(t, _("(充填中)", " (charging)"));
2616 /* Dump "pval" flags for wearable items */
2617 if (have_pval_flags(flgs))
2619 /* Start the display */
2620 t = object_desc_chr(t, ' ');
2621 t = object_desc_chr(t, p1);
2623 /* Dump the "pval" itself */
2624 t = object_desc_int(t, o_ptr->pval);
2626 /* Do not display the "pval" flags */
2627 if (have_flag(flgs, TR_HIDE_TYPE))
2632 else if (have_flag(flgs, TR_SPEED))
2634 /* Dump " to speed" */
2635 t = object_desc_str(t, _("加速", " to speed"));
2639 else if (have_flag(flgs, TR_BLOWS))
2643 t = object_desc_str(t, "攻撃");
2645 t = object_desc_str(t, " attack");
2648 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2653 else if (have_flag(flgs, TR_STEALTH))
2655 /* Dump " to stealth" */
2656 t = object_desc_str(t, _("隠密", " to stealth"));
2660 else if (have_flag(flgs, TR_SEARCH))
2662 /* Dump " to searching" */
2663 t = object_desc_str(t, _("探索", " to searching"));
2667 else if (have_flag(flgs, TR_INFRA))
2669 /* Dump " to infravision" */
2670 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2673 /* Finish the display */
2674 t = object_desc_chr(t, p2);
2677 /* Hack -- Process Lanterns/Torches */
2678 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2680 /* Hack -- Turns of light for normal lites */
2682 t = object_desc_chr(t, '(');
2684 t = object_desc_str(t, " (with ");
2687 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2688 else t = object_desc_num(t, o_ptr->xtra4);
2689 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2692 /* Indicate charging objects, but not rods. */
2693 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2695 /* Hack -- Dump " (charging)" if relevant */
2696 t = object_desc_str(t, _("(充填中)", " (charging)"));
2701 /* No more details wanted */
2702 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2705 /* Prepare real inscriptions in a buffer */
2708 /* Auto abbreviation inscribe */
2709 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2711 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2722 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2726 /* Use the standard inscription if available */
2727 if (o_ptr->inscription)
2731 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2733 /* Get inscription and convert {%} */
2734 get_inscription(buff, o_ptr);
2736 /* strcat with correct treating of kanji */
2737 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2741 /* No fake inscription yet */
2742 fake_insc_buf[0] = '\0';
2744 /* Use the game-generated "feeling" otherwise, if available */
2747 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2750 /* Note "cursed" if the item is known to be cursed */
2751 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2753 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2756 /* Note "unidentified" if the item is unidentified */
2757 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2758 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2760 && !(o_ptr->ident & IDENT_SENSE))
2762 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2765 /* Mega-Hack -- note empty wands/staffs */
2766 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2768 strcpy(fake_insc_buf, _("空", "empty"));
2771 /* Note "tried" if the object has been tested unsuccessfully */
2772 else if (!aware && object_is_tried(o_ptr))
2774 strcpy(fake_insc_buf, _("未判明", "tried"));
2777 /* Note the discount, if any */
2778 if (o_ptr->discount)
2780 /* Hidden by real inscription unless in a store */
2781 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2783 char discount_num_buf[4];
2785 /* Append to other fake inscriptions if any */
2786 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2788 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2789 strcat(fake_insc_buf, discount_num_buf);
2790 strcat(fake_insc_buf, _("%引き", "% off"));
2795 /* Append the inscription, if any */
2796 if (fake_insc_buf[0] || tmp_val2[0])
2798 /* Append the inscription */
2799 t = object_desc_chr(t, ' ');
2800 t = object_desc_chr(t, c1);
2802 /* Append fake inscriptions */
2803 if (fake_insc_buf[0])
2805 t = object_desc_str(t, fake_insc_buf);
2808 /* Append a separater */
2809 if (fake_insc_buf[0] && tmp_val2[0])
2811 t = object_desc_chr(t, ',');
2812 t = object_desc_chr(t, ' ');
2815 /* Append real inscriptions */
2818 t = object_desc_str(t, tmp_val2);
2821 t = object_desc_chr(t, c2);
2825 my_strcpy(buf, tmp_val, MAX_NLEN);