3 * @brief オブジェクトの記述処理 / Mbject flavor code
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
14 #include "player-status.h"
16 #include "object-hook.h"
19 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
21 * @return 簡易名称を明らかにするならTRUEを返す。
23 * This function is used only by "flavor_init()"
25 static bool object_easy_know(int i)
27 object_kind *k_ptr = &k_info[i];
29 /* Analyze the "tval" */
44 case TV_HISSATSU_BOOK:
61 /* All Food, Potions, Scrolls, Rods */
75 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
76 * @param out_string 作成した名を保管する参照ポインタ
78 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
79 * syllables 配列と elvish.txt を組み合わせる。\n
81 void get_table_name_aux(char *out_string)
85 get_rnd_line("aname_j.txt", 1, Syllable);
86 strcpy(out_string, Syllable);
87 get_rnd_line("aname_j.txt", 2, Syllable);
88 strcat(out_string, Syllable);
90 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
92 static concptr syllables[MAX_SYLLABLES] = {
93 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
94 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
95 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
96 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
97 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
98 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
99 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
100 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
101 "kho", "kli", "klis", "la", "lech", "man", "mar",
102 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
103 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
104 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
105 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
106 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
107 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
108 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
109 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
110 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
111 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
112 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
116 int testcounter = randint1(3) + 1;
118 strcpy(out_string, "");
120 if (randint1(3) == 2)
122 while (testcounter--)
123 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
128 testcounter = randint1(2) + 1;
129 while (testcounter--)
131 (void)get_rnd_line("elvish.txt", 0, Syllable);
132 strcat(out_string, Syllable);
136 out_string[0] = toupper(out_string[1]);
138 out_string[16] = '\0';
143 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
144 * @param out_string 作成した名を保管する参照ポインタ
146 * @details get_table_name_aux()ほぼ完全に実装を依存している。
148 void get_table_name(char *out_string)
151 get_table_name_aux(buff);
152 sprintf(out_string, _("『%s』", "'%s'"), buff);
156 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
157 * @param out_string 作成した名を保管する参照ポインタ
159 * @details sname.txtが語幹の辞書となっている。
161 void get_table_sindarin_aux(char *out_string)
168 get_rnd_line("sname.txt", 1, Syllable);
170 strcpy(tmp, Syllable);
172 strcpy(out_string, Syllable);
175 get_rnd_line("sname.txt", 2, Syllable);
177 strcat(tmp, Syllable);
178 sindarin_to_kana(out_string, tmp);
180 strcat(out_string, Syllable);
185 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
186 * @param out_string 作成した名を保管する参照ポインタ
188 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
190 void get_table_sindarin(char *out_string)
193 get_table_sindarin_aux(buff);
194 sprintf(out_string, _("『%s』", "'%s'"), buff);
199 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
200 * @param tval シャッフルしたいtval
202 * @details 巻物、各種魔道具などに利用される。
204 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
206 KIND_OBJECT_IDX *k_idx_list;
207 KIND_OBJECT_IDX k_idx_list_num = 0;
210 /* Allocate an array for a list of k_idx */
211 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
213 /* Search objects with given tval for shuffle */
214 for (i = 0; i < max_k_idx; i++)
216 object_kind *k_ptr = &k_info[i];
219 if (k_ptr->tval != tval) continue;
221 /* Paranoia -- Skip objects without flavor */
222 if (!k_ptr->flavor) continue;
224 /* Skip objects with a fixed flavor name */
225 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
228 k_idx_list[k_idx_list_num] = i;
230 /* Increase number of remembered indices */
234 /* Shuffle flavors */
235 for (i = 0; i < k_idx_list_num; i++)
237 object_kind *k1_ptr = &k_info[k_idx_list[i]];
238 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
240 /* Swap flavors of this pair */
241 s16b tmp = k1_ptr->flavor;
242 k1_ptr->flavor = k2_ptr->flavor;
243 k2_ptr->flavor = tmp;
246 /* Free an array for a list of k_idx */
247 C_KILL(k_idx_list, max_k_idx, s16b);
251 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
254 * Prepare the "variable" part of the "k_info" array.\n
256 * The "color"/"metal"/"type" of an item is its "flavor".\n
257 * For the most part, flavors are assigned randomly each game.\n
259 * Initialize descriptions for the "colored" objects, including:\n
260 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
262 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
263 * Slime Mold Juice, Unused Potion).\n
265 * Scroll titles are always between 6 and 14 letters long. This is\n
266 * ensured because every title is composed of whole words, where every\n
267 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
268 * letters each), and that no scroll is finished until it attempts to\n
269 * grow beyond 15 letters. The first time this can happen is when the\n
270 * current title has 6 letters and the new word has 8 letters, which\n
271 * would result in a 6 letter scroll title.\n
273 * Duplicate titles are avoided by requiring that no two scrolls share\n
274 * the same first four letters (not the most efficient method, and not\n
275 * the least efficient method, but it will always work).\n
277 * Hack -- make sure everything stays the same for each saved game\n
278 * This is accomplished by the use of a saved "random seed", as in\n
279 * "town_gen()". Since no other functions are called while the special\n
280 * seed is in effect, so this function is pretty "safe".\n
282 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
284 void flavor_init(void)
287 u32b state_backup[4];
289 /* Hack -- Backup the RNG state */
290 Rand_state_backup(state_backup);
292 /* Hack -- Induce consistant flavors */
293 Rand_state_set(seed_flavor);
296 /* Initialize flavor index of each object by itself */
297 for (i = 0; i < max_k_idx; i++)
299 object_kind *k_ptr = &k_info[i];
301 /* Skip objects without flavor name */
302 if (!k_ptr->flavor_name) continue;
305 * Initialize flavor index to itself
306 * -> Shuffle it later
312 shuffle_flavors(TV_RING);
314 /* Shuffle Amulets */
315 shuffle_flavors(TV_AMULET);
318 shuffle_flavors(TV_STAFF);
321 shuffle_flavors(TV_WAND);
324 shuffle_flavors(TV_ROD);
326 /* Shuffle Mushrooms */
327 shuffle_flavors(TV_FOOD);
329 /* Shuffle Potions */
330 shuffle_flavors(TV_POTION);
332 /* Shuffle Scrolls */
333 shuffle_flavors(TV_SCROLL);
336 /* Hack -- Restore the RNG state */
337 Rand_state_restore(state_backup);
339 /* Analyze every object */
340 for (i = 1; i < max_k_idx; i++)
342 object_kind *k_ptr = &k_info[i];
344 /* Skip "empty" objects */
345 if (!k_ptr->name) continue;
347 /* No flavor yields aware */
348 if (!k_ptr->flavor) k_ptr->aware = TRUE;
350 /* Check for "easily known" */
351 k_ptr->easy_know = object_easy_know(i);
357 * @brief 対象文字配列に一文字だけをコピーする。
358 * @param t 保管先文字列ポインタ
362 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
363 * and return a pointer to the terminator (t + 1).\n
365 static char *object_desc_chr(char *t, char c)
376 * @brief 対象文字配列に文字列をコピーする。
377 * @param t 保管先文字列ポインタ
378 * @param s コピーしたい文字列ポインタ
381 * Print a string "s" into a string "t", as if by strcpy(t, s),
382 * and return a pointer to the terminator.
384 static char *object_desc_str(char *t, concptr s)
386 /* Copy the string */
387 while (*s) *t++ = *s++;
395 * @brief 対象文字配列に符号なし整数値をコピーする。
396 * @param t 保管先文字列ポインタ
400 * Print an unsigned number "n" into a string "t", as if by
401 * sprintf(t, "%u", n), and return a pointer to the terminator.
403 static char *object_desc_num(char *t, uint n)
407 /* Find "size" of "n" */
408 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
410 /* Dump each digit */
416 /* Remove the digit */
419 /* Process next digit */
433 * @brief 日本語の個数表示ルーチン
434 * @param t 保管先文字列ポインタ
435 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
438 * cmd1.c で流用するために object_desc_japanese から移動した。
440 char *object_desc_kosuu(char *t, object_type *o_ptr)
442 t = object_desc_num(t, o_ptr->number);
454 t = object_desc_str(t, "本");
459 t = object_desc_str(t, "巻");
464 t = object_desc_str(t, "服");
468 case TV_SORCERY_BOOK:
476 case TV_CRUSADE_BOOK:
478 case TV_HISSATSU_BOOK:
481 t = object_desc_str(t, "冊");
489 t = object_desc_str(t, "着");
496 t = object_desc_str(t, "振");
501 t = object_desc_str(t, "足");
506 t = object_desc_str(t, "枚");
512 if(o_ptr->sval == SV_FOOD_JERKY)
514 t = object_desc_str(t, "切れ");
520 if (o_ptr->number < 10)
522 t = object_desc_str(t, "つ");
526 t = object_desc_str(t, "個");
536 * @brief 対象文字配列に符号あり整数値をコピーする。
537 * @param t 保管先文字列ポインタ
541 * Print an signed number "v" into a string "t", as if by
542 * sprintf(t, "%+d", n), and return a pointer to the terminator.
543 * Note that we always print a sign, either "+" or "-".
545 static char *object_desc_int(char *t, sint v)
552 /* Take the absolute value */
555 /* Use a "minus" sign */
559 /* Positive (or zero) */
562 /* Use the actual number */
565 /* Use a "plus" sign */
569 /* Find "size" of "n" */
570 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
572 /* Dump each digit */
578 /* Remove the digit */
581 /* Process next digit */
592 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
594 typedef struct flag_insc_table
605 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
606 static flag_insc_table flag_insc_plus[] =
608 { "攻", "At", TR_BLOWS, -1 },
609 { "速", "Sp", TR_SPEED, -1 },
610 { "腕", "St", TR_STR, -1 },
611 { "知", "In", TR_INT, -1 },
612 { "賢", "Wi", TR_WIS, -1 },
613 { "器", "Dx", TR_DEX, -1 },
614 { "耐", "Cn", TR_CON, -1 },
615 { "魅", "Ch", TR_CHR, -1 },
616 { "道", "Md", TR_MAGIC_MASTERY, -1 },
617 { "隠", "Sl", TR_STEALTH, -1 },
618 { "探", "Sr", TR_SEARCH, -1 },
619 { "赤", "If", TR_INFRA, -1 },
620 { "掘", "Dg", TR_TUNNEL, -1 },
621 { NULL, NULL, 0, -1 }
624 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
625 static flag_insc_table flag_insc_immune[] =
627 { "酸", "Ac", TR_IM_ACID, -1 },
628 { "電", "El", TR_IM_ELEC, -1 },
629 { "火", "Fi", TR_IM_FIRE, -1 },
630 { "冷", "Co", TR_IM_COLD, -1 },
631 { NULL, NULL, 0, -1 }
634 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
635 static flag_insc_table flag_insc_resistance[] =
637 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
638 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
639 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
640 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
641 { "毒", "Po", TR_RES_POIS, -1 },
642 { "閃", "Li", TR_RES_LITE, -1 },
643 { "暗", "Dk", TR_RES_DARK, -1 },
644 { "破", "Sh", TR_RES_SHARDS, -1 },
645 { "盲", "Bl", TR_RES_BLIND, -1 },
646 { "乱", "Cf", TR_RES_CONF, -1 },
647 { "轟", "So", TR_RES_SOUND, -1 },
648 { "獄", "Nt", TR_RES_NETHER, -1 },
649 { "因", "Nx", TR_RES_NEXUS, -1 },
650 { "沌", "Ca", TR_RES_CHAOS, -1 },
651 { "劣", "Di", TR_RES_DISEN, -1 },
652 { "恐", "Fe", TR_RES_FEAR, -1 },
653 { NULL, NULL, 0, -1 }
656 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
657 static flag_insc_table flag_insc_misc[] =
659 { "易", "Es", TR_EASY_SPELL, -1 },
660 { "減", "Dm", TR_DEC_MANA, -1 },
661 { "投", "Th", TR_THROW, -1 },
662 { "反", "Rf", TR_REFLECT, -1 },
663 { "麻", "Fa", TR_FREE_ACT, -1 },
664 { "視", "Si", TR_SEE_INVIS, -1 },
665 { "経", "Hl", TR_HOLD_EXP, -1 },
666 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
667 { "活", "Rg", TR_REGEN, -1 },
668 { "浮", "Lv", TR_LEVITATION, -1 },
669 { "明", "Lu", TR_LITE_1, -1 },
670 { "明", "Lu", TR_LITE_2, -1 },
671 { "明", "Lu", TR_LITE_3, -1 },
672 { "闇", "Dl", TR_LITE_M1, -1 },
673 { "闇", "Dl", TR_LITE_M2, -1 },
674 { "闇", "Dl", TR_LITE_M3, -1 },
675 { "警", "Wr", TR_WARNING, -1 },
676 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
677 { "射", "Xs", TR_XTRA_SHOTS, -1 },
678 { "瞬", "Te", TR_TELEPORT, -1 },
679 { "怒", "Ag", TR_AGGRAVATE, -1 },
680 { "祝", "Bs", TR_BLESSED, -1 },
681 { "忌", "Ty", TR_TY_CURSE, -1 },
682 { "呪", "C-", TR_ADD_L_CURSE, -1 },
683 { "詛", "C+", TR_ADD_H_CURSE, -1 },
684 { NULL, NULL, 0, -1 }
687 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
688 static flag_insc_table flag_insc_aura[] =
690 { "炎", "F", TR_SH_FIRE, -1 },
691 { "電", "E", TR_SH_ELEC, -1 },
692 { "冷", "C", TR_SH_COLD, -1 },
693 { "魔", "M", TR_NO_MAGIC, -1 },
694 { "瞬", "T", TR_NO_TELE, -1 },
695 { NULL, NULL, 0, -1 }
698 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
699 static flag_insc_table flag_insc_brand[] =
701 { "酸", "A", TR_BRAND_ACID, -1 },
702 { "電", "E", TR_BRAND_ELEC, -1 },
703 { "焼", "F", TR_BRAND_FIRE, -1 },
704 { "凍", "Co", TR_BRAND_COLD, -1 },
705 { "毒", "P", TR_BRAND_POIS, -1 },
706 { "沌", "Ca", TR_CHAOTIC, -1 },
707 { "吸", "V", TR_VAMPIRIC, -1 },
708 { "震", "Q", TR_IMPACT, -1 },
709 { "切", "S", TR_VORPAL, -1 },
710 { "理", "M", TR_FORCE_WEAPON, -1 },
711 { NULL, NULL, 0, -1 }
714 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
715 static flag_insc_table flag_insc_kill[] =
717 { "邪", "*", TR_KILL_EVIL, -1 },
718 { "人", "p", TR_KILL_HUMAN, -1 },
719 { "龍", "D", TR_KILL_DRAGON, -1 },
720 { "オ", "o", TR_KILL_ORC, -1 },
721 { "ト", "T", TR_KILL_TROLL, -1 },
722 { "巨", "P", TR_KILL_GIANT, -1 },
723 { "デ", "U", TR_KILL_DEMON, -1 },
724 { "死", "L", TR_KILL_UNDEAD, -1 },
725 { "動", "Z", TR_KILL_ANIMAL, -1 },
726 { NULL, NULL, 0, -1 }
729 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
730 static flag_insc_table flag_insc_slay[] =
732 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
733 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
734 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
735 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
736 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
737 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
738 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
739 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
740 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
741 { NULL, NULL, 0, -1 }
744 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
745 static flag_insc_table flag_insc_esp1[] =
747 { "感", "Tele", TR_TELEPATHY, -1 },
748 { "邪", "Evil", TR_ESP_EVIL, -1 },
749 { "善", "Good", TR_ESP_GOOD, -1 },
750 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
751 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
752 { NULL, NULL, 0, -1 }
755 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
756 static flag_insc_table flag_insc_esp2[] =
758 { "人", "p", TR_ESP_HUMAN, -1 },
759 { "竜", "D", TR_ESP_DRAGON, -1 },
760 { "オ", "o", TR_ESP_ORC, -1 },
761 { "ト", "T", TR_ESP_TROLL, -1 },
762 { "巨", "P", TR_ESP_GIANT, -1 },
763 { "デ", "U", TR_ESP_DEMON, -1 },
764 { "死", "L", TR_ESP_UNDEAD, -1 },
765 { "動", "Z", TR_ESP_ANIMAL, -1 },
766 { NULL, NULL, 0, -1 }
769 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
770 static flag_insc_table flag_insc_sust[] =
772 { "腕", "St", TR_SUST_STR, -1 },
773 { "知", "In", TR_SUST_INT, -1 },
774 { "賢", "Wi", TR_SUST_WIS, -1 },
775 { "器", "Dx", TR_SUST_DEX, -1 },
776 { "耐", "Cn", TR_SUST_CON, -1 },
777 { "魅", "Ch", TR_SUST_CHR, -1 },
778 { NULL, NULL, 0, -1 }
782 static flag_insc_table flag_insc_plus[] =
784 { "At", TR_BLOWS, -1 },
785 { "Sp", TR_SPEED, -1 },
786 { "St", TR_STR, -1 },
787 { "In", TR_INT, -1 },
788 { "Wi", TR_WIS, -1 },
789 { "Dx", TR_DEX, -1 },
790 { "Cn", TR_CON, -1 },
791 { "Ch", TR_CHR, -1 },
792 { "Md", TR_MAGIC_MASTERY, -1 },
793 { "Sl", TR_STEALTH, -1 },
794 { "Sr", TR_SEARCH, -1 },
795 { "If", TR_INFRA, -1 },
796 { "Dg", TR_TUNNEL, -1 },
800 static flag_insc_table flag_insc_immune[] =
802 { "Ac", TR_IM_ACID, -1 },
803 { "El", TR_IM_ELEC, -1 },
804 { "Fi", TR_IM_FIRE, -1 },
805 { "Co", TR_IM_COLD, -1 },
809 static flag_insc_table flag_insc_resistance[] =
811 { "Ac", TR_RES_ACID, TR_IM_ACID },
812 { "El", TR_RES_ELEC, TR_IM_ELEC },
813 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
814 { "Co", TR_RES_COLD, TR_IM_COLD },
815 { "Po", TR_RES_POIS, -1 },
816 { "Li", TR_RES_LITE, -1 },
817 { "Dk", TR_RES_DARK, -1 },
818 { "Sh", TR_RES_SHARDS, -1 },
819 { "Bl", TR_RES_BLIND, -1 },
820 { "Cf", TR_RES_CONF, -1 },
821 { "So", TR_RES_SOUND, -1 },
822 { "Nt", TR_RES_NETHER, -1 },
823 { "Nx", TR_RES_NEXUS, -1 },
824 { "Ca", TR_RES_CHAOS, -1 },
825 { "Di", TR_RES_DISEN, -1 },
826 { "Fe", TR_RES_FEAR, -1 },
830 static flag_insc_table flag_insc_misc[] =
832 { "Es", TR_EASY_SPELL, -1 },
833 { "Dm", TR_DEC_MANA, -1 },
834 { "Th", TR_THROW, -1 },
835 { "Rf", TR_REFLECT, -1 },
836 { "Fa", TR_FREE_ACT, -1 },
837 { "Si", TR_SEE_INVIS, -1 },
838 { "Hl", TR_HOLD_EXP, -1 },
839 { "Sd", TR_SLOW_DIGEST, -1 },
840 { "Rg", TR_REGEN, -1 },
841 { "Lv", TR_LEVITATION, -1 },
842 { "Lu", TR_LITE_1, -1 },
843 { "Lu", TR_LITE_2, -1 },
844 { "Lu", TR_LITE_3, -1 },
845 { "Dl", TR_LITE_M1, -1 },
846 { "Dl", TR_LITE_M2, -1 },
847 { "Dl", TR_LITE_M3, -1 },
848 { "Wr", TR_WARNING, -1 },
849 { "Xm", TR_XTRA_MIGHT, -1 },
850 { "Xs", TR_XTRA_SHOTS, -1 },
851 { "Te", TR_TELEPORT, -1 },
852 { "Ag", TR_AGGRAVATE, -1 },
853 { "Bs", TR_BLESSED, -1 },
854 { "Ty", TR_TY_CURSE, -1 },
855 { "C-", TR_ADD_L_CURSE, -1 },
856 { "C+", TR_ADD_H_CURSE, -1 },
860 static flag_insc_table flag_insc_aura[] =
862 { "F", TR_SH_FIRE, -1 },
863 { "E", TR_SH_ELEC, -1 },
864 { "C", TR_SH_COLD, -1 },
865 { "M", TR_NO_MAGIC, -1 },
866 { "T", TR_NO_TELE, -1 },
870 static flag_insc_table flag_insc_brand[] =
872 { "A", TR_BRAND_ACID, -1 },
873 { "E", TR_BRAND_ELEC, -1 },
874 { "F", TR_BRAND_FIRE, -1 },
875 { "Co", TR_BRAND_COLD, -1 },
876 { "P", TR_BRAND_POIS, -1 },
877 { "Ca", TR_CHAOTIC, -1 },
878 { "V", TR_VAMPIRIC, -1 },
879 { "Q", TR_IMPACT, -1 },
880 { "S", TR_VORPAL, -1 },
881 { "M", TR_FORCE_WEAPON, -1 },
885 static flag_insc_table flag_insc_kill[] =
887 { "*", TR_KILL_EVIL, -1 },
888 { "p", TR_KILL_HUMAN, -1 },
889 { "D", TR_KILL_DRAGON, -1 },
890 { "o", TR_KILL_ORC, -1 },
891 { "T", TR_KILL_TROLL, -1 },
892 { "P", TR_KILL_GIANT, -1 },
893 { "U", TR_KILL_DEMON, -1 },
894 { "L", TR_KILL_UNDEAD, -1 },
895 { "Z", TR_KILL_ANIMAL, -1 },
899 static flag_insc_table flag_insc_slay[] =
901 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
902 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
903 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
904 { "o", TR_SLAY_ORC, TR_KILL_ORC },
905 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
906 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
907 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
908 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
909 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
913 static flag_insc_table flag_insc_esp1[] =
915 { "Tele", TR_TELEPATHY, -1 },
916 { "Evil", TR_ESP_EVIL, -1 },
917 { "Good", TR_ESP_GOOD, -1 },
918 { "Nolv", TR_ESP_NONLIVING, -1 },
919 { "Uniq", TR_ESP_UNIQUE, -1 },
923 static flag_insc_table flag_insc_esp2[] =
925 { "p", TR_ESP_HUMAN, -1 },
926 { "D", TR_ESP_DRAGON, -1 },
927 { "o", TR_ESP_ORC, -1 },
928 { "T", TR_ESP_TROLL, -1 },
929 { "P", TR_ESP_GIANT, -1 },
930 { "U", TR_ESP_DEMON, -1 },
931 { "L", TR_ESP_UNDEAD, -1 },
932 { "Z", TR_ESP_ANIMAL, -1 },
936 static flag_insc_table flag_insc_sust[] =
938 { "St", TR_SUST_STR, -1 },
939 { "In", TR_SUST_INT, -1 },
940 { "Wi", TR_SUST_WIS, -1 },
941 { "Dx", TR_SUST_DEX, -1 },
942 { "Cn", TR_SUST_CON, -1 },
943 { "Ch", TR_SUST_CHR, -1 },
948 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
949 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
952 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
953 * @param fi_ptr 参照する特性表示記号テーブル
954 * @param flgs 対応するオブジェクトのフラグ文字列
955 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
956 * @param ptr フラグ群を保管する文字列参照ポインタ
957 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
959 * Print an signed number "v" into a string "t", as if by
960 * sprintf(t, "%+d", n), and return a pointer to the terminator.
961 * Note that we always print a sign, either "+" or "-".
963 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
969 while (fi_ptr->english)
971 if (have_flag(flgs, fi_ptr->flag) &&
972 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
974 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
976 ADD_INSC(fi_ptr->english);
986 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
987 * @param fi_ptr 参照する特性表示記号テーブル
988 * @param flgs 対応するオブジェクトのフラグ文字列
989 * @return 1つでも該当の特性があったらTRUEを返す。
991 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
993 while (fi_ptr->english)
995 if (have_flag(flgs, fi_ptr->flag) &&
996 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1005 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1006 * @param ptr 特性短縮表記を格納する文字列ポインタ
1007 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1008 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1009 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1010 * @return ptrと同じアドレス
1012 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1014 char *prev_ptr = ptr;
1015 BIT_FLAGS flgs[TR_FLAG_SIZE];
1016 object_flags(o_ptr, flgs);
1018 /* Remove obvious flags */
1021 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1025 for (j = 0; j < TR_FLAG_SIZE; j++)
1026 flgs[j] &= ~k_ptr->flags[j];
1028 if (object_is_fixed_artifact(o_ptr))
1030 artifact_type *a_ptr = &a_info[o_ptr->name1];
1032 for (j = 0; j < TR_FLAG_SIZE; j++)
1033 flgs[j] &= ~a_ptr->flags[j];
1036 if (object_is_ego(o_ptr))
1038 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1040 for (j = 0; j < TR_FLAG_SIZE; j++)
1041 flgs[j] &= ~e_ptr->flags[j];
1045 /* Remove lite flags when this is a dark lite object */
1046 if (have_dark_flag(flgs))
1048 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1049 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1050 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1052 else if (have_lite_flag(flgs))
1054 add_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);
1060 if (have_flag_of(flag_insc_plus, flgs))
1065 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1068 if (have_flag_of(flag_insc_immune, flgs))
1070 if (!kanji && ptr != prev_ptr)
1077 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1080 if (have_flag_of(flag_insc_resistance, flgs))
1084 else if (ptr != prev_ptr)
1090 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1093 if (have_flag_of(flag_insc_misc, flgs))
1095 if (ptr != prev_ptr)
1101 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1104 if (have_flag_of(flag_insc_aura, flgs))
1108 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1111 if (have_flag_of(flag_insc_brand, flgs))
1113 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1116 if (have_flag_of(flag_insc_kill, flgs))
1118 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1121 if (have_flag_of(flag_insc_slay, flgs))
1123 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1128 if (have_flag_of(flag_insc_esp1, flgs) ||
1129 have_flag_of(flag_insc_esp2, flgs))
1131 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1132 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1136 if (have_flag_of(flag_insc_esp1, flgs))
1138 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1139 if (have_flag_of(flag_insc_esp2, flgs))
1141 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1145 if (have_flag_of(flag_insc_sust, flgs))
1149 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1158 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1159 * @param buff 特性短縮表記を格納する文字列ポインタ
1160 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1163 static void get_inscription(char *buff, object_type *o_ptr)
1165 concptr insc = quark_str(o_ptr->inscription);
1168 /* Not fully identified */
1169 if (!(o_ptr->ident & IDENT_MENTAL))
1171 /* Copy until end of line or '#' */
1174 if (*insc == '#') break;
1176 if (iskanji(*insc)) *buff++ = *insc++;
1186 for (; *insc; insc++)
1188 /* Ignore fake artifact inscription */
1189 if (*insc == '#') break;
1191 /* {%} will be automatically converted */
1192 else if ('%' == *insc)
1196 concptr start = ptr;
1198 /* check for too long inscription */
1199 if (ptr >= buff + MAX_NLEN) continue;
1212 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1222 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1236 * @brief オブジェクトがクエストの達成目的か否かを返す。
1237 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1238 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1240 bool object_is_quest_target(object_type *o_ptr)
1242 if (p_ptr->inside_quest)
1244 ARTIFACT_IDX a_idx = quest[p_ptr->inside_quest].k_idx;
1247 artifact_type *a_ptr = &a_info[a_idx];
1248 if (!(a_ptr->gen_flags & TRG_INSTA_ART))
1250 if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
1262 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1263 * @param buf 表記を返すための文字列参照ポインタ
1264 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1265 * @param mode 表記に関するオプション指定
1266 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1268 * One can choose the "verbosity" of the description, including whether\n
1269 * or not the "number" of items should be described, and how much detail\n
1270 * should be used when describing the item.\n
1272 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1273 * description, which can get pretty long, including incriptions, such as:\n
1274 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1275 * Note that the inscription will be clipped to keep the total description\n
1276 * under MAX_NLEN-1 chars (plus a terminator).\n
1278 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1279 * portable, versions of some common "sprintf()" commands.\n
1281 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1282 * the item is also an artifact, which should NEVER happen.\n
1284 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1285 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1286 * The "Specials" never use "modifiers" if they are "known", since they\n
1287 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1289 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1290 * plus the artifact name, just like any other artifact, if known.\n
1292 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1293 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1294 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1295 * they will append the artifact name, just like any artifact, if known.\n
1297 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1300 * OD_NAME_ONLY : The Cloak of Death\n
1301 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1302 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1303 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1305 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1306 * OD_NO_PLURAL : Forbidden use of plural \n
1307 * OD_STORE : Assume to be aware and known\n
1308 * OD_NO_FLAVOR : Allow to hidden flavor\n
1309 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1311 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1313 /* Extract object kind name */
1314 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1316 /* Extract default "base" string */
1317 concptr basenm = kindname;
1319 /* Assume no "modifier" string */
1320 concptr modstr = "";
1329 bool show_weapon = FALSE;
1330 bool show_armour = FALSE;
1335 char p1 = '(', p2 = ')';
1336 char b1 = '[', b2 = ']';
1337 char c1 = '{', c2 = '}';
1339 char tmp_val[MAX_NLEN+160];
1340 char tmp_val2[MAX_NLEN+10];
1341 char fake_insc_buf[30];
1343 BIT_FLAGS flgs[TR_FLAG_SIZE];
1345 object_type *bow_ptr;
1347 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1348 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1350 /* Extract some flags */
1351 object_flags(o_ptr, flgs);
1353 /* See if the object is "aware" */
1354 if (object_is_aware(o_ptr)) aware = TRUE;
1356 /* See if the object is "known" */
1357 if (object_is_known(o_ptr)) known = TRUE;
1359 /* Allow flavors to be hidden when aware */
1360 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1362 /* Object is in the inventory of a store or spoiler */
1363 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1365 /* Don't show flavors */
1368 /* Pretend known and aware */
1373 /* Force to be flavor name only */
1374 if (mode & OD_FORCE_FLAVOR)
1380 /* Cancel shuffling */
1381 flavor_k_ptr = k_ptr;
1384 /* Analyze the object */
1385 switch (o_ptr->tval)
1387 /* Some objects are easy to describe */
1401 monster_race *r_ptr = &r_info[o_ptr->pval];
1407 modstr = _(" (空)", " (empty)");
1412 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1415 concptr t = r_name + r_ptr->name;
1417 if (!(r_ptr->flags1 & RF1_UNIQUE))
1419 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1425 sprintf(tmp_val2, "(%s)", t);
1435 /* Figurines/Statues */
1439 monster_race *r_ptr = &r_info[o_ptr->pval];
1442 modstr = r_name + r_ptr->name;
1444 concptr t = r_name + r_ptr->name;
1446 if (!(r_ptr->flags1 & RF1_UNIQUE))
1448 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1465 monster_race *r_ptr = &r_info[o_ptr->pval];
1467 modstr = r_name + r_ptr->name;
1472 if (r_ptr->flags1 & RF1_UNIQUE)
1473 basenm = "& % of #";
1481 /* Missiles/ Bows/ Weapons */
1510 /* Lites (including a few "Specials") */
1516 /* Amulets (including a few "Specials") */
1519 /* Known artifacts */
1522 if (object_is_fixed_artifact(o_ptr)) break;
1523 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1526 /* Color the object */
1527 modstr = k_name + flavor_k_ptr->flavor_name;
1530 if (!flavor) basenm = "%のアミュレット";
1531 else if (aware) basenm = "%の#アミュレット";
1532 else basenm = "#アミュレット";
1534 if (!flavor) basenm = "& Amulet~ of %";
1535 else if (aware) basenm = "& # Amulet~ of %";
1536 else basenm = "& # Amulet~";
1542 /* Rings (including a few "Specials") */
1545 /* Known artifacts */
1548 if (object_is_fixed_artifact(o_ptr)) break;
1549 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1552 /* Color the object */
1553 modstr = k_name + flavor_k_ptr->flavor_name;
1556 if (!flavor) basenm = "%の指輪";
1557 else if (aware) basenm = "%の#指輪";
1558 else basenm = "#指輪";
1560 if (!flavor) basenm = "& Ring~ of %";
1561 else if (aware) basenm = "& # Ring~ of %";
1562 else basenm = "& # Ring~";
1565 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1577 /* Color the object */
1578 modstr = k_name + flavor_k_ptr->flavor_name;
1581 if (!flavor) basenm = "%の杖";
1582 else if (aware) basenm = "%の#杖";
1585 if (!flavor) basenm = "& Staff~ of %";
1586 else if (aware) basenm = "& # Staff~ of %";
1587 else basenm = "& # Staff~";
1595 /* Color the object */
1596 modstr = k_name + flavor_k_ptr->flavor_name;
1599 if (!flavor) basenm = "%の魔法棒";
1600 else if (aware) basenm = "%の#魔法棒";
1601 else basenm = "#魔法棒";
1603 if (!flavor) basenm = "& Wand~ of %";
1604 else if (aware) basenm = "& # Wand~ of %";
1605 else basenm = "& # Wand~";
1613 /* Color the object */
1614 modstr = k_name + flavor_k_ptr->flavor_name;
1617 if (!flavor) basenm = "%のロッド";
1618 else if (aware) basenm = "%の#ロッド";
1619 else basenm = "#ロッド";
1621 if (!flavor) basenm = "& Rod~ of %";
1622 else if (aware) basenm = "& # Rod~ of %";
1623 else basenm = "& # Rod~";
1631 /* Color the object */
1632 modstr = k_name + flavor_k_ptr->flavor_name;
1635 if (!flavor) basenm = "%の巻物";
1636 else if (aware) basenm = "「#」と書かれた%の巻物";
1637 else basenm = "「#」と書かれた巻物";
1639 if (!flavor) basenm = "& Scroll~ of %";
1640 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1641 else basenm = "& Scroll~ titled \"#\"";
1649 /* Color the object */
1650 modstr = k_name + flavor_k_ptr->flavor_name;
1653 if (!flavor) basenm = "%の薬";
1654 else if (aware) basenm = "%の#薬";
1657 if (!flavor) basenm = "& Potion~ of %";
1658 else if (aware) basenm = "& # Potion~ of %";
1659 else basenm = "& # Potion~";
1667 /* Ordinary food is "boring" */
1668 if (!k_ptr->flavor_name) break;
1670 /* Color the object */
1671 modstr = k_name + flavor_k_ptr->flavor_name;
1674 if (!flavor) basenm = "%のキノコ";
1675 else if (aware) basenm = "%の#キノコ";
1676 else basenm = "#キノコ";
1678 if (!flavor) basenm = "& Mushroom~ of %";
1679 else if (aware) basenm = "& # Mushroom~ of %";
1680 else basenm = "& # Mushroom~";
1688 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1698 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1699 basenm = "& Book~ of Life Magic %";
1701 basenm = "& Life Spellbook~ %";
1707 case TV_SORCERY_BOOK:
1712 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1713 basenm = "& Book~ of Sorcery %";
1715 basenm = "& Sorcery Spellbook~ %";
1721 case TV_NATURE_BOOK:
1726 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1727 basenm = "& Book~ of Nature Magic %";
1729 basenm = "& Nature Spellbook~ %";
1738 basenm = "カオスの魔法書%";
1740 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1741 basenm = "& Book~ of Chaos Magic %";
1743 basenm = "& Chaos Spellbook~ %";
1754 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1755 basenm = "& Book~ of Death Magic %";
1757 basenm = "& Death Spellbook~ %";
1766 basenm = "トランプの魔法書%";
1768 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1769 basenm = "& Book~ of Trump Magic %";
1771 basenm = "& Trump Spellbook~ %";
1777 case TV_ARCANE_BOOK:
1782 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1783 basenm = "& Book~ of Arcane Magic %";
1785 basenm = "& Arcane Spellbook~ %";
1796 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1797 basenm = "& Book~ of Craft Magic %";
1799 basenm = "& Craft Spellbook~ %";
1805 case TV_DAEMON_BOOK:
1810 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1811 basenm = "& Book~ of Daemon Magic %";
1813 basenm = "& Daemon Spellbook~ %";
1819 case TV_CRUSADE_BOOK:
1824 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1825 basenm = "& Book~ of Crusade Magic %";
1827 basenm = "& Crusade Spellbook~ %";
1835 basenm = _("歌集%", "& Song Book~ %");
1839 case TV_HISSATSU_BOOK:
1841 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1850 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1851 basenm = "& Book~ of Hex Magic %";
1853 basenm = "& Hex Spellbook~ %";
1859 /* Hack -- Gold/Gems */
1862 strcpy(buf, basenm);
1866 /* Used in the "inventory" routine */
1869 strcpy(buf, _("(なし)", "(nothing)"));
1874 /* Use full name from k_info or a_info */
1875 if (aware && have_flag(flgs, TR_FULL_NAME))
1877 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1878 else basenm = kindname;
1881 /* Start dumping the result */
1885 if (basenm[0] == '&')
1891 if (mode & OD_OMIT_PREFIX)
1895 else if (o_ptr->number > 1)
1897 t = object_desc_kosuu(t, o_ptr);
1898 t = object_desc_str(t, "の ");
1901 /* 英語の場合アーティファクトは The が付くので分かるが
1902 * 日本語では分からないのでマークをつける
1906 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1907 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1912 /* The object "expects" a "number" */
1913 if (basenm[0] == '&')
1915 /* Skip the ampersand (and space) */
1919 if (mode & OD_OMIT_PREFIX)
1924 /* Hack -- None left */
1925 else if (o_ptr->number <= 0)
1927 t = object_desc_str(t, "no more ");
1930 /* Extract the number */
1931 else if (o_ptr->number > 1)
1933 t = object_desc_num(t, o_ptr->number);
1934 t = object_desc_chr(t, ' ');
1937 /* Hack -- The only one of its kind */
1938 else if ((known && object_is_artifact(o_ptr)) ||
1939 ((o_ptr->tval == TV_CORPSE) &&
1940 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1942 t = object_desc_str(t, "The ");
1952 case '#': vowel = is_a_vowel(modstr[0]); break;
1953 case '%': vowel = is_a_vowel(*kindname); break;
1954 default: vowel = is_a_vowel(*s); break;
1959 /* A single one, with a vowel */
1960 t = object_desc_str(t, "an ");
1964 /* A single one, without a vowel */
1965 t = object_desc_str(t, "a ");
1970 /* Hack -- objects that "never" take an article */
1977 if (mode & OD_OMIT_PREFIX)
1982 /* Hack -- all gone */
1983 else if (o_ptr->number <= 0)
1985 t = object_desc_str(t, "no more ");
1988 /* Prefix a number if required */
1989 else if (o_ptr->number > 1)
1991 t = object_desc_num(t, o_ptr->number);
1992 t = object_desc_chr(t, ' ');
1995 /* Hack -- The only one of its kind */
1996 else if (known && object_is_artifact(o_ptr))
1998 t = object_desc_str(t, "The ");
2001 /* Hack -- single items get no prefix */
2009 /* Paranoia -- skip illegal tildes */
2010 /* while (*s == '~') s++; */
2013 if (object_is_smith(o_ptr))
2015 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2018 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2022 if (o_ptr->art_name)
2024 concptr temp = quark_str(o_ptr->art_name);
2026 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2027 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2028 if (strncmp(temp, "of ", 3) == 0)
2030 t = object_desc_str(t, &temp[3]);
2031 t = object_desc_str(t, "の");
2033 else if ((strncmp(temp, "『", 2) != 0) &&
2034 (strncmp(temp, "《", 2) != 0) &&
2036 t = object_desc_str(t, temp);
2039 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2041 artifact_type *a_ptr = &a_info[o_ptr->name1];
2042 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2043 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2045 t = object_desc_str(t, a_name + a_ptr->name);
2049 else if (object_is_ego(o_ptr))
2051 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2052 t = object_desc_str(t, e_name + e_ptr->name);
2057 /* Copy the string */
2058 for (s0 = NULL; *s || s0; )
2060 /* The end of the flavour/kind string. */
2067 /* Begin to append the modifier (flavor) */
2068 else if ((*s == '#') && !s0)
2073 /* Paranoia -- Never append multiple modstrs */
2077 /* Begin to append the kind name */
2078 else if ((*s == '%') && !s0)
2083 /* Paranoia -- Never append multiple kindnames */
2091 /* Add a plural if needed */
2092 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2098 /* Hack -- "Cutlass-es" and "Torch-es" */
2099 if ((k == 's') || (k == 'h')) *t++ = 'e';
2121 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2124 /* ランダムアーティファクトの名前はセーブファイルに記録
2125 されるので、英語版の名前もそれらしく変換する */
2126 if (o_ptr->art_name)
2130 strcpy(temp, quark_str(o_ptr->art_name));
2131 /* MEGA HACK by ita */
2132 if (strncmp(temp, "『", 2) == 0 ||
2133 strncmp(temp, "《", 2) == 0)
2134 t = object_desc_str(t, temp);
2135 else if (temp[0] == '\'')
2137 itemp = strlen(temp);
2138 temp[itemp - 1] = 0;
2139 t = object_desc_str(t, "『");
2140 t = object_desc_str(t, &temp[1]);
2141 t = object_desc_str(t, "』");
2144 else if (object_is_fixed_artifact(o_ptr))
2146 artifact_type *a_ptr = &a_info[o_ptr->name1];
2147 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2149 t = object_desc_str(t, a_name + a_ptr->name);
2152 else if (o_ptr->inscription)
2154 concptr str = quark_str(o_ptr->inscription);
2163 if (*str == '#') break;
2169 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2171 /* Add the false name */
2172 t = object_desc_str(t,"『");
2173 t = object_desc_str(t, &str_aux[1]);
2174 t = object_desc_str(t,"』");
2179 if (object_is_smith(o_ptr))
2181 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2184 /* Hack -- Append "Artifact" or "Special" names */
2185 if (known && !have_flag(flgs, TR_FULL_NAME))
2187 /* Is it a new random artifact ? */
2188 if (o_ptr->art_name)
2190 t = object_desc_chr(t, ' ');
2191 t = object_desc_str(t, quark_str(o_ptr->art_name));
2194 /* Grab any artifact name */
2195 else if (object_is_fixed_artifact(o_ptr))
2197 artifact_type *a_ptr = &a_info[o_ptr->name1];
2199 t = object_desc_chr(t, ' ');
2200 t = object_desc_str(t, a_name + a_ptr->name);
2203 /* Grab any ego-item name */
2206 if (object_is_ego(o_ptr))
2208 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2210 t = object_desc_chr(t, ' ');
2211 t = object_desc_str(t, e_name + e_ptr->name);
2214 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2217 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2219 /* Add the false name */
2220 t = object_desc_chr(t, ' ');
2221 t = object_desc_str(t, &str[1]);
2228 /* No more details wanted */
2229 if (mode & OD_NAME_ONLY) goto object_desc_done;
2231 /* Hack -- Chests must be described in detail */
2232 if (o_ptr->tval == TV_CHEST)
2234 /* Not searched yet */
2240 /* May be "empty" */
2241 else if (!o_ptr->pval)
2243 t = object_desc_str(t, _("(空)", " (empty)"));
2246 /* May be "disarmed" */
2247 else if (o_ptr->pval < 0)
2249 if (chest_traps[0 - o_ptr->pval])
2251 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2255 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2259 /* Describe the traps, if any */
2262 /* Describe the traps */
2263 switch (chest_traps[o_ptr->pval])
2267 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2270 case CHEST_LOSE_STR:
2272 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2275 case CHEST_LOSE_CON:
2277 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2282 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2285 case CHEST_PARALYZE:
2287 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2292 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2296 case CHEST_BIRD_STORM:
2297 case CHEST_E_SUMMON:
2298 case CHEST_H_SUMMON:
2300 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2303 case CHEST_RUNES_OF_EVIL:
2305 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2310 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2315 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2323 /* Display the item like a weapon */
2324 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2326 /* Display the item like a weapon */
2327 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2330 /* Display the item like a weapon */
2331 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2333 /* Display the item like armour */
2334 if (o_ptr->ac) show_armour = TRUE;
2337 /* Dump base weapon info */
2338 switch (o_ptr->tval)
2340 /* Missiles and Weapons */
2349 /* In Vault Quest, hide the dice of target weapon. */
2350 if(object_is_quest_target(o_ptr) && !known)
2355 /* Append a "damage" string */
2356 t = object_desc_chr(t, ' ');
2357 t = object_desc_chr(t, p1);
2358 t = object_desc_num(t, o_ptr->dd);
2359 t = object_desc_chr(t, 'd');
2360 t = object_desc_num(t, o_ptr->ds);
2361 t = object_desc_chr(t, p2);
2367 /* Bows get a special "damage string" */
2370 /* Mega-Hack -- Extract the "base power" */
2371 power = bow_tmul(o_ptr->sval);
2373 /* Apply the "Extra Might" flag */
2374 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2376 /* Append a special "damage" string */
2377 t = object_desc_chr(t, ' ');
2378 t = object_desc_chr(t, p1);
2379 t = object_desc_chr(t, 'x');
2380 t = object_desc_num(t, power);
2381 t = object_desc_chr(t, p2);
2383 fire_rate = calc_num_fire(o_ptr);
2384 /* Show Fire rate */
2385 if (fire_rate != 0 && power > 0 && known)
2387 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2389 t = object_desc_chr(t, ' ');
2390 t = object_desc_chr(t, p1);
2391 t = object_desc_num(t, fire_rate/100);
2392 t = object_desc_chr(t, '.');
2393 t = object_desc_num(t, fire_rate%100);
2394 t = object_desc_str(t, "turn");
2395 t = object_desc_chr(t, p2);
2403 /* Add the weapon bonuses */
2406 /* Show the tohit/todam on request */
2409 t = object_desc_chr(t, ' ');
2410 t = object_desc_chr(t, p1);
2411 t = object_desc_int(t, o_ptr->to_h);
2412 t = object_desc_chr(t, ',');
2413 t = object_desc_int(t, o_ptr->to_d);
2414 t = object_desc_chr(t, p2);
2417 /* Show the tohit if needed */
2418 else if (o_ptr->to_h)
2420 t = object_desc_chr(t, ' ');
2421 t = object_desc_chr(t, p1);
2422 t = object_desc_int(t, o_ptr->to_h);
2423 t = object_desc_chr(t, p2);
2426 /* Show the todam if needed */
2427 else if (o_ptr->to_d)
2429 t = object_desc_chr(t, ' ');
2430 t = object_desc_chr(t, p1);
2431 t = object_desc_int(t, o_ptr->to_d);
2432 t = object_desc_chr(t, p2);
2436 bow_ptr = &inventory[INVEN_BOW];
2438 /* If have a firing weapon + ammo matches bow */
2439 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2441 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2442 int tmul = bow_tmul(bow_ptr->sval);
2443 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2445 /* See if the bow is "known" - then set damage bonus */
2446 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2448 /* Effect of ammo */
2449 if (known) avgdam += (o_ptr->to_d * 10);
2451 /* Get extra "power" from "extra might" */
2452 if (p_ptr->xtra_might) tmul++;
2454 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2456 /* Launcher multiplier */
2458 avgdam /= (100 * 10);
2460 /* Get extra damage from concentration */
2461 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2463 if (avgdam < 0) avgdam = 0;
2465 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2466 t = object_desc_chr(t, ' ');
2467 t = object_desc_chr(t, p1);
2469 if(show_ammo_no_crit)
2471 /* Damage with no-crit */
2472 t = object_desc_num(t, avgdam);
2473 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2476 /* Apply Expect damage of Critical */
2477 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2478 t = object_desc_num(t, avgdam);
2480 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2481 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2483 if (p_ptr->num_fire == 0)
2485 t = object_desc_chr(t, '0');
2489 /* Calc effects of energy */
2490 avgdam *= (p_ptr->num_fire * 100);
2491 avgdam /= energy_fire;
2492 t = object_desc_num(t, avgdam);
2493 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2495 if(show_ammo_crit_ratio)
2497 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2499 t = object_desc_chr(t, '/');
2500 t = object_desc_num(t, percent / 100);
2501 t = object_desc_chr(t, '.');
2502 if(percent % 100 < 10)
2504 t = object_desc_chr(t, '0');
2506 t = object_desc_num(t, percent % 100);
2507 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2511 t = object_desc_chr(t, p2);
2513 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2515 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2516 s16b energy_fire = 100 - p_ptr->lev;
2518 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2520 /* Display (shot damage/ avg damage) */
2521 t = object_desc_chr(t, ' ');
2522 t = object_desc_chr(t, p1);
2523 t = object_desc_num(t, avgdam);
2524 t = object_desc_chr(t, '/');
2526 /* Calc effects of energy */
2527 avgdam = 100 * avgdam / energy_fire;
2529 t = object_desc_num(t, avgdam);
2530 t = object_desc_chr(t, p2);
2533 /* Add the armor bonuses */
2536 /* Show the armor class info */
2539 t = object_desc_chr(t, ' ');
2540 t = object_desc_chr(t, b1);
2541 t = object_desc_num(t, o_ptr->ac);
2542 t = object_desc_chr(t, ',');
2543 t = object_desc_int(t, o_ptr->to_a);
2544 t = object_desc_chr(t, b2);
2547 /* No base armor, but does increase armor */
2548 else if (o_ptr->to_a)
2550 t = object_desc_chr(t, ' ');
2551 t = object_desc_chr(t, b1);
2552 t = object_desc_int(t, o_ptr->to_a);
2553 t = object_desc_chr(t, b2);
2557 /* Hack -- always show base armor */
2558 else if (show_armour)
2560 t = object_desc_chr(t, ' ');
2561 t = object_desc_chr(t, b1);
2562 t = object_desc_num(t, o_ptr->ac);
2563 t = object_desc_chr(t, b2);
2567 /* No more details wanted */
2568 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2571 if (known) /* Known item only */
2574 * Hack -- Wands and Staffs have charges. Make certain how many charges
2575 * a stack of staffs really has is clear. -LM-
2577 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2579 /* Dump " (N charges)" */
2580 t = object_desc_chr(t, ' ');
2581 t = object_desc_chr(t, p1);
2583 /* Clear explaination for staffs. */
2584 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2586 t = object_desc_num(t, o_ptr->number);
2587 t = object_desc_str(t, "x ");
2589 t = object_desc_num(t, o_ptr->pval);
2591 t = object_desc_str(t, "回分");
2593 t = object_desc_str(t, " charge");
2594 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2597 t = object_desc_chr(t, p2);
2599 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2600 * be in any state of charge or discharge, this now includes a number. -LM-
2602 else if (o_ptr->tval == TV_ROD)
2604 /* Hack -- Dump " (# charging)" if relevant */
2607 /* Stacks of rods display an exact count of charging rods. */
2608 if (o_ptr->number > 1)
2611 if (k_ptr->pval == 0) k_ptr->pval = 1;
2613 /* Find out how many rods are charging, by dividing
2614 * current timeout by each rod's maximum timeout.
2615 * Ensure that any remainder is rounded up. Display
2616 * very discharged stacks as merely fully discharged.
2618 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2619 if (power > o_ptr->number) power = o_ptr->number;
2621 /* Display prettily. */
2622 t = object_desc_str(t, " (");
2623 t = object_desc_num(t, power);
2624 t = object_desc_str(t, _("本 充填中)", " charging)"));
2627 /* "one Rod of Perception (1 charging)" would look tacky. */
2630 t = object_desc_str(t, _("(充填中)", " (charging)"));
2635 /* Dump "pval" flags for wearable items */
2636 if (have_pval_flags(flgs))
2638 /* Start the display */
2639 t = object_desc_chr(t, ' ');
2640 t = object_desc_chr(t, p1);
2642 /* Dump the "pval" itself */
2643 t = object_desc_int(t, o_ptr->pval);
2645 /* Do not display the "pval" flags */
2646 if (have_flag(flgs, TR_HIDE_TYPE))
2652 else if (have_flag(flgs, TR_SPEED))
2654 /* Dump " to speed" */
2655 t = object_desc_str(t, _("加速", " to speed"));
2659 else if (have_flag(flgs, TR_BLOWS))
2663 t = object_desc_str(t, "攻撃");
2665 t = object_desc_str(t, " attack");
2668 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2673 else if (have_flag(flgs, TR_STEALTH))
2675 /* Dump " to stealth" */
2676 t = object_desc_str(t, _("隠密", " to stealth"));
2680 else if (have_flag(flgs, TR_SEARCH))
2682 /* Dump " to searching" */
2683 t = object_desc_str(t, _("探索", " to searching"));
2687 else if (have_flag(flgs, TR_INFRA))
2689 /* Dump " to infravision" */
2690 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2693 /* Finish the display */
2694 t = object_desc_chr(t, p2);
2697 /* Hack -- Process Lanterns/Torches */
2698 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2700 /* Hack -- Turns of light for normal lites */
2702 t = object_desc_chr(t, '(');
2704 t = object_desc_str(t, " (with ");
2707 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2708 else t = object_desc_num(t, o_ptr->xtra4);
2709 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2712 /* Indicate charging objects, but not rods. */
2713 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2715 /* Hack -- Dump " (charging)" if relevant */
2716 t = object_desc_str(t, _("(充填中)", " (charging)"));
2721 /* No more details wanted */
2722 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2725 /* Prepare real inscriptions in a buffer */
2728 /* Auto abbreviation inscribe */
2729 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2731 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2742 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2746 /* Use the standard inscription if available */
2747 if (o_ptr->inscription)
2751 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2753 /* Get inscription and convert {%} */
2754 get_inscription(buff, o_ptr);
2756 /* strcat with correct treating of kanji */
2757 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2761 /* No fake inscription yet */
2762 fake_insc_buf[0] = '\0';
2764 /* Use the game-generated "feeling" otherwise, if available */
2767 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2770 /* Note "cursed" if the item is known to be cursed */
2771 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2773 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2776 /* Note "unidentified" if the item is unidentified */
2777 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2778 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2780 && !(o_ptr->ident & IDENT_SENSE))
2782 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2785 /* Mega-Hack -- note empty wands/staffs */
2786 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2788 strcpy(fake_insc_buf, _("空", "empty"));
2791 /* Note "tried" if the object has been tested unsuccessfully */
2792 else if (!aware && object_is_tried(o_ptr))
2794 strcpy(fake_insc_buf, _("未判明", "tried"));
2797 /* Note the discount, if any */
2798 if (o_ptr->discount)
2800 /* Hidden by real inscription unless in a store */
2801 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2803 char discount_num_buf[4];
2805 /* Append to other fake inscriptions if any */
2806 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2808 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2809 strcat(fake_insc_buf, discount_num_buf);
2810 strcat(fake_insc_buf, _("%引き", "% off"));
2815 /* Append the inscription, if any */
2816 if (fake_insc_buf[0] || tmp_val2[0])
2818 /* Append the inscription */
2819 t = object_desc_chr(t, ' ');
2820 t = object_desc_chr(t, c1);
2822 /* Append fake inscriptions */
2823 if (fake_insc_buf[0])
2825 t = object_desc_str(t, fake_insc_buf);
2828 /* Append a separater */
2829 if (fake_insc_buf[0] && tmp_val2[0])
2831 t = object_desc_chr(t, ',');
2832 t = object_desc_chr(t, ' ');
2835 /* Append real inscriptions */
2838 t = object_desc_str(t, tmp_val2);
2841 t = object_desc_chr(t, c2);
2845 my_strcpy(buf, tmp_val, MAX_NLEN);