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"
20 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
22 * @return 簡易名称を明らかにするならTRUEを返す。
24 * This function is used only by "flavor_init()"
26 static bool object_easy_know(int i)
28 object_kind *k_ptr = &k_info[i];
30 /* Analyze the "tval" */
45 case TV_HISSATSU_BOOK:
62 /* All Food, Potions, Scrolls, Rods */
76 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
77 * @param out_string 作成した名を保管する参照ポインタ
79 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
80 * syllables 配列と elvish.txt を組み合わせる。\n
82 void get_table_name_aux(char *out_string)
86 get_rnd_line("aname_j.txt", 1, Syllable);
87 strcpy(out_string, Syllable);
88 get_rnd_line("aname_j.txt", 2, Syllable);
89 strcat(out_string, Syllable);
91 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
93 static concptr syllables[MAX_SYLLABLES] = {
94 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
95 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
96 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
97 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
98 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
99 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
100 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
101 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
102 "kho", "kli", "klis", "la", "lech", "man", "mar",
103 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
104 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
105 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
106 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
107 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
108 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
109 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
110 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
111 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
112 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
113 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
117 int testcounter = randint1(3) + 1;
119 strcpy(out_string, "");
121 if (randint1(3) == 2)
123 while (testcounter--)
124 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
129 testcounter = randint1(2) + 1;
130 while (testcounter--)
132 (void)get_rnd_line("elvish.txt", 0, Syllable);
133 strcat(out_string, Syllable);
137 out_string[0] = toupper(out_string[1]);
139 out_string[16] = '\0';
144 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
145 * @param out_string 作成した名を保管する参照ポインタ
147 * @details get_table_name_aux()ほぼ完全に実装を依存している。
149 void get_table_name(char *out_string)
152 get_table_name_aux(buff);
153 sprintf(out_string, _("『%s』", "'%s'"), buff);
157 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
158 * @param out_string 作成した名を保管する参照ポインタ
160 * @details sname.txtが語幹の辞書となっている。
162 void get_table_sindarin_aux(char *out_string)
169 get_rnd_line("sname.txt", 1, Syllable);
171 strcpy(tmp, Syllable);
173 strcpy(out_string, Syllable);
176 get_rnd_line("sname.txt", 2, Syllable);
178 strcat(tmp, Syllable);
179 sindarin_to_kana(out_string, tmp);
181 strcat(out_string, Syllable);
186 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
187 * @param out_string 作成した名を保管する参照ポインタ
189 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
191 void get_table_sindarin(char *out_string)
194 get_table_sindarin_aux(buff);
195 sprintf(out_string, _("『%s』", "'%s'"), buff);
200 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
201 * @param tval シャッフルしたいtval
203 * @details 巻物、各種魔道具などに利用される。
205 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
207 KIND_OBJECT_IDX *k_idx_list;
208 KIND_OBJECT_IDX k_idx_list_num = 0;
211 /* Allocate an array for a list of k_idx */
212 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
214 /* Search objects with given tval for shuffle */
215 for (i = 0; i < max_k_idx; i++)
217 object_kind *k_ptr = &k_info[i];
220 if (k_ptr->tval != tval) continue;
222 /* Paranoia -- Skip objects without flavor */
223 if (!k_ptr->flavor) continue;
225 /* Skip objects with a fixed flavor name */
226 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
229 k_idx_list[k_idx_list_num] = i;
231 /* Increase number of remembered indices */
235 /* Shuffle flavors */
236 for (i = 0; i < k_idx_list_num; i++)
238 object_kind *k1_ptr = &k_info[k_idx_list[i]];
239 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
241 /* Swap flavors of this pair */
242 s16b tmp = k1_ptr->flavor;
243 k1_ptr->flavor = k2_ptr->flavor;
244 k2_ptr->flavor = tmp;
247 /* Free an array for a list of k_idx */
248 C_KILL(k_idx_list, max_k_idx, s16b);
252 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
255 * Prepare the "variable" part of the "k_info" array.\n
257 * The "color"/"metal"/"type" of an item is its "flavor".\n
258 * For the most part, flavors are assigned randomly each game.\n
260 * Initialize descriptions for the "colored" objects, including:\n
261 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
263 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
264 * Slime Mold Juice, Unused Potion).\n
266 * Scroll titles are always between 6 and 14 letters long. This is\n
267 * ensured because every title is composed of whole words, where every\n
268 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
269 * letters each), and that no scroll is finished until it attempts to\n
270 * grow beyond 15 letters. The first time this can happen is when the\n
271 * current title has 6 letters and the new word has 8 letters, which\n
272 * would result in a 6 letter scroll title.\n
274 * Duplicate titles are avoided by requiring that no two scrolls share\n
275 * the same first four letters (not the most efficient method, and not\n
276 * the least efficient method, but it will always work).\n
278 * Hack -- make sure everything stays the same for each saved game\n
279 * This is accomplished by the use of a saved "random seed", as in\n
280 * "town_gen()". Since no other functions are called while the special\n
281 * seed is in effect, so this function is pretty "safe".\n
283 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
285 void flavor_init(void)
288 u32b state_backup[4];
290 /* Hack -- Backup the RNG state */
291 Rand_state_backup(state_backup);
293 /* Hack -- Induce consistant flavors */
294 Rand_state_set(seed_flavor);
297 /* Initialize flavor index of each object by itself */
298 for (i = 0; i < max_k_idx; i++)
300 object_kind *k_ptr = &k_info[i];
302 /* Skip objects without flavor name */
303 if (!k_ptr->flavor_name) continue;
306 * Initialize flavor index to itself
307 * -> Shuffle it later
313 shuffle_flavors(TV_RING);
315 /* Shuffle Amulets */
316 shuffle_flavors(TV_AMULET);
319 shuffle_flavors(TV_STAFF);
322 shuffle_flavors(TV_WAND);
325 shuffle_flavors(TV_ROD);
327 /* Shuffle Mushrooms */
328 shuffle_flavors(TV_FOOD);
330 /* Shuffle Potions */
331 shuffle_flavors(TV_POTION);
333 /* Shuffle Scrolls */
334 shuffle_flavors(TV_SCROLL);
337 /* Hack -- Restore the RNG state */
338 Rand_state_restore(state_backup);
340 /* Analyze every object */
341 for (i = 1; i < max_k_idx; i++)
343 object_kind *k_ptr = &k_info[i];
345 /* Skip "empty" objects */
346 if (!k_ptr->name) continue;
348 /* No flavor yields aware */
349 if (!k_ptr->flavor) k_ptr->aware = TRUE;
351 /* Check for "easily known" */
352 k_ptr->easy_know = object_easy_know(i);
358 * @brief 対象文字配列に一文字だけをコピーする。
359 * @param t 保管先文字列ポインタ
363 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
364 * and return a pointer to the terminator (t + 1).\n
366 static char *object_desc_chr(char *t, char c)
377 * @brief 対象文字配列に文字列をコピーする。
378 * @param t 保管先文字列ポインタ
379 * @param s コピーしたい文字列ポインタ
382 * Print a string "s" into a string "t", as if by strcpy(t, s),
383 * and return a pointer to the terminator.
385 static char *object_desc_str(char *t, concptr s)
387 /* Copy the string */
388 while (*s) *t++ = *s++;
396 * @brief 対象文字配列に符号なし整数値をコピーする。
397 * @param t 保管先文字列ポインタ
401 * Print an unsigned number "n" into a string "t", as if by
402 * sprintf(t, "%u", n), and return a pointer to the terminator.
404 static char *object_desc_num(char *t, uint n)
408 /* Find "size" of "n" */
409 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
411 /* Dump each digit */
417 /* Remove the digit */
420 /* Process next digit */
434 * @brief 日本語の個数表示ルーチン
435 * @param t 保管先文字列ポインタ
436 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
439 * cmd1.c で流用するために object_desc_japanese から移動した。
441 char *object_desc_kosuu(char *t, object_type *o_ptr)
443 t = object_desc_num(t, o_ptr->number);
455 t = object_desc_str(t, "本");
460 t = object_desc_str(t, "巻");
465 t = object_desc_str(t, "服");
469 case TV_SORCERY_BOOK:
477 case TV_CRUSADE_BOOK:
479 case TV_HISSATSU_BOOK:
482 t = object_desc_str(t, "冊");
490 t = object_desc_str(t, "着");
497 t = object_desc_str(t, "振");
502 t = object_desc_str(t, "足");
507 t = object_desc_str(t, "枚");
513 if(o_ptr->sval == SV_FOOD_JERKY)
515 t = object_desc_str(t, "切れ");
521 if (o_ptr->number < 10)
523 t = object_desc_str(t, "つ");
527 t = object_desc_str(t, "個");
537 * @brief 対象文字配列に符号あり整数値をコピーする。
538 * @param t 保管先文字列ポインタ
542 * Print an signed number "v" into a string "t", as if by
543 * sprintf(t, "%+d", n), and return a pointer to the terminator.
544 * Note that we always print a sign, either "+" or "-".
546 static char *object_desc_int(char *t, sint v)
553 /* Take the absolute value */
556 /* Use a "minus" sign */
560 /* Positive (or zero) */
563 /* Use the actual number */
566 /* Use a "plus" sign */
570 /* Find "size" of "n" */
571 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
573 /* Dump each digit */
579 /* Remove the digit */
582 /* Process next digit */
593 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
595 typedef struct flag_insc_table
606 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
607 static flag_insc_table flag_insc_plus[] =
609 { "攻", "At", TR_BLOWS, -1 },
610 { "速", "Sp", TR_SPEED, -1 },
611 { "腕", "St", TR_STR, -1 },
612 { "知", "In", TR_INT, -1 },
613 { "賢", "Wi", TR_WIS, -1 },
614 { "器", "Dx", TR_DEX, -1 },
615 { "耐", "Cn", TR_CON, -1 },
616 { "魅", "Ch", TR_CHR, -1 },
617 { "道", "Md", TR_MAGIC_MASTERY, -1 },
618 { "隠", "Sl", TR_STEALTH, -1 },
619 { "探", "Sr", TR_SEARCH, -1 },
620 { "赤", "If", TR_INFRA, -1 },
621 { "掘", "Dg", TR_TUNNEL, -1 },
622 { NULL, NULL, 0, -1 }
625 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
626 static flag_insc_table flag_insc_immune[] =
628 { "酸", "Ac", TR_IM_ACID, -1 },
629 { "電", "El", TR_IM_ELEC, -1 },
630 { "火", "Fi", TR_IM_FIRE, -1 },
631 { "冷", "Co", TR_IM_COLD, -1 },
632 { NULL, NULL, 0, -1 }
635 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
636 static flag_insc_table flag_insc_resistance[] =
638 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
639 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
640 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
641 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
642 { "毒", "Po", TR_RES_POIS, -1 },
643 { "閃", "Li", TR_RES_LITE, -1 },
644 { "暗", "Dk", TR_RES_DARK, -1 },
645 { "破", "Sh", TR_RES_SHARDS, -1 },
646 { "盲", "Bl", TR_RES_BLIND, -1 },
647 { "乱", "Cf", TR_RES_CONF, -1 },
648 { "轟", "So", TR_RES_SOUND, -1 },
649 { "獄", "Nt", TR_RES_NETHER, -1 },
650 { "因", "Nx", TR_RES_NEXUS, -1 },
651 { "沌", "Ca", TR_RES_CHAOS, -1 },
652 { "劣", "Di", TR_RES_DISEN, -1 },
653 { "恐", "Fe", TR_RES_FEAR, -1 },
654 { NULL, NULL, 0, -1 }
657 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
658 static flag_insc_table flag_insc_misc[] =
660 { "易", "Es", TR_EASY_SPELL, -1 },
661 { "減", "Dm", TR_DEC_MANA, -1 },
662 { "投", "Th", TR_THROW, -1 },
663 { "反", "Rf", TR_REFLECT, -1 },
664 { "麻", "Fa", TR_FREE_ACT, -1 },
665 { "視", "Si", TR_SEE_INVIS, -1 },
666 { "経", "Hl", TR_HOLD_EXP, -1 },
667 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
668 { "活", "Rg", TR_REGEN, -1 },
669 { "浮", "Lv", TR_LEVITATION, -1 },
670 { "明", "Lu", TR_LITE_1, -1 },
671 { "明", "Lu", TR_LITE_2, -1 },
672 { "明", "Lu", TR_LITE_3, -1 },
673 { "闇", "Dl", TR_LITE_M1, -1 },
674 { "闇", "Dl", TR_LITE_M2, -1 },
675 { "闇", "Dl", TR_LITE_M3, -1 },
676 { "警", "Wr", TR_WARNING, -1 },
677 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
678 { "射", "Xs", TR_XTRA_SHOTS, -1 },
679 { "瞬", "Te", TR_TELEPORT, -1 },
680 { "怒", "Ag", TR_AGGRAVATE, -1 },
681 { "祝", "Bs", TR_BLESSED, -1 },
682 { "忌", "Ty", TR_TY_CURSE, -1 },
683 { "呪", "C-", TR_ADD_L_CURSE, -1 },
684 { "詛", "C+", TR_ADD_H_CURSE, -1 },
685 { NULL, NULL, 0, -1 }
688 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
689 static flag_insc_table flag_insc_aura[] =
691 { "炎", "F", TR_SH_FIRE, -1 },
692 { "電", "E", TR_SH_ELEC, -1 },
693 { "冷", "C", TR_SH_COLD, -1 },
694 { "魔", "M", TR_NO_MAGIC, -1 },
695 { "瞬", "T", TR_NO_TELE, -1 },
696 { NULL, NULL, 0, -1 }
699 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
700 static flag_insc_table flag_insc_brand[] =
702 { "酸", "A", TR_BRAND_ACID, -1 },
703 { "電", "E", TR_BRAND_ELEC, -1 },
704 { "焼", "F", TR_BRAND_FIRE, -1 },
705 { "凍", "Co", TR_BRAND_COLD, -1 },
706 { "毒", "P", TR_BRAND_POIS, -1 },
707 { "沌", "Ca", TR_CHAOTIC, -1 },
708 { "吸", "V", TR_VAMPIRIC, -1 },
709 { "震", "Q", TR_IMPACT, -1 },
710 { "切", "S", TR_VORPAL, -1 },
711 { "理", "M", TR_FORCE_WEAPON, -1 },
712 { NULL, NULL, 0, -1 }
715 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
716 static flag_insc_table flag_insc_kill[] =
718 { "邪", "*", TR_KILL_EVIL, -1 },
719 { "人", "p", TR_KILL_HUMAN, -1 },
720 { "龍", "D", TR_KILL_DRAGON, -1 },
721 { "オ", "o", TR_KILL_ORC, -1 },
722 { "ト", "T", TR_KILL_TROLL, -1 },
723 { "巨", "P", TR_KILL_GIANT, -1 },
724 { "デ", "U", TR_KILL_DEMON, -1 },
725 { "死", "L", TR_KILL_UNDEAD, -1 },
726 { "動", "Z", TR_KILL_ANIMAL, -1 },
727 { NULL, NULL, 0, -1 }
730 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
731 static flag_insc_table flag_insc_slay[] =
733 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
734 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
735 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
736 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
737 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
738 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
739 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
740 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
741 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
742 { NULL, NULL, 0, -1 }
745 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
746 static flag_insc_table flag_insc_esp1[] =
748 { "感", "Tele", TR_TELEPATHY, -1 },
749 { "邪", "Evil", TR_ESP_EVIL, -1 },
750 { "善", "Good", TR_ESP_GOOD, -1 },
751 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
752 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
753 { NULL, NULL, 0, -1 }
756 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
757 static flag_insc_table flag_insc_esp2[] =
759 { "人", "p", TR_ESP_HUMAN, -1 },
760 { "竜", "D", TR_ESP_DRAGON, -1 },
761 { "オ", "o", TR_ESP_ORC, -1 },
762 { "ト", "T", TR_ESP_TROLL, -1 },
763 { "巨", "P", TR_ESP_GIANT, -1 },
764 { "デ", "U", TR_ESP_DEMON, -1 },
765 { "死", "L", TR_ESP_UNDEAD, -1 },
766 { "動", "Z", TR_ESP_ANIMAL, -1 },
767 { NULL, NULL, 0, -1 }
770 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
771 static flag_insc_table flag_insc_sust[] =
773 { "腕", "St", TR_SUST_STR, -1 },
774 { "知", "In", TR_SUST_INT, -1 },
775 { "賢", "Wi", TR_SUST_WIS, -1 },
776 { "器", "Dx", TR_SUST_DEX, -1 },
777 { "耐", "Cn", TR_SUST_CON, -1 },
778 { "魅", "Ch", TR_SUST_CHR, -1 },
779 { NULL, NULL, 0, -1 }
783 static flag_insc_table flag_insc_plus[] =
785 { "At", TR_BLOWS, -1 },
786 { "Sp", TR_SPEED, -1 },
787 { "St", TR_STR, -1 },
788 { "In", TR_INT, -1 },
789 { "Wi", TR_WIS, -1 },
790 { "Dx", TR_DEX, -1 },
791 { "Cn", TR_CON, -1 },
792 { "Ch", TR_CHR, -1 },
793 { "Md", TR_MAGIC_MASTERY, -1 },
794 { "Sl", TR_STEALTH, -1 },
795 { "Sr", TR_SEARCH, -1 },
796 { "If", TR_INFRA, -1 },
797 { "Dg", TR_TUNNEL, -1 },
801 static flag_insc_table flag_insc_immune[] =
803 { "Ac", TR_IM_ACID, -1 },
804 { "El", TR_IM_ELEC, -1 },
805 { "Fi", TR_IM_FIRE, -1 },
806 { "Co", TR_IM_COLD, -1 },
810 static flag_insc_table flag_insc_resistance[] =
812 { "Ac", TR_RES_ACID, TR_IM_ACID },
813 { "El", TR_RES_ELEC, TR_IM_ELEC },
814 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
815 { "Co", TR_RES_COLD, TR_IM_COLD },
816 { "Po", TR_RES_POIS, -1 },
817 { "Li", TR_RES_LITE, -1 },
818 { "Dk", TR_RES_DARK, -1 },
819 { "Sh", TR_RES_SHARDS, -1 },
820 { "Bl", TR_RES_BLIND, -1 },
821 { "Cf", TR_RES_CONF, -1 },
822 { "So", TR_RES_SOUND, -1 },
823 { "Nt", TR_RES_NETHER, -1 },
824 { "Nx", TR_RES_NEXUS, -1 },
825 { "Ca", TR_RES_CHAOS, -1 },
826 { "Di", TR_RES_DISEN, -1 },
827 { "Fe", TR_RES_FEAR, -1 },
831 static flag_insc_table flag_insc_misc[] =
833 { "Es", TR_EASY_SPELL, -1 },
834 { "Dm", TR_DEC_MANA, -1 },
835 { "Th", TR_THROW, -1 },
836 { "Rf", TR_REFLECT, -1 },
837 { "Fa", TR_FREE_ACT, -1 },
838 { "Si", TR_SEE_INVIS, -1 },
839 { "Hl", TR_HOLD_EXP, -1 },
840 { "Sd", TR_SLOW_DIGEST, -1 },
841 { "Rg", TR_REGEN, -1 },
842 { "Lv", TR_LEVITATION, -1 },
843 { "Lu", TR_LITE_1, -1 },
844 { "Lu", TR_LITE_2, -1 },
845 { "Lu", TR_LITE_3, -1 },
846 { "Dl", TR_LITE_M1, -1 },
847 { "Dl", TR_LITE_M2, -1 },
848 { "Dl", TR_LITE_M3, -1 },
849 { "Wr", TR_WARNING, -1 },
850 { "Xm", TR_XTRA_MIGHT, -1 },
851 { "Xs", TR_XTRA_SHOTS, -1 },
852 { "Te", TR_TELEPORT, -1 },
853 { "Ag", TR_AGGRAVATE, -1 },
854 { "Bs", TR_BLESSED, -1 },
855 { "Ty", TR_TY_CURSE, -1 },
856 { "C-", TR_ADD_L_CURSE, -1 },
857 { "C+", TR_ADD_H_CURSE, -1 },
861 static flag_insc_table flag_insc_aura[] =
863 { "F", TR_SH_FIRE, -1 },
864 { "E", TR_SH_ELEC, -1 },
865 { "C", TR_SH_COLD, -1 },
866 { "M", TR_NO_MAGIC, -1 },
867 { "T", TR_NO_TELE, -1 },
871 static flag_insc_table flag_insc_brand[] =
873 { "A", TR_BRAND_ACID, -1 },
874 { "E", TR_BRAND_ELEC, -1 },
875 { "F", TR_BRAND_FIRE, -1 },
876 { "Co", TR_BRAND_COLD, -1 },
877 { "P", TR_BRAND_POIS, -1 },
878 { "Ca", TR_CHAOTIC, -1 },
879 { "V", TR_VAMPIRIC, -1 },
880 { "Q", TR_IMPACT, -1 },
881 { "S", TR_VORPAL, -1 },
882 { "M", TR_FORCE_WEAPON, -1 },
886 static flag_insc_table flag_insc_kill[] =
888 { "*", TR_KILL_EVIL, -1 },
889 { "p", TR_KILL_HUMAN, -1 },
890 { "D", TR_KILL_DRAGON, -1 },
891 { "o", TR_KILL_ORC, -1 },
892 { "T", TR_KILL_TROLL, -1 },
893 { "P", TR_KILL_GIANT, -1 },
894 { "U", TR_KILL_DEMON, -1 },
895 { "L", TR_KILL_UNDEAD, -1 },
896 { "Z", TR_KILL_ANIMAL, -1 },
900 static flag_insc_table flag_insc_slay[] =
902 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
903 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
904 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
905 { "o", TR_SLAY_ORC, TR_KILL_ORC },
906 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
907 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
908 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
909 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
910 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
914 static flag_insc_table flag_insc_esp1[] =
916 { "Tele", TR_TELEPATHY, -1 },
917 { "Evil", TR_ESP_EVIL, -1 },
918 { "Good", TR_ESP_GOOD, -1 },
919 { "Nolv", TR_ESP_NONLIVING, -1 },
920 { "Uniq", TR_ESP_UNIQUE, -1 },
924 static flag_insc_table flag_insc_esp2[] =
926 { "p", TR_ESP_HUMAN, -1 },
927 { "D", TR_ESP_DRAGON, -1 },
928 { "o", TR_ESP_ORC, -1 },
929 { "T", TR_ESP_TROLL, -1 },
930 { "P", TR_ESP_GIANT, -1 },
931 { "U", TR_ESP_DEMON, -1 },
932 { "L", TR_ESP_UNDEAD, -1 },
933 { "Z", TR_ESP_ANIMAL, -1 },
937 static flag_insc_table flag_insc_sust[] =
939 { "St", TR_SUST_STR, -1 },
940 { "In", TR_SUST_INT, -1 },
941 { "Wi", TR_SUST_WIS, -1 },
942 { "Dx", TR_SUST_DEX, -1 },
943 { "Cn", TR_SUST_CON, -1 },
944 { "Ch", TR_SUST_CHR, -1 },
949 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
950 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
953 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
954 * @param fi_ptr 参照する特性表示記号テーブル
955 * @param flgs 対応するオブジェクトのフラグ文字列
956 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
957 * @param ptr フラグ群を保管する文字列参照ポインタ
958 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
960 * Print an signed number "v" into a string "t", as if by
961 * sprintf(t, "%+d", n), and return a pointer to the terminator.
962 * Note that we always print a sign, either "+" or "-".
964 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
970 while (fi_ptr->english)
972 if (have_flag(flgs, fi_ptr->flag) &&
973 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
975 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
977 ADD_INSC(fi_ptr->english);
987 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
988 * @param fi_ptr 参照する特性表示記号テーブル
989 * @param flgs 対応するオブジェクトのフラグ文字列
990 * @return 1つでも該当の特性があったらTRUEを返す。
992 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
994 while (fi_ptr->english)
996 if (have_flag(flgs, fi_ptr->flag) &&
997 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1006 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1007 * @param ptr 特性短縮表記を格納する文字列ポインタ
1008 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1009 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1010 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1011 * @return ptrと同じアドレス
1013 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1015 char *prev_ptr = ptr;
1016 BIT_FLAGS flgs[TR_FLAG_SIZE];
1017 object_flags(o_ptr, flgs);
1019 /* Remove obvious flags */
1022 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1026 for (j = 0; j < TR_FLAG_SIZE; j++)
1027 flgs[j] &= ~k_ptr->flags[j];
1029 if (object_is_fixed_artifact(o_ptr))
1031 artifact_type *a_ptr = &a_info[o_ptr->name1];
1033 for (j = 0; j < TR_FLAG_SIZE; j++)
1034 flgs[j] &= ~a_ptr->flags[j];
1037 if (object_is_ego(o_ptr))
1039 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1041 for (j = 0; j < TR_FLAG_SIZE; j++)
1042 flgs[j] &= ~e_ptr->flags[j];
1046 /* Remove lite flags when this is a dark lite object */
1047 if (have_dark_flag(flgs))
1049 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1050 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1051 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1053 else if (have_lite_flag(flgs))
1055 add_flag(flgs, TR_LITE_1);
1056 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1057 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1061 if (have_flag_of(flag_insc_plus, flgs))
1066 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1069 if (have_flag_of(flag_insc_immune, flgs))
1071 if (!kanji && ptr != prev_ptr)
1078 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1081 if (have_flag_of(flag_insc_resistance, flgs))
1085 else if (ptr != prev_ptr)
1091 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1094 if (have_flag_of(flag_insc_misc, flgs))
1096 if (ptr != prev_ptr)
1102 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1105 if (have_flag_of(flag_insc_aura, flgs))
1109 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1112 if (have_flag_of(flag_insc_brand, flgs))
1114 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1117 if (have_flag_of(flag_insc_kill, flgs))
1119 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1122 if (have_flag_of(flag_insc_slay, flgs))
1124 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1129 if (have_flag_of(flag_insc_esp1, flgs) ||
1130 have_flag_of(flag_insc_esp2, flgs))
1132 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1133 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1137 if (have_flag_of(flag_insc_esp1, flgs))
1139 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1140 if (have_flag_of(flag_insc_esp2, flgs))
1142 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1146 if (have_flag_of(flag_insc_sust, flgs))
1150 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1159 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1160 * @param buff 特性短縮表記を格納する文字列ポインタ
1161 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1164 static void get_inscription(char *buff, object_type *o_ptr)
1166 concptr insc = quark_str(o_ptr->inscription);
1169 /* Not fully identified */
1170 if (!(o_ptr->ident & IDENT_MENTAL))
1172 /* Copy until end of line or '#' */
1175 if (*insc == '#') break;
1177 if (iskanji(*insc)) *buff++ = *insc++;
1187 for (; *insc; insc++)
1189 /* Ignore fake artifact inscription */
1190 if (*insc == '#') break;
1192 /* {%} will be automatically converted */
1193 else if ('%' == *insc)
1197 concptr start = ptr;
1199 /* check for too long inscription */
1200 if (ptr >= buff + MAX_NLEN) continue;
1213 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1223 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1238 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1239 * @param buf 表記を返すための文字列参照ポインタ
1240 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1241 * @param mode 表記に関するオプション指定
1242 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1244 * One can choose the "verbosity" of the description, including whether\n
1245 * or not the "number" of items should be described, and how much detail\n
1246 * should be used when describing the item.\n
1248 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1249 * description, which can get pretty long, including incriptions, such as:\n
1250 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1251 * Note that the inscription will be clipped to keep the total description\n
1252 * under MAX_NLEN-1 chars (plus a terminator).\n
1254 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1255 * portable, versions of some common "sprintf()" commands.\n
1257 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1258 * the item is also an artifact, which should NEVER happen.\n
1260 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1261 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1262 * The "Specials" never use "modifiers" if they are "known", since they\n
1263 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1265 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1266 * plus the artifact name, just like any other artifact, if known.\n
1268 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1269 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1270 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1271 * they will append the artifact name, just like any artifact, if known.\n
1273 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1276 * OD_NAME_ONLY : The Cloak of Death\n
1277 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1278 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1279 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1281 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1282 * OD_NO_PLURAL : Forbidden use of plural \n
1283 * OD_STORE : Assume to be aware and known\n
1284 * OD_NO_FLAVOR : Allow to hidden flavor\n
1285 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1287 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1289 /* Extract object kind name */
1290 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1292 /* Extract default "base" string */
1293 concptr basenm = kindname;
1295 /* Assume no "modifier" string */
1296 concptr modstr = "";
1305 bool show_weapon = FALSE;
1306 bool show_armour = FALSE;
1311 char p1 = '(', p2 = ')';
1312 char b1 = '[', b2 = ']';
1313 char c1 = '{', c2 = '}';
1315 char tmp_val[MAX_NLEN+160];
1316 char tmp_val2[MAX_NLEN+10];
1317 char fake_insc_buf[30];
1319 BIT_FLAGS flgs[TR_FLAG_SIZE];
1321 object_type *bow_ptr;
1323 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1324 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1326 /* Extract some flags */
1327 object_flags(o_ptr, flgs);
1329 /* See if the object is "aware" */
1330 if (object_is_aware(o_ptr)) aware = TRUE;
1332 /* See if the object is "known" */
1333 if (object_is_known(o_ptr)) known = TRUE;
1335 /* Allow flavors to be hidden when aware */
1336 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1338 /* Object is in the inventory of a store or spoiler */
1339 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1341 /* Don't show flavors */
1344 /* Pretend known and aware */
1349 /* Force to be flavor name only */
1350 if (mode & OD_FORCE_FLAVOR)
1356 /* Cancel shuffling */
1357 flavor_k_ptr = k_ptr;
1360 /* Analyze the object */
1361 switch (o_ptr->tval)
1363 /* Some objects are easy to describe */
1377 monster_race *r_ptr = &r_info[o_ptr->pval];
1383 modstr = _(" (空)", " (empty)");
1388 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1391 concptr t = r_name + r_ptr->name;
1393 if (!(r_ptr->flags1 & RF1_UNIQUE))
1395 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1401 sprintf(tmp_val2, "(%s)", t);
1411 /* Figurines/Statues */
1415 monster_race *r_ptr = &r_info[o_ptr->pval];
1418 modstr = r_name + r_ptr->name;
1420 concptr t = r_name + r_ptr->name;
1422 if (!(r_ptr->flags1 & RF1_UNIQUE))
1424 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1441 monster_race *r_ptr = &r_info[o_ptr->pval];
1443 modstr = r_name + r_ptr->name;
1448 if (r_ptr->flags1 & RF1_UNIQUE)
1449 basenm = "& % of #";
1457 /* Missiles/ Bows/ Weapons */
1486 /* Lites (including a few "Specials") */
1492 /* Amulets (including a few "Specials") */
1495 /* Known artifacts */
1498 if (object_is_fixed_artifact(o_ptr)) break;
1499 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1502 /* Color the object */
1503 modstr = k_name + flavor_k_ptr->flavor_name;
1506 if (!flavor) basenm = "%のアミュレット";
1507 else if (aware) basenm = "%の#アミュレット";
1508 else basenm = "#アミュレット";
1510 if (!flavor) basenm = "& Amulet~ of %";
1511 else if (aware) basenm = "& # Amulet~ of %";
1512 else basenm = "& # Amulet~";
1518 /* Rings (including a few "Specials") */
1521 /* Known artifacts */
1524 if (object_is_fixed_artifact(o_ptr)) break;
1525 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1528 /* Color the object */
1529 modstr = k_name + flavor_k_ptr->flavor_name;
1532 if (!flavor) basenm = "%の指輪";
1533 else if (aware) basenm = "%の#指輪";
1534 else basenm = "#指輪";
1536 if (!flavor) basenm = "& Ring~ of %";
1537 else if (aware) basenm = "& # Ring~ of %";
1538 else basenm = "& # Ring~";
1541 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1553 /* Color the object */
1554 modstr = k_name + flavor_k_ptr->flavor_name;
1557 if (!flavor) basenm = "%の杖";
1558 else if (aware) basenm = "%の#杖";
1561 if (!flavor) basenm = "& Staff~ of %";
1562 else if (aware) basenm = "& # Staff~ of %";
1563 else basenm = "& # Staff~";
1571 /* Color the object */
1572 modstr = k_name + flavor_k_ptr->flavor_name;
1575 if (!flavor) basenm = "%の魔法棒";
1576 else if (aware) basenm = "%の#魔法棒";
1577 else basenm = "#魔法棒";
1579 if (!flavor) basenm = "& Wand~ of %";
1580 else if (aware) basenm = "& # Wand~ of %";
1581 else basenm = "& # Wand~";
1589 /* Color the object */
1590 modstr = k_name + flavor_k_ptr->flavor_name;
1593 if (!flavor) basenm = "%のロッド";
1594 else if (aware) basenm = "%の#ロッド";
1595 else basenm = "#ロッド";
1597 if (!flavor) basenm = "& Rod~ of %";
1598 else if (aware) basenm = "& # Rod~ of %";
1599 else basenm = "& # Rod~";
1607 /* Color the object */
1608 modstr = k_name + flavor_k_ptr->flavor_name;
1611 if (!flavor) basenm = "%の巻物";
1612 else if (aware) basenm = "「#」と書かれた%の巻物";
1613 else basenm = "「#」と書かれた巻物";
1615 if (!flavor) basenm = "& Scroll~ of %";
1616 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1617 else basenm = "& Scroll~ titled \"#\"";
1625 /* Color the object */
1626 modstr = k_name + flavor_k_ptr->flavor_name;
1629 if (!flavor) basenm = "%の薬";
1630 else if (aware) basenm = "%の#薬";
1633 if (!flavor) basenm = "& Potion~ of %";
1634 else if (aware) basenm = "& # Potion~ of %";
1635 else basenm = "& # Potion~";
1643 /* Ordinary food is "boring" */
1644 if (!k_ptr->flavor_name) break;
1646 /* Color the object */
1647 modstr = k_name + flavor_k_ptr->flavor_name;
1650 if (!flavor) basenm = "%のキノコ";
1651 else if (aware) basenm = "%の#キノコ";
1652 else basenm = "#キノコ";
1654 if (!flavor) basenm = "& Mushroom~ of %";
1655 else if (aware) basenm = "& # Mushroom~ of %";
1656 else basenm = "& # Mushroom~";
1664 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1674 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1675 basenm = "& Book~ of Life Magic %";
1677 basenm = "& Life Spellbook~ %";
1683 case TV_SORCERY_BOOK:
1688 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1689 basenm = "& Book~ of Sorcery %";
1691 basenm = "& Sorcery Spellbook~ %";
1697 case TV_NATURE_BOOK:
1702 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1703 basenm = "& Book~ of Nature Magic %";
1705 basenm = "& Nature Spellbook~ %";
1714 basenm = "カオスの魔法書%";
1716 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1717 basenm = "& Book~ of Chaos Magic %";
1719 basenm = "& Chaos Spellbook~ %";
1730 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1731 basenm = "& Book~ of Death Magic %";
1733 basenm = "& Death Spellbook~ %";
1742 basenm = "トランプの魔法書%";
1744 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1745 basenm = "& Book~ of Trump Magic %";
1747 basenm = "& Trump Spellbook~ %";
1753 case TV_ARCANE_BOOK:
1758 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1759 basenm = "& Book~ of Arcane Magic %";
1761 basenm = "& Arcane Spellbook~ %";
1772 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1773 basenm = "& Book~ of Craft Magic %";
1775 basenm = "& Craft Spellbook~ %";
1781 case TV_DAEMON_BOOK:
1786 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1787 basenm = "& Book~ of Daemon Magic %";
1789 basenm = "& Daemon Spellbook~ %";
1795 case TV_CRUSADE_BOOK:
1800 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1801 basenm = "& Book~ of Crusade Magic %";
1803 basenm = "& Crusade Spellbook~ %";
1811 basenm = _("歌集%", "& Song Book~ %");
1815 case TV_HISSATSU_BOOK:
1817 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1826 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1827 basenm = "& Book~ of Hex Magic %";
1829 basenm = "& Hex Spellbook~ %";
1835 /* Hack -- Gold/Gems */
1838 strcpy(buf, basenm);
1842 /* Used in the "inventory" routine */
1845 strcpy(buf, _("(なし)", "(nothing)"));
1850 /* Use full name from k_info or a_info */
1851 if (aware && have_flag(flgs, TR_FULL_NAME))
1853 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1854 else basenm = kindname;
1857 /* Start dumping the result */
1861 if (basenm[0] == '&')
1867 if (mode & OD_OMIT_PREFIX)
1871 else if (o_ptr->number > 1)
1873 t = object_desc_kosuu(t, o_ptr);
1874 t = object_desc_str(t, "の ");
1877 /* 英語の場合アーティファクトは The が付くので分かるが
1878 * 日本語では分からないのでマークをつける
1882 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1883 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1888 /* The object "expects" a "number" */
1889 if (basenm[0] == '&')
1891 /* Skip the ampersand (and space) */
1895 if (mode & OD_OMIT_PREFIX)
1900 /* Hack -- None left */
1901 else if (o_ptr->number <= 0)
1903 t = object_desc_str(t, "no more ");
1906 /* Extract the number */
1907 else if (o_ptr->number > 1)
1909 t = object_desc_num(t, o_ptr->number);
1910 t = object_desc_chr(t, ' ');
1913 /* Hack -- The only one of its kind */
1914 else if ((known && object_is_artifact(o_ptr)) ||
1915 ((o_ptr->tval == TV_CORPSE) &&
1916 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1918 t = object_desc_str(t, "The ");
1928 case '#': vowel = is_a_vowel(modstr[0]); break;
1929 case '%': vowel = is_a_vowel(*kindname); break;
1930 default: vowel = is_a_vowel(*s); break;
1935 /* A single one, with a vowel */
1936 t = object_desc_str(t, "an ");
1940 /* A single one, without a vowel */
1941 t = object_desc_str(t, "a ");
1946 /* Hack -- objects that "never" take an article */
1953 if (mode & OD_OMIT_PREFIX)
1958 /* Hack -- all gone */
1959 else if (o_ptr->number <= 0)
1961 t = object_desc_str(t, "no more ");
1964 /* Prefix a number if required */
1965 else if (o_ptr->number > 1)
1967 t = object_desc_num(t, o_ptr->number);
1968 t = object_desc_chr(t, ' ');
1971 /* Hack -- The only one of its kind */
1972 else if (known && object_is_artifact(o_ptr))
1974 t = object_desc_str(t, "The ");
1977 /* Hack -- single items get no prefix */
1985 /* Paranoia -- skip illegal tildes */
1986 /* while (*s == '~') s++; */
1989 if (object_is_smith(o_ptr))
1991 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
1994 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
1998 if (o_ptr->art_name)
2000 concptr temp = quark_str(o_ptr->art_name);
2002 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2003 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2004 if (strncmp(temp, "of ", 3) == 0)
2006 t = object_desc_str(t, &temp[3]);
2007 t = object_desc_str(t, "の");
2009 else if ((strncmp(temp, "『", 2) != 0) &&
2010 (strncmp(temp, "《", 2) != 0) &&
2012 t = object_desc_str(t, temp);
2015 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2017 artifact_type *a_ptr = &a_info[o_ptr->name1];
2018 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2019 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2021 t = object_desc_str(t, a_name + a_ptr->name);
2025 else if (object_is_ego(o_ptr))
2027 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2028 t = object_desc_str(t, e_name + e_ptr->name);
2033 /* Copy the string */
2034 for (s0 = NULL; *s || s0; )
2036 /* The end of the flavour/kind string. */
2043 /* Begin to append the modifier (flavor) */
2044 else if ((*s == '#') && !s0)
2049 /* Paranoia -- Never append multiple modstrs */
2053 /* Begin to append the kind name */
2054 else if ((*s == '%') && !s0)
2059 /* Paranoia -- Never append multiple kindnames */
2067 /* Add a plural if needed */
2068 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2074 /* Hack -- "Cutlass-es" and "Torch-es" */
2075 if ((k == 's') || (k == 'h')) *t++ = 'e';
2097 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2100 /* ランダムアーティファクトの名前はセーブファイルに記録
2101 されるので、英語版の名前もそれらしく変換する */
2102 if (o_ptr->art_name)
2106 strcpy(temp, quark_str(o_ptr->art_name));
2107 /* MEGA HACK by ita */
2108 if (strncmp(temp, "『", 2) == 0 ||
2109 strncmp(temp, "《", 2) == 0)
2110 t = object_desc_str(t, temp);
2111 else if (temp[0] == '\'')
2113 itemp = strlen(temp);
2114 temp[itemp - 1] = 0;
2115 t = object_desc_str(t, "『");
2116 t = object_desc_str(t, &temp[1]);
2117 t = object_desc_str(t, "』");
2120 else if (object_is_fixed_artifact(o_ptr))
2122 artifact_type *a_ptr = &a_info[o_ptr->name1];
2123 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2125 t = object_desc_str(t, a_name + a_ptr->name);
2128 else if (o_ptr->inscription)
2130 concptr str = quark_str(o_ptr->inscription);
2139 if (*str == '#') break;
2145 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2147 /* Add the false name */
2148 t = object_desc_str(t,"『");
2149 t = object_desc_str(t, &str_aux[1]);
2150 t = object_desc_str(t,"』");
2155 if (object_is_smith(o_ptr))
2157 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2160 /* Hack -- Append "Artifact" or "Special" names */
2161 if (known && !have_flag(flgs, TR_FULL_NAME))
2163 /* Is it a new random artifact ? */
2164 if (o_ptr->art_name)
2166 t = object_desc_chr(t, ' ');
2167 t = object_desc_str(t, quark_str(o_ptr->art_name));
2170 /* Grab any artifact name */
2171 else if (object_is_fixed_artifact(o_ptr))
2173 artifact_type *a_ptr = &a_info[o_ptr->name1];
2175 t = object_desc_chr(t, ' ');
2176 t = object_desc_str(t, a_name + a_ptr->name);
2179 /* Grab any ego-item name */
2182 if (object_is_ego(o_ptr))
2184 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2186 t = object_desc_chr(t, ' ');
2187 t = object_desc_str(t, e_name + e_ptr->name);
2190 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2193 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2195 /* Add the false name */
2196 t = object_desc_chr(t, ' ');
2197 t = object_desc_str(t, &str[1]);
2204 /* No more details wanted */
2205 if (mode & OD_NAME_ONLY) goto object_desc_done;
2207 /* Hack -- Chests must be described in detail */
2208 if (o_ptr->tval == TV_CHEST)
2210 /* Not searched yet */
2216 /* May be "empty" */
2217 else if (!o_ptr->pval)
2219 t = object_desc_str(t, _("(空)", " (empty)"));
2222 /* May be "disarmed" */
2223 else if (o_ptr->pval < 0)
2225 if (chest_traps[0 - o_ptr->pval])
2227 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2231 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2235 /* Describe the traps, if any */
2238 /* Describe the traps */
2239 switch (chest_traps[o_ptr->pval])
2243 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2246 case CHEST_LOSE_STR:
2248 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2251 case CHEST_LOSE_CON:
2253 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2258 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2261 case CHEST_PARALYZE:
2263 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2268 t = object_desc_str(t, _("(爆発装置)", " (Explosive Device)"));
2272 case CHEST_BIRD_STORM:
2273 case CHEST_E_SUMMON:
2274 case CHEST_H_SUMMON:
2276 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2279 case CHEST_RUNES_OF_EVIL:
2281 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2286 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2291 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2299 /* Display the item like a weapon */
2300 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2302 /* Display the item like a weapon */
2303 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2306 /* Display the item like a weapon */
2307 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2309 /* Display the item like armour */
2310 if (o_ptr->ac) show_armour = TRUE;
2313 /* Dump base weapon info */
2314 switch (o_ptr->tval)
2316 /* Missiles and Weapons */
2325 /* In Vault Quest, hide the dice of target weapon. */
2326 if(object_is_quest_target(o_ptr) && !known)
2331 /* Append a "damage" string */
2332 t = object_desc_chr(t, ' ');
2333 t = object_desc_chr(t, p1);
2334 t = object_desc_num(t, o_ptr->dd);
2335 t = object_desc_chr(t, 'd');
2336 t = object_desc_num(t, o_ptr->ds);
2337 t = object_desc_chr(t, p2);
2343 /* Bows get a special "damage string" */
2346 /* Mega-Hack -- Extract the "base power" */
2347 power = bow_tmul(o_ptr->sval);
2349 /* Apply the "Extra Might" flag */
2350 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2352 /* Append a special "damage" string */
2353 t = object_desc_chr(t, ' ');
2354 t = object_desc_chr(t, p1);
2355 t = object_desc_chr(t, 'x');
2356 t = object_desc_num(t, power);
2357 t = object_desc_chr(t, p2);
2359 fire_rate = calc_num_fire(o_ptr);
2360 /* Show Fire rate */
2361 if (fire_rate != 0 && power > 0 && known)
2363 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2365 t = object_desc_chr(t, ' ');
2366 t = object_desc_chr(t, p1);
2367 t = object_desc_num(t, fire_rate/100);
2368 t = object_desc_chr(t, '.');
2369 t = object_desc_num(t, fire_rate%100);
2370 t = object_desc_str(t, "turn");
2371 t = object_desc_chr(t, p2);
2379 /* Add the weapon bonuses */
2382 /* Show the tohit/todam on request */
2385 t = object_desc_chr(t, ' ');
2386 t = object_desc_chr(t, p1);
2387 t = object_desc_int(t, o_ptr->to_h);
2388 t = object_desc_chr(t, ',');
2389 t = object_desc_int(t, o_ptr->to_d);
2390 t = object_desc_chr(t, p2);
2393 /* Show the tohit if needed */
2394 else if (o_ptr->to_h)
2396 t = object_desc_chr(t, ' ');
2397 t = object_desc_chr(t, p1);
2398 t = object_desc_int(t, o_ptr->to_h);
2399 t = object_desc_chr(t, p2);
2402 /* Show the todam if needed */
2403 else if (o_ptr->to_d)
2405 t = object_desc_chr(t, ' ');
2406 t = object_desc_chr(t, p1);
2407 t = object_desc_int(t, o_ptr->to_d);
2408 t = object_desc_chr(t, p2);
2412 bow_ptr = &inventory[INVEN_BOW];
2414 /* If have a firing weapon + ammo matches bow */
2415 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2417 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2418 int tmul = bow_tmul(bow_ptr->sval);
2419 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2421 /* See if the bow is "known" - then set damage bonus */
2422 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2424 /* Effect of ammo */
2425 if (known) avgdam += (o_ptr->to_d * 10);
2427 /* Get extra "power" from "extra might" */
2428 if (p_ptr->xtra_might) tmul++;
2430 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2432 /* Launcher multiplier */
2434 avgdam /= (100 * 10);
2436 /* Get extra damage from concentration */
2437 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2439 if (avgdam < 0) avgdam = 0;
2441 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2442 t = object_desc_chr(t, ' ');
2443 t = object_desc_chr(t, p1);
2445 if(show_ammo_no_crit)
2447 /* Damage with no-crit */
2448 t = object_desc_num(t, avgdam);
2449 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2452 /* Apply Expect damage of Critical */
2453 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2454 t = object_desc_num(t, avgdam);
2456 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2457 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2459 if (p_ptr->num_fire == 0)
2461 t = object_desc_chr(t, '0');
2465 /* Calc effects of energy */
2466 avgdam *= (p_ptr->num_fire * 100);
2467 avgdam /= energy_fire;
2468 t = object_desc_num(t, avgdam);
2469 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2471 if(show_ammo_crit_ratio)
2473 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2475 t = object_desc_chr(t, '/');
2476 t = object_desc_num(t, percent / 100);
2477 t = object_desc_chr(t, '.');
2478 if(percent % 100 < 10)
2480 t = object_desc_chr(t, '0');
2482 t = object_desc_num(t, percent % 100);
2483 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2487 t = object_desc_chr(t, p2);
2489 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2491 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2492 s16b energy_fire = 100 - p_ptr->lev;
2494 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2496 /* Display (shot damage/ avg damage) */
2497 t = object_desc_chr(t, ' ');
2498 t = object_desc_chr(t, p1);
2499 t = object_desc_num(t, avgdam);
2500 t = object_desc_chr(t, '/');
2502 /* Calc effects of energy */
2503 avgdam = 100 * avgdam / energy_fire;
2505 t = object_desc_num(t, avgdam);
2506 t = object_desc_chr(t, p2);
2509 /* Add the armor bonuses */
2512 /* Show the armor class info */
2515 t = object_desc_chr(t, ' ');
2516 t = object_desc_chr(t, b1);
2517 t = object_desc_num(t, o_ptr->ac);
2518 t = object_desc_chr(t, ',');
2519 t = object_desc_int(t, o_ptr->to_a);
2520 t = object_desc_chr(t, b2);
2523 /* No base armor, but does increase armor */
2524 else if (o_ptr->to_a)
2526 t = object_desc_chr(t, ' ');
2527 t = object_desc_chr(t, b1);
2528 t = object_desc_int(t, o_ptr->to_a);
2529 t = object_desc_chr(t, b2);
2533 /* Hack -- always show base armor */
2534 else if (show_armour)
2536 t = object_desc_chr(t, ' ');
2537 t = object_desc_chr(t, b1);
2538 t = object_desc_num(t, o_ptr->ac);
2539 t = object_desc_chr(t, b2);
2543 /* No more details wanted */
2544 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2547 if (known) /* Known item only */
2550 * Hack -- Wands and Staffs have charges. Make certain how many charges
2551 * a stack of staffs really has is clear. -LM-
2553 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2555 /* Dump " (N charges)" */
2556 t = object_desc_chr(t, ' ');
2557 t = object_desc_chr(t, p1);
2559 /* Clear explaination for staffs. */
2560 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2562 t = object_desc_num(t, o_ptr->number);
2563 t = object_desc_str(t, "x ");
2565 t = object_desc_num(t, o_ptr->pval);
2567 t = object_desc_str(t, "回分");
2569 t = object_desc_str(t, " charge");
2570 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2573 t = object_desc_chr(t, p2);
2575 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2576 * be in any state of charge or discharge, this now includes a number. -LM-
2578 else if (o_ptr->tval == TV_ROD)
2580 /* Hack -- Dump " (# charging)" if relevant */
2583 /* Stacks of rods display an exact count of charging rods. */
2584 if (o_ptr->number > 1)
2587 if (k_ptr->pval == 0) k_ptr->pval = 1;
2589 /* Find out how many rods are charging, by dividing
2590 * current timeout by each rod's maximum timeout.
2591 * Ensure that any remainder is rounded up. Display
2592 * very discharged stacks as merely fully discharged.
2594 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2595 if (power > o_ptr->number) power = o_ptr->number;
2597 /* Display prettily. */
2598 t = object_desc_str(t, " (");
2599 t = object_desc_num(t, power);
2600 t = object_desc_str(t, _("本 充填中)", " charging)"));
2603 /* "one Rod of Perception (1 charging)" would look tacky. */
2606 t = object_desc_str(t, _("(充填中)", " (charging)"));
2611 /* Dump "pval" flags for wearable items */
2612 if (have_pval_flags(flgs))
2614 /* Start the display */
2615 t = object_desc_chr(t, ' ');
2616 t = object_desc_chr(t, p1);
2618 /* Dump the "pval" itself */
2619 t = object_desc_int(t, o_ptr->pval);
2621 /* Do not display the "pval" flags */
2622 if (have_flag(flgs, TR_HIDE_TYPE))
2627 else if (have_flag(flgs, TR_SPEED))
2629 /* Dump " to speed" */
2630 t = object_desc_str(t, _("加速", " to speed"));
2634 else if (have_flag(flgs, TR_BLOWS))
2638 t = object_desc_str(t, "攻撃");
2640 t = object_desc_str(t, " attack");
2643 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2648 else if (have_flag(flgs, TR_STEALTH))
2650 /* Dump " to stealth" */
2651 t = object_desc_str(t, _("隠密", " to stealth"));
2655 else if (have_flag(flgs, TR_SEARCH))
2657 /* Dump " to searching" */
2658 t = object_desc_str(t, _("探索", " to searching"));
2662 else if (have_flag(flgs, TR_INFRA))
2664 /* Dump " to infravision" */
2665 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2668 /* Finish the display */
2669 t = object_desc_chr(t, p2);
2672 /* Hack -- Process Lanterns/Torches */
2673 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2675 /* Hack -- Turns of light for normal lites */
2677 t = object_desc_chr(t, '(');
2679 t = object_desc_str(t, " (with ");
2682 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2683 else t = object_desc_num(t, o_ptr->xtra4);
2684 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2687 /* Indicate charging objects, but not rods. */
2688 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2690 /* Hack -- Dump " (charging)" if relevant */
2691 t = object_desc_str(t, _("(充填中)", " (charging)"));
2696 /* No more details wanted */
2697 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2700 /* Prepare real inscriptions in a buffer */
2703 /* Auto abbreviation inscribe */
2704 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2706 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2717 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2721 /* Use the standard inscription if available */
2722 if (o_ptr->inscription)
2726 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2728 /* Get inscription and convert {%} */
2729 get_inscription(buff, o_ptr);
2731 /* strcat with correct treating of kanji */
2732 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2736 /* No fake inscription yet */
2737 fake_insc_buf[0] = '\0';
2739 /* Use the game-generated "feeling" otherwise, if available */
2742 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2745 /* Note "cursed" if the item is known to be cursed */
2746 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2748 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2751 /* Note "unidentified" if the item is unidentified */
2752 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2753 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2755 && !(o_ptr->ident & IDENT_SENSE))
2757 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2760 /* Mega-Hack -- note empty wands/staffs */
2761 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2763 strcpy(fake_insc_buf, _("空", "empty"));
2766 /* Note "tried" if the object has been tested unsuccessfully */
2767 else if (!aware && object_is_tried(o_ptr))
2769 strcpy(fake_insc_buf, _("未判明", "tried"));
2772 /* Note the discount, if any */
2773 if (o_ptr->discount)
2775 /* Hidden by real inscription unless in a store */
2776 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2778 char discount_num_buf[4];
2780 /* Append to other fake inscriptions if any */
2781 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2783 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2784 strcat(fake_insc_buf, discount_num_buf);
2785 strcat(fake_insc_buf, _("%引き", "% off"));
2790 /* Append the inscription, if any */
2791 if (fake_insc_buf[0] || tmp_val2[0])
2793 /* Append the inscription */
2794 t = object_desc_chr(t, ' ');
2795 t = object_desc_chr(t, c1);
2797 /* Append fake inscriptions */
2798 if (fake_insc_buf[0])
2800 t = object_desc_str(t, fake_insc_buf);
2803 /* Append a separater */
2804 if (fake_insc_buf[0] && tmp_val2[0])
2806 t = object_desc_chr(t, ',');
2807 t = object_desc_chr(t, ' ');
2810 /* Append real inscriptions */
2813 t = object_desc_str(t, tmp_val2);
2816 t = object_desc_chr(t, c2);
2820 my_strcpy(buf, tmp_val, MAX_NLEN);