2 * @file object-flavor.c
3 * @brief オブジェクトの記述処理 / Mbject flavor code
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
14 #include "player-status.h"
16 #include "object-hook.h"
17 #include "object-flavor.h"
23 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
25 * @return 簡易名称を明らかにするならTRUEを返す。
27 * This function is used only by "flavor_init()"
29 static bool object_easy_know(int i)
31 object_kind *k_ptr = &k_info[i];
33 /* Analyze the "tval" */
48 case TV_HISSATSU_BOOK:
65 /* All Food, Potions, Scrolls, Rods */
79 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
80 * @param out_string 作成した名を保管する参照ポインタ
82 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
83 * syllables 配列と elvish.txt を組み合わせる。\n
85 void get_table_name_aux(char *out_string)
89 get_rnd_line("aname_j.txt", 1, Syllable);
90 strcpy(out_string, Syllable);
91 get_rnd_line("aname_j.txt", 2, Syllable);
92 strcat(out_string, Syllable);
94 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
96 static concptr syllables[MAX_SYLLABLES] = {
97 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
98 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
99 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
100 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
101 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
102 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
103 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
104 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
105 "kho", "kli", "klis", "la", "lech", "man", "mar",
106 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
107 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
108 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
109 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
110 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
111 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
112 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
113 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
114 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
115 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
116 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
120 int testcounter = randint1(3) + 1;
122 strcpy(out_string, "");
124 if (randint1(3) == 2)
126 while (testcounter--)
127 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
132 testcounter = randint1(2) + 1;
133 while (testcounter--)
135 (void)get_rnd_line("elvish.txt", 0, Syllable);
136 strcat(out_string, Syllable);
140 out_string[0] = toupper(out_string[1]);
142 out_string[16] = '\0';
147 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
148 * @param out_string 作成した名を保管する参照ポインタ
150 * @details get_table_name_aux()ほぼ完全に実装を依存している。
152 void get_table_name(char *out_string)
155 get_table_name_aux(buff);
156 sprintf(out_string, _("『%s』", "'%s'"), buff);
160 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
161 * @param out_string 作成した名を保管する参照ポインタ
163 * @details sname.txtが語幹の辞書となっている。
165 void get_table_sindarin_aux(char *out_string)
172 get_rnd_line("sname.txt", 1, Syllable);
174 strcpy(tmp, Syllable);
176 strcpy(out_string, Syllable);
179 get_rnd_line("sname.txt", 2, Syllable);
181 strcat(tmp, Syllable);
182 sindarin_to_kana(out_string, tmp);
184 strcat(out_string, Syllable);
189 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
190 * @param out_string 作成した名を保管する参照ポインタ
192 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
194 void get_table_sindarin(char *out_string)
197 get_table_sindarin_aux(buff);
198 sprintf(out_string, _("『%s』", "'%s'"), buff);
203 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
204 * @param tval シャッフルしたいtval
206 * @details 巻物、各種魔道具などに利用される。
208 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
210 KIND_OBJECT_IDX *k_idx_list;
211 KIND_OBJECT_IDX k_idx_list_num = 0;
214 /* Allocate an array for a list of k_idx */
215 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
217 /* Search objects with given tval for shuffle */
218 for (i = 0; i < max_k_idx; i++)
220 object_kind *k_ptr = &k_info[i];
223 if (k_ptr->tval != tval) continue;
225 /* Paranoia -- Skip objects without flavor */
226 if (!k_ptr->flavor) continue;
228 /* Skip objects with a fixed flavor name */
229 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
232 k_idx_list[k_idx_list_num] = i;
234 /* Increase number of remembered indices */
238 /* Shuffle flavors */
239 for (i = 0; i < k_idx_list_num; i++)
241 object_kind *k1_ptr = &k_info[k_idx_list[i]];
242 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
244 /* Swap flavors of this pair */
245 s16b tmp = k1_ptr->flavor;
246 k1_ptr->flavor = k2_ptr->flavor;
247 k2_ptr->flavor = tmp;
250 /* Free an array for a list of k_idx */
251 C_KILL(k_idx_list, max_k_idx, s16b);
255 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
258 * Prepare the "variable" part of the "k_info" array.\n
260 * The "color"/"metal"/"type" of an item is its "flavor".\n
261 * For the most part, flavors are assigned randomly each game.\n
263 * Initialize descriptions for the "colored" objects, including:\n
264 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
266 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
267 * Slime Mold Juice, Unused Potion).\n
269 * Scroll titles are always between 6 and 14 letters long. This is\n
270 * ensured because every title is composed of whole words, where every\n
271 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
272 * letters each), and that no scroll is finished until it attempts to\n
273 * grow beyond 15 letters. The first time this can happen is when the\n
274 * current title has 6 letters and the new word has 8 letters, which\n
275 * would result in a 6 letter scroll title.\n
277 * Duplicate titles are avoided by requiring that no two scrolls share\n
278 * the same first four letters (not the most efficient method, and not\n
279 * the least efficient method, but it will always work).\n
281 * Hack -- make sure everything stays the same for each saved game\n
282 * This is accomplished by the use of a saved "random seed", as in\n
283 * "town_gen()". Since no other functions are called while the special\n
284 * seed is in effect, so this function is pretty "safe".\n
286 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
288 void flavor_init(void)
291 u32b state_backup[4];
293 /* Hack -- Backup the RNG state */
294 Rand_state_backup(state_backup);
296 /* Hack -- Induce consistant flavors */
297 Rand_state_set(seed_flavor);
300 /* Initialize flavor index of each object by itself */
301 for (i = 0; i < max_k_idx; i++)
303 object_kind *k_ptr = &k_info[i];
305 /* Skip objects without flavor name */
306 if (!k_ptr->flavor_name) continue;
309 * Initialize flavor index to itself
310 * -> Shuffle it later
316 shuffle_flavors(TV_RING);
318 /* Shuffle Amulets */
319 shuffle_flavors(TV_AMULET);
322 shuffle_flavors(TV_STAFF);
325 shuffle_flavors(TV_WAND);
328 shuffle_flavors(TV_ROD);
330 /* Shuffle Mushrooms */
331 shuffle_flavors(TV_FOOD);
333 /* Shuffle Potions */
334 shuffle_flavors(TV_POTION);
336 /* Shuffle Scrolls */
337 shuffle_flavors(TV_SCROLL);
340 /* Hack -- Restore the RNG state */
341 Rand_state_restore(state_backup);
343 /* Analyze every object */
344 for (i = 1; i < max_k_idx; i++)
346 object_kind *k_ptr = &k_info[i];
348 /* Skip "empty" objects */
349 if (!k_ptr->name) continue;
351 /* No flavor yields aware */
352 if (!k_ptr->flavor) k_ptr->aware = TRUE;
354 /* Check for "easily known" */
355 k_ptr->easy_know = object_easy_know(i);
361 * @brief 対象文字配列に一文字だけをコピーする。
362 * @param t 保管先文字列ポインタ
366 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
367 * and return a pointer to the terminator (t + 1).\n
369 static char *object_desc_chr(char *t, char c)
380 * @brief 対象文字配列に文字列をコピーする。
381 * @param t 保管先文字列ポインタ
382 * @param s コピーしたい文字列ポインタ
385 * Print a string "s" into a string "t", as if by strcpy(t, s),
386 * and return a pointer to the terminator.
388 static char *object_desc_str(char *t, concptr s)
390 /* Copy the string */
391 while (*s) *t++ = *s++;
399 * @brief 対象文字配列に符号なし整数値をコピーする。
400 * @param t 保管先文字列ポインタ
404 * Print an unsigned number "n" into a string "t", as if by
405 * sprintf(t, "%u", n), and return a pointer to the terminator.
407 static char *object_desc_num(char *t, uint n)
411 /* Find "size" of "n" */
412 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
414 /* Dump each digit */
420 /* Remove the digit */
423 /* Process next digit */
437 * @brief 日本語の個数表示ルーチン
438 * @param t 保管先文字列ポインタ
439 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
442 * cmd1.c で流用するために object_desc_japanese から移動した。
444 char *object_desc_kosuu(char *t, object_type *o_ptr)
446 t = object_desc_num(t, o_ptr->number);
458 t = object_desc_str(t, "本");
463 t = object_desc_str(t, "巻");
468 t = object_desc_str(t, "服");
472 case TV_SORCERY_BOOK:
480 case TV_CRUSADE_BOOK:
482 case TV_HISSATSU_BOOK:
485 t = object_desc_str(t, "冊");
493 t = object_desc_str(t, "着");
500 t = object_desc_str(t, "振");
505 t = object_desc_str(t, "足");
510 t = object_desc_str(t, "枚");
516 if(o_ptr->sval == SV_FOOD_JERKY)
518 t = object_desc_str(t, "切れ");
524 if (o_ptr->number < 10)
526 t = object_desc_str(t, "つ");
530 t = object_desc_str(t, "個");
540 * @brief 対象文字配列に符号あり整数値をコピーする。
541 * @param t 保管先文字列ポインタ
545 * Print an signed number "v" into a string "t", as if by
546 * sprintf(t, "%+d", n), and return a pointer to the terminator.
547 * Note that we always print a sign, either "+" or "-".
549 static char *object_desc_int(char *t, sint v)
556 /* Take the absolute value */
559 /* Use a "minus" sign */
563 /* Positive (or zero) */
566 /* Use the actual number */
569 /* Use a "plus" sign */
573 /* Find "size" of "n" */
574 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
576 /* Dump each digit */
582 /* Remove the digit */
585 /* Process next digit */
596 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
598 typedef struct flag_insc_table
609 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
610 static flag_insc_table flag_insc_plus[] =
612 { "攻", "At", TR_BLOWS, -1 },
613 { "速", "Sp", TR_SPEED, -1 },
614 { "腕", "St", TR_STR, -1 },
615 { "知", "In", TR_INT, -1 },
616 { "賢", "Wi", TR_WIS, -1 },
617 { "器", "Dx", TR_DEX, -1 },
618 { "耐", "Cn", TR_CON, -1 },
619 { "魅", "Ch", TR_CHR, -1 },
620 { "道", "Md", TR_MAGIC_MASTERY, -1 },
621 { "隠", "Sl", TR_STEALTH, -1 },
622 { "探", "Sr", TR_SEARCH, -1 },
623 { "赤", "If", TR_INFRA, -1 },
624 { "掘", "Dg", TR_TUNNEL, -1 },
625 { NULL, NULL, 0, -1 }
628 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
629 static flag_insc_table flag_insc_immune[] =
631 { "酸", "Ac", TR_IM_ACID, -1 },
632 { "電", "El", TR_IM_ELEC, -1 },
633 { "火", "Fi", TR_IM_FIRE, -1 },
634 { "冷", "Co", TR_IM_COLD, -1 },
635 { NULL, NULL, 0, -1 }
638 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
639 static flag_insc_table flag_insc_resistance[] =
641 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
642 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
643 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
644 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
645 { "毒", "Po", TR_RES_POIS, -1 },
646 { "閃", "Li", TR_RES_LITE, -1 },
647 { "暗", "Dk", TR_RES_DARK, -1 },
648 { "破", "Sh", TR_RES_SHARDS, -1 },
649 { "盲", "Bl", TR_RES_BLIND, -1 },
650 { "乱", "Cf", TR_RES_CONF, -1 },
651 { "轟", "So", TR_RES_SOUND, -1 },
652 { "獄", "Nt", TR_RES_NETHER, -1 },
653 { "因", "Nx", TR_RES_NEXUS, -1 },
654 { "沌", "Ca", TR_RES_CHAOS, -1 },
655 { "劣", "Di", TR_RES_DISEN, -1 },
656 { "恐", "Fe", TR_RES_FEAR, -1 },
657 { NULL, NULL, 0, -1 }
660 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
661 static flag_insc_table flag_insc_misc[] =
663 { "易", "Es", TR_EASY_SPELL, -1 },
664 { "減", "Dm", TR_DEC_MANA, -1 },
665 { "投", "Th", TR_THROW, -1 },
666 { "反", "Rf", TR_REFLECT, -1 },
667 { "麻", "Fa", TR_FREE_ACT, -1 },
668 { "視", "Si", TR_SEE_INVIS, -1 },
669 { "経", "Hl", TR_HOLD_EXP, -1 },
670 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
671 { "活", "Rg", TR_REGEN, -1 },
672 { "浮", "Lv", TR_LEVITATION, -1 },
673 { "明", "Lu", TR_LITE_1, -1 },
674 { "明", "Lu", TR_LITE_2, -1 },
675 { "明", "Lu", TR_LITE_3, -1 },
676 { "闇", "Dl", TR_LITE_M1, -1 },
677 { "闇", "Dl", TR_LITE_M2, -1 },
678 { "闇", "Dl", TR_LITE_M3, -1 },
679 { "警", "Wr", TR_WARNING, -1 },
680 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
681 { "射", "Xs", TR_XTRA_SHOTS, -1 },
682 { "瞬", "Te", TR_TELEPORT, -1 },
683 { "怒", "Ag", TR_AGGRAVATE, -1 },
684 { "祝", "Bs", TR_BLESSED, -1 },
685 { "忌", "Ty", TR_TY_CURSE, -1 },
686 { "呪", "C-", TR_ADD_L_CURSE, -1 },
687 { "詛", "C+", TR_ADD_H_CURSE, -1 },
688 { NULL, NULL, 0, -1 }
691 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
692 static flag_insc_table flag_insc_aura[] =
694 { "炎", "F", TR_SH_FIRE, -1 },
695 { "電", "E", TR_SH_ELEC, -1 },
696 { "冷", "C", TR_SH_COLD, -1 },
697 { "魔", "M", TR_NO_MAGIC, -1 },
698 { "瞬", "T", TR_NO_TELE, -1 },
699 { NULL, NULL, 0, -1 }
702 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
703 static flag_insc_table flag_insc_brand[] =
705 { "酸", "A", TR_BRAND_ACID, -1 },
706 { "電", "E", TR_BRAND_ELEC, -1 },
707 { "焼", "F", TR_BRAND_FIRE, -1 },
708 { "凍", "Co", TR_BRAND_COLD, -1 },
709 { "毒", "P", TR_BRAND_POIS, -1 },
710 { "沌", "Ca", TR_CHAOTIC, -1 },
711 { "吸", "V", TR_VAMPIRIC, -1 },
712 { "震", "Q", TR_IMPACT, -1 },
713 { "切", "S", TR_VORPAL, -1 },
714 { "理", "M", TR_FORCE_WEAPON, -1 },
715 { NULL, NULL, 0, -1 }
718 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
719 static flag_insc_table flag_insc_kill[] =
721 { "邪", "*", TR_KILL_EVIL, -1 },
722 { "人", "p", TR_KILL_HUMAN, -1 },
723 { "龍", "D", TR_KILL_DRAGON, -1 },
724 { "オ", "o", TR_KILL_ORC, -1 },
725 { "ト", "T", TR_KILL_TROLL, -1 },
726 { "巨", "P", TR_KILL_GIANT, -1 },
727 { "デ", "U", TR_KILL_DEMON, -1 },
728 { "死", "L", TR_KILL_UNDEAD, -1 },
729 { "動", "Z", TR_KILL_ANIMAL, -1 },
730 { NULL, NULL, 0, -1 }
733 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
734 static flag_insc_table flag_insc_slay[] =
736 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
737 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
738 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
739 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
740 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
741 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
742 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
743 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
744 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
745 { NULL, NULL, 0, -1 }
748 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
749 static flag_insc_table flag_insc_esp1[] =
751 { "感", "Tele", TR_TELEPATHY, -1 },
752 { "邪", "Evil", TR_ESP_EVIL, -1 },
753 { "善", "Good", TR_ESP_GOOD, -1 },
754 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
755 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
756 { NULL, NULL, 0, -1 }
759 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
760 static flag_insc_table flag_insc_esp2[] =
762 { "人", "p", TR_ESP_HUMAN, -1 },
763 { "竜", "D", TR_ESP_DRAGON, -1 },
764 { "オ", "o", TR_ESP_ORC, -1 },
765 { "ト", "T", TR_ESP_TROLL, -1 },
766 { "巨", "P", TR_ESP_GIANT, -1 },
767 { "デ", "U", TR_ESP_DEMON, -1 },
768 { "死", "L", TR_ESP_UNDEAD, -1 },
769 { "動", "Z", TR_ESP_ANIMAL, -1 },
770 { NULL, NULL, 0, -1 }
773 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
774 static flag_insc_table flag_insc_sust[] =
776 { "腕", "St", TR_SUST_STR, -1 },
777 { "知", "In", TR_SUST_INT, -1 },
778 { "賢", "Wi", TR_SUST_WIS, -1 },
779 { "器", "Dx", TR_SUST_DEX, -1 },
780 { "耐", "Cn", TR_SUST_CON, -1 },
781 { "魅", "Ch", TR_SUST_CHR, -1 },
782 { NULL, NULL, 0, -1 }
786 static flag_insc_table flag_insc_plus[] =
788 { "At", TR_BLOWS, -1 },
789 { "Sp", TR_SPEED, -1 },
790 { "St", TR_STR, -1 },
791 { "In", TR_INT, -1 },
792 { "Wi", TR_WIS, -1 },
793 { "Dx", TR_DEX, -1 },
794 { "Cn", TR_CON, -1 },
795 { "Ch", TR_CHR, -1 },
796 { "Md", TR_MAGIC_MASTERY, -1 },
797 { "Sl", TR_STEALTH, -1 },
798 { "Sr", TR_SEARCH, -1 },
799 { "If", TR_INFRA, -1 },
800 { "Dg", TR_TUNNEL, -1 },
804 static flag_insc_table flag_insc_immune[] =
806 { "Ac", TR_IM_ACID, -1 },
807 { "El", TR_IM_ELEC, -1 },
808 { "Fi", TR_IM_FIRE, -1 },
809 { "Co", TR_IM_COLD, -1 },
813 static flag_insc_table flag_insc_resistance[] =
815 { "Ac", TR_RES_ACID, TR_IM_ACID },
816 { "El", TR_RES_ELEC, TR_IM_ELEC },
817 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
818 { "Co", TR_RES_COLD, TR_IM_COLD },
819 { "Po", TR_RES_POIS, -1 },
820 { "Li", TR_RES_LITE, -1 },
821 { "Dk", TR_RES_DARK, -1 },
822 { "Sh", TR_RES_SHARDS, -1 },
823 { "Bl", TR_RES_BLIND, -1 },
824 { "Cf", TR_RES_CONF, -1 },
825 { "So", TR_RES_SOUND, -1 },
826 { "Nt", TR_RES_NETHER, -1 },
827 { "Nx", TR_RES_NEXUS, -1 },
828 { "Ca", TR_RES_CHAOS, -1 },
829 { "Di", TR_RES_DISEN, -1 },
830 { "Fe", TR_RES_FEAR, -1 },
834 static flag_insc_table flag_insc_misc[] =
836 { "Es", TR_EASY_SPELL, -1 },
837 { "Dm", TR_DEC_MANA, -1 },
838 { "Th", TR_THROW, -1 },
839 { "Rf", TR_REFLECT, -1 },
840 { "Fa", TR_FREE_ACT, -1 },
841 { "Si", TR_SEE_INVIS, -1 },
842 { "Hl", TR_HOLD_EXP, -1 },
843 { "Sd", TR_SLOW_DIGEST, -1 },
844 { "Rg", TR_REGEN, -1 },
845 { "Lv", TR_LEVITATION, -1 },
846 { "Lu", TR_LITE_1, -1 },
847 { "Lu", TR_LITE_2, -1 },
848 { "Lu", TR_LITE_3, -1 },
849 { "Dl", TR_LITE_M1, -1 },
850 { "Dl", TR_LITE_M2, -1 },
851 { "Dl", TR_LITE_M3, -1 },
852 { "Wr", TR_WARNING, -1 },
853 { "Xm", TR_XTRA_MIGHT, -1 },
854 { "Xs", TR_XTRA_SHOTS, -1 },
855 { "Te", TR_TELEPORT, -1 },
856 { "Ag", TR_AGGRAVATE, -1 },
857 { "Bs", TR_BLESSED, -1 },
858 { "Ty", TR_TY_CURSE, -1 },
859 { "C-", TR_ADD_L_CURSE, -1 },
860 { "C+", TR_ADD_H_CURSE, -1 },
864 static flag_insc_table flag_insc_aura[] =
866 { "F", TR_SH_FIRE, -1 },
867 { "E", TR_SH_ELEC, -1 },
868 { "C", TR_SH_COLD, -1 },
869 { "M", TR_NO_MAGIC, -1 },
870 { "T", TR_NO_TELE, -1 },
874 static flag_insc_table flag_insc_brand[] =
876 { "A", TR_BRAND_ACID, -1 },
877 { "E", TR_BRAND_ELEC, -1 },
878 { "F", TR_BRAND_FIRE, -1 },
879 { "Co", TR_BRAND_COLD, -1 },
880 { "P", TR_BRAND_POIS, -1 },
881 { "Ca", TR_CHAOTIC, -1 },
882 { "V", TR_VAMPIRIC, -1 },
883 { "Q", TR_IMPACT, -1 },
884 { "S", TR_VORPAL, -1 },
885 { "M", TR_FORCE_WEAPON, -1 },
889 static flag_insc_table flag_insc_kill[] =
891 { "*", TR_KILL_EVIL, -1 },
892 { "p", TR_KILL_HUMAN, -1 },
893 { "D", TR_KILL_DRAGON, -1 },
894 { "o", TR_KILL_ORC, -1 },
895 { "T", TR_KILL_TROLL, -1 },
896 { "P", TR_KILL_GIANT, -1 },
897 { "U", TR_KILL_DEMON, -1 },
898 { "L", TR_KILL_UNDEAD, -1 },
899 { "Z", TR_KILL_ANIMAL, -1 },
903 static flag_insc_table flag_insc_slay[] =
905 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
906 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
907 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
908 { "o", TR_SLAY_ORC, TR_KILL_ORC },
909 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
910 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
911 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
912 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
913 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
917 static flag_insc_table flag_insc_esp1[] =
919 { "Tele", TR_TELEPATHY, -1 },
920 { "Evil", TR_ESP_EVIL, -1 },
921 { "Good", TR_ESP_GOOD, -1 },
922 { "Nolv", TR_ESP_NONLIVING, -1 },
923 { "Uniq", TR_ESP_UNIQUE, -1 },
927 static flag_insc_table flag_insc_esp2[] =
929 { "p", TR_ESP_HUMAN, -1 },
930 { "D", TR_ESP_DRAGON, -1 },
931 { "o", TR_ESP_ORC, -1 },
932 { "T", TR_ESP_TROLL, -1 },
933 { "P", TR_ESP_GIANT, -1 },
934 { "U", TR_ESP_DEMON, -1 },
935 { "L", TR_ESP_UNDEAD, -1 },
936 { "Z", TR_ESP_ANIMAL, -1 },
940 static flag_insc_table flag_insc_sust[] =
942 { "St", TR_SUST_STR, -1 },
943 { "In", TR_SUST_INT, -1 },
944 { "Wi", TR_SUST_WIS, -1 },
945 { "Dx", TR_SUST_DEX, -1 },
946 { "Cn", TR_SUST_CON, -1 },
947 { "Ch", TR_SUST_CHR, -1 },
952 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
953 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
956 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
957 * @param fi_ptr 参照する特性表示記号テーブル
958 * @param flgs 対応するオブジェクトのフラグ文字列
959 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
960 * @param ptr フラグ群を保管する文字列参照ポインタ
961 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
963 * Print an signed number "v" into a string "t", as if by
964 * sprintf(t, "%+d", n), and return a pointer to the terminator.
965 * Note that we always print a sign, either "+" or "-".
967 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
973 while (fi_ptr->english)
975 if (have_flag(flgs, fi_ptr->flag) &&
976 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
978 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
980 ADD_INSC(fi_ptr->english);
990 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
991 * @param fi_ptr 参照する特性表示記号テーブル
992 * @param flgs 対応するオブジェクトのフラグ文字列
993 * @return 1つでも該当の特性があったらTRUEを返す。
995 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
997 while (fi_ptr->english)
999 if (have_flag(flgs, fi_ptr->flag) &&
1000 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1009 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1010 * @param ptr 特性短縮表記を格納する文字列ポインタ
1011 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1012 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1013 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1014 * @return ptrと同じアドレス
1016 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1018 char *prev_ptr = ptr;
1019 BIT_FLAGS flgs[TR_FLAG_SIZE];
1020 object_flags(o_ptr, flgs);
1022 /* Remove obvious flags */
1025 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1029 for (j = 0; j < TR_FLAG_SIZE; j++)
1030 flgs[j] &= ~k_ptr->flags[j];
1032 if (object_is_fixed_artifact(o_ptr))
1034 artifact_type *a_ptr = &a_info[o_ptr->name1];
1036 for (j = 0; j < TR_FLAG_SIZE; j++)
1037 flgs[j] &= ~a_ptr->flags[j];
1040 if (object_is_ego(o_ptr))
1042 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1044 for (j = 0; j < TR_FLAG_SIZE; j++)
1045 flgs[j] &= ~e_ptr->flags[j];
1049 /* Remove lite flags when this is a dark lite object */
1050 if (have_dark_flag(flgs))
1052 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1053 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1054 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1056 else if (have_lite_flag(flgs))
1058 add_flag(flgs, TR_LITE_1);
1059 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1060 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1064 if (have_flag_of(flag_insc_plus, flgs))
1069 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1072 if (have_flag_of(flag_insc_immune, flgs))
1074 if (!kanji && ptr != prev_ptr)
1081 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1084 if (have_flag_of(flag_insc_resistance, flgs))
1088 else if (ptr != prev_ptr)
1094 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1097 if (have_flag_of(flag_insc_misc, flgs))
1099 if (ptr != prev_ptr)
1105 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1108 if (have_flag_of(flag_insc_aura, flgs))
1112 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1115 if (have_flag_of(flag_insc_brand, flgs))
1117 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1120 if (have_flag_of(flag_insc_kill, flgs))
1122 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1125 if (have_flag_of(flag_insc_slay, flgs))
1127 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1132 if (have_flag_of(flag_insc_esp1, flgs) ||
1133 have_flag_of(flag_insc_esp2, flgs))
1135 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1136 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1140 if (have_flag_of(flag_insc_esp1, flgs))
1142 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1143 if (have_flag_of(flag_insc_esp2, flgs))
1145 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1149 if (have_flag_of(flag_insc_sust, flgs))
1153 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1162 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1163 * @param buff 特性短縮表記を格納する文字列ポインタ
1164 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1167 static void get_inscription(char *buff, object_type *o_ptr)
1169 concptr insc = quark_str(o_ptr->inscription);
1172 /* Not fully identified */
1173 if (!(o_ptr->ident & IDENT_MENTAL))
1175 /* Copy until end of line or '#' */
1178 if (*insc == '#') break;
1180 if (iskanji(*insc)) *buff++ = *insc++;
1190 for (; *insc; insc++)
1192 /* Ignore fake artifact inscription */
1193 if (*insc == '#') break;
1195 /* {%} will be automatically converted */
1196 else if ('%' == *insc)
1200 concptr start = ptr;
1202 /* check for too long inscription */
1203 if (ptr >= buff + MAX_NLEN) continue;
1216 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1226 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1241 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1242 * @param buf 表記を返すための文字列参照ポインタ
1243 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1244 * @param mode 表記に関するオプション指定
1245 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1247 * One can choose the "verbosity" of the description, including whether\n
1248 * or not the "number" of items should be described, and how much detail\n
1249 * should be used when describing the item.\n
1251 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1252 * description, which can get pretty long, including incriptions, such as:\n
1253 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1254 * Note that the inscription will be clipped to keep the total description\n
1255 * under MAX_NLEN-1 chars (plus a terminator).\n
1257 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1258 * portable, versions of some common "sprintf()" commands.\n
1260 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1261 * the item is also an artifact, which should NEVER happen.\n
1263 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1264 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1265 * The "Specials" never use "modifiers" if they are "known", since they\n
1266 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1268 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1269 * plus the artifact name, just like any other artifact, if known.\n
1271 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1272 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1273 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1274 * they will append the artifact name, just like any artifact, if known.\n
1276 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1279 * OD_NAME_ONLY : The Cloak of Death\n
1280 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1281 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1282 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1284 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1285 * OD_NO_PLURAL : Forbidden use of plural \n
1286 * OD_STORE : Assume to be aware and known\n
1287 * OD_NO_FLAVOR : Allow to hidden flavor\n
1288 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1290 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1292 /* Extract object kind name */
1293 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1295 /* Extract default "base" string */
1296 concptr basenm = kindname;
1298 /* Assume no "modifier" string */
1299 concptr modstr = "";
1308 bool show_weapon = FALSE;
1309 bool show_armour = FALSE;
1314 char p1 = '(', p2 = ')';
1315 char b1 = '[', b2 = ']';
1316 char c1 = '{', c2 = '}';
1318 char tmp_val[MAX_NLEN+160];
1319 char tmp_val2[MAX_NLEN+10];
1320 char fake_insc_buf[30];
1322 BIT_FLAGS flgs[TR_FLAG_SIZE];
1324 object_type *bow_ptr;
1326 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1327 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1329 /* Extract some flags */
1330 object_flags(o_ptr, flgs);
1332 /* See if the object is "aware" */
1333 if (object_is_aware(o_ptr)) aware = TRUE;
1335 /* See if the object is "known" */
1336 if (object_is_known(o_ptr)) known = TRUE;
1338 /* Allow flavors to be hidden when aware */
1339 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1341 /* Object is in the inventory of a store or spoiler */
1342 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1344 /* Don't show flavors */
1347 /* Pretend known and aware */
1352 /* Force to be flavor name only */
1353 if (mode & OD_FORCE_FLAVOR)
1359 /* Cancel shuffling */
1360 flavor_k_ptr = k_ptr;
1363 /* Analyze the object */
1364 switch (o_ptr->tval)
1366 /* Some objects are easy to describe */
1380 monster_race *r_ptr = &r_info[o_ptr->pval];
1386 modstr = _(" (空)", " (empty)");
1391 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1394 concptr t = r_name + r_ptr->name;
1396 if (!(r_ptr->flags1 & RF1_UNIQUE))
1398 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1404 sprintf(tmp_val2, "(%s)", t);
1414 /* Figurines/Statues */
1418 monster_race *r_ptr = &r_info[o_ptr->pval];
1421 modstr = r_name + r_ptr->name;
1423 concptr t = r_name + r_ptr->name;
1425 if (!(r_ptr->flags1 & RF1_UNIQUE))
1427 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1444 monster_race *r_ptr = &r_info[o_ptr->pval];
1446 modstr = r_name + r_ptr->name;
1451 if (r_ptr->flags1 & RF1_UNIQUE)
1452 basenm = "& % of #";
1460 /* Missiles/ Bows/ Weapons */
1489 /* Lites (including a few "Specials") */
1495 /* Amulets (including a few "Specials") */
1498 /* Known artifacts */
1501 if (object_is_fixed_artifact(o_ptr)) break;
1502 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1505 /* Color the object */
1506 modstr = k_name + flavor_k_ptr->flavor_name;
1509 if (!flavor) basenm = "%のアミュレット";
1510 else if (aware) basenm = "%の#アミュレット";
1511 else basenm = "#アミュレット";
1513 if (!flavor) basenm = "& Amulet~ of %";
1514 else if (aware) basenm = "& # Amulet~ of %";
1515 else basenm = "& # Amulet~";
1521 /* Rings (including a few "Specials") */
1524 /* Known artifacts */
1527 if (object_is_fixed_artifact(o_ptr)) break;
1528 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1531 /* Color the object */
1532 modstr = k_name + flavor_k_ptr->flavor_name;
1535 if (!flavor) basenm = "%の指輪";
1536 else if (aware) basenm = "%の#指輪";
1537 else basenm = "#指輪";
1539 if (!flavor) basenm = "& Ring~ of %";
1540 else if (aware) basenm = "& # Ring~ of %";
1541 else basenm = "& # Ring~";
1544 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1556 /* Color the object */
1557 modstr = k_name + flavor_k_ptr->flavor_name;
1560 if (!flavor) basenm = "%の杖";
1561 else if (aware) basenm = "%の#杖";
1564 if (!flavor) basenm = "& Staff~ of %";
1565 else if (aware) basenm = "& # Staff~ of %";
1566 else basenm = "& # Staff~";
1574 /* Color the object */
1575 modstr = k_name + flavor_k_ptr->flavor_name;
1578 if (!flavor) basenm = "%の魔法棒";
1579 else if (aware) basenm = "%の#魔法棒";
1580 else basenm = "#魔法棒";
1582 if (!flavor) basenm = "& Wand~ of %";
1583 else if (aware) basenm = "& # Wand~ of %";
1584 else basenm = "& # Wand~";
1592 /* Color the object */
1593 modstr = k_name + flavor_k_ptr->flavor_name;
1596 if (!flavor) basenm = "%のロッド";
1597 else if (aware) basenm = "%の#ロッド";
1598 else basenm = "#ロッド";
1600 if (!flavor) basenm = "& Rod~ of %";
1601 else if (aware) basenm = "& # Rod~ of %";
1602 else basenm = "& # Rod~";
1610 /* Color the object */
1611 modstr = k_name + flavor_k_ptr->flavor_name;
1614 if (!flavor) basenm = "%の巻物";
1615 else if (aware) basenm = "「#」と書かれた%の巻物";
1616 else basenm = "「#」と書かれた巻物";
1618 if (!flavor) basenm = "& Scroll~ of %";
1619 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1620 else basenm = "& Scroll~ titled \"#\"";
1628 /* Color the object */
1629 modstr = k_name + flavor_k_ptr->flavor_name;
1632 if (!flavor) basenm = "%の薬";
1633 else if (aware) basenm = "%の#薬";
1636 if (!flavor) basenm = "& Potion~ of %";
1637 else if (aware) basenm = "& # Potion~ of %";
1638 else basenm = "& # Potion~";
1646 /* Ordinary food is "boring" */
1647 if (!k_ptr->flavor_name) break;
1649 /* Color the object */
1650 modstr = k_name + flavor_k_ptr->flavor_name;
1653 if (!flavor) basenm = "%のキノコ";
1654 else if (aware) basenm = "%の#キノコ";
1655 else basenm = "#キノコ";
1657 if (!flavor) basenm = "& Mushroom~ of %";
1658 else if (aware) basenm = "& # Mushroom~ of %";
1659 else basenm = "& # Mushroom~";
1667 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1677 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1678 basenm = "& Book~ of Life Magic %";
1680 basenm = "& Life Spellbook~ %";
1686 case TV_SORCERY_BOOK:
1691 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1692 basenm = "& Book~ of Sorcery %";
1694 basenm = "& Sorcery Spellbook~ %";
1700 case TV_NATURE_BOOK:
1705 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1706 basenm = "& Book~ of Nature Magic %";
1708 basenm = "& Nature Spellbook~ %";
1717 basenm = "カオスの魔法書%";
1719 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1720 basenm = "& Book~ of Chaos Magic %";
1722 basenm = "& Chaos Spellbook~ %";
1733 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1734 basenm = "& Book~ of Death Magic %";
1736 basenm = "& Death Spellbook~ %";
1745 basenm = "トランプの魔法書%";
1747 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1748 basenm = "& Book~ of Trump Magic %";
1750 basenm = "& Trump Spellbook~ %";
1756 case TV_ARCANE_BOOK:
1761 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1762 basenm = "& Book~ of Arcane Magic %";
1764 basenm = "& Arcane Spellbook~ %";
1775 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1776 basenm = "& Book~ of Craft Magic %";
1778 basenm = "& Craft Spellbook~ %";
1784 case TV_DAEMON_BOOK:
1789 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1790 basenm = "& Book~ of Daemon Magic %";
1792 basenm = "& Daemon Spellbook~ %";
1798 case TV_CRUSADE_BOOK:
1803 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1804 basenm = "& Book~ of Crusade Magic %";
1806 basenm = "& Crusade Spellbook~ %";
1814 basenm = _("歌集%", "& Song Book~ %");
1818 case TV_HISSATSU_BOOK:
1820 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1829 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1830 basenm = "& Book~ of Hex Magic %";
1832 basenm = "& Hex Spellbook~ %";
1838 /* Hack -- Gold/Gems */
1841 strcpy(buf, basenm);
1845 /* Used in the "inventory" routine */
1848 strcpy(buf, _("(なし)", "(nothing)"));
1853 /* Use full name from k_info or a_info */
1854 if (aware && have_flag(flgs, TR_FULL_NAME))
1856 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1857 else basenm = kindname;
1860 /* Start dumping the result */
1864 if (basenm[0] == '&')
1870 if (mode & OD_OMIT_PREFIX)
1874 else if (o_ptr->number > 1)
1876 t = object_desc_kosuu(t, o_ptr);
1877 t = object_desc_str(t, "の ");
1880 /* 英語の場合アーティファクトは The が付くので分かるが
1881 * 日本語では分からないのでマークをつける
1885 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1886 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1891 /* The object "expects" a "number" */
1892 if (basenm[0] == '&')
1894 /* Skip the ampersand (and space) */
1898 if (mode & OD_OMIT_PREFIX)
1903 /* Hack -- None left */
1904 else if (o_ptr->number <= 0)
1906 t = object_desc_str(t, "no more ");
1909 /* Extract the number */
1910 else if (o_ptr->number > 1)
1912 t = object_desc_num(t, o_ptr->number);
1913 t = object_desc_chr(t, ' ');
1916 /* Hack -- The only one of its kind */
1917 else if ((known && object_is_artifact(o_ptr)) ||
1918 ((o_ptr->tval == TV_CORPSE) &&
1919 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1921 t = object_desc_str(t, "The ");
1931 case '#': vowel = is_a_vowel(modstr[0]); break;
1932 case '%': vowel = is_a_vowel(*kindname); break;
1933 default: vowel = is_a_vowel(*s); break;
1938 /* A single one, with a vowel */
1939 t = object_desc_str(t, "an ");
1943 /* A single one, without a vowel */
1944 t = object_desc_str(t, "a ");
1949 /* Hack -- objects that "never" take an article */
1956 if (mode & OD_OMIT_PREFIX)
1961 /* Hack -- all gone */
1962 else if (o_ptr->number <= 0)
1964 t = object_desc_str(t, "no more ");
1967 /* Prefix a number if required */
1968 else if (o_ptr->number > 1)
1970 t = object_desc_num(t, o_ptr->number);
1971 t = object_desc_chr(t, ' ');
1974 /* Hack -- The only one of its kind */
1975 else if (known && object_is_artifact(o_ptr))
1977 t = object_desc_str(t, "The ");
1980 /* Hack -- single items get no prefix */
1988 /* Paranoia -- skip illegal tildes */
1989 /* while (*s == '~') s++; */
1992 if (object_is_smith(o_ptr))
1994 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
1997 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2001 if (o_ptr->art_name)
2003 concptr temp = quark_str(o_ptr->art_name);
2005 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2006 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2007 if (strncmp(temp, "of ", 3) == 0)
2009 t = object_desc_str(t, &temp[3]);
2010 t = object_desc_str(t, "の");
2012 else if ((strncmp(temp, "『", 2) != 0) &&
2013 (strncmp(temp, "《", 2) != 0) &&
2015 t = object_desc_str(t, temp);
2018 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2020 artifact_type *a_ptr = &a_info[o_ptr->name1];
2021 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2022 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2024 t = object_desc_str(t, a_name + a_ptr->name);
2028 else if (object_is_ego(o_ptr))
2030 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2031 t = object_desc_str(t, e_name + e_ptr->name);
2036 /* Copy the string */
2037 for (s0 = NULL; *s || s0; )
2039 /* The end of the flavour/kind string. */
2046 /* Begin to append the modifier (flavor) */
2047 else if ((*s == '#') && !s0)
2052 /* Paranoia -- Never append multiple modstrs */
2056 /* Begin to append the kind name */
2057 else if ((*s == '%') && !s0)
2062 /* Paranoia -- Never append multiple kindnames */
2070 /* Add a plural if needed */
2071 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2077 /* Hack -- "Cutlass-es" and "Torch-es" */
2078 if ((k == 's') || (k == 'h')) *t++ = 'e';
2100 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2103 /* ランダムアーティファクトの名前はセーブファイルに記録
2104 されるので、英語版の名前もそれらしく変換する */
2105 if (o_ptr->art_name)
2109 strcpy(temp, quark_str(o_ptr->art_name));
2110 /* MEGA HACK by ita */
2111 if (strncmp(temp, "『", 2) == 0 ||
2112 strncmp(temp, "《", 2) == 0)
2113 t = object_desc_str(t, temp);
2114 else if (temp[0] == '\'')
2116 itemp = strlen(temp);
2117 temp[itemp - 1] = 0;
2118 t = object_desc_str(t, "『");
2119 t = object_desc_str(t, &temp[1]);
2120 t = object_desc_str(t, "』");
2123 else if (object_is_fixed_artifact(o_ptr))
2125 artifact_type *a_ptr = &a_info[o_ptr->name1];
2126 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2128 t = object_desc_str(t, a_name + a_ptr->name);
2131 else if (o_ptr->inscription)
2133 concptr str = quark_str(o_ptr->inscription);
2142 if (*str == '#') break;
2148 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2150 /* Add the false name */
2151 t = object_desc_str(t,"『");
2152 t = object_desc_str(t, &str_aux[1]);
2153 t = object_desc_str(t,"』");
2158 if (object_is_smith(o_ptr))
2160 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2163 /* Hack -- Append "Artifact" or "Special" names */
2164 if (known && !have_flag(flgs, TR_FULL_NAME))
2166 /* Is it a new random artifact ? */
2167 if (o_ptr->art_name)
2169 t = object_desc_chr(t, ' ');
2170 t = object_desc_str(t, quark_str(o_ptr->art_name));
2173 /* Grab any artifact name */
2174 else if (object_is_fixed_artifact(o_ptr))
2176 artifact_type *a_ptr = &a_info[o_ptr->name1];
2178 t = object_desc_chr(t, ' ');
2179 t = object_desc_str(t, a_name + a_ptr->name);
2182 /* Grab any ego-item name */
2185 if (object_is_ego(o_ptr))
2187 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2189 t = object_desc_chr(t, ' ');
2190 t = object_desc_str(t, e_name + e_ptr->name);
2193 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2196 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2198 /* Add the false name */
2199 t = object_desc_chr(t, ' ');
2200 t = object_desc_str(t, &str[1]);
2207 /* No more details wanted */
2208 if (mode & OD_NAME_ONLY) goto object_desc_done;
2210 /* Hack -- Chests must be described in detail */
2211 if (o_ptr->tval == TV_CHEST)
2213 /* Not searched yet */
2219 /* May be "empty" */
2220 else if (!o_ptr->pval)
2222 t = object_desc_str(t, _("(空)", " (empty)"));
2225 /* May be "disarmed" */
2226 else if (o_ptr->pval < 0)
2228 if (chest_traps[0 - o_ptr->pval])
2230 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2234 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2238 /* Describe the traps, if any */
2241 /* Describe the traps */
2242 switch (chest_traps[o_ptr->pval])
2246 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2249 case CHEST_LOSE_STR:
2251 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2254 case CHEST_LOSE_CON:
2256 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2261 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2264 case CHEST_PARALYZE:
2266 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2271 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2275 case CHEST_BIRD_STORM:
2276 case CHEST_E_SUMMON:
2277 case CHEST_H_SUMMON:
2279 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2282 case CHEST_RUNES_OF_EVIL:
2284 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2289 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2294 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2302 /* Display the item like a weapon */
2303 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2305 /* Display the item like a weapon */
2306 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2309 /* Display the item like a weapon */
2310 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2312 /* Display the item like armour */
2313 if (o_ptr->ac) show_armour = TRUE;
2316 /* Dump base weapon info */
2317 switch (o_ptr->tval)
2319 /* Missiles and Weapons */
2328 /* In Vault Quest, hide the dice of target weapon. */
2329 if(object_is_quest_target(o_ptr) && !known)
2334 /* Append a "damage" string */
2335 t = object_desc_chr(t, ' ');
2336 t = object_desc_chr(t, p1);
2337 t = object_desc_num(t, o_ptr->dd);
2338 t = object_desc_chr(t, 'd');
2339 t = object_desc_num(t, o_ptr->ds);
2340 t = object_desc_chr(t, p2);
2346 /* Bows get a special "damage string" */
2349 /* Mega-Hack -- Extract the "base power" */
2350 power = bow_tmul(o_ptr->sval);
2352 /* Apply the "Extra Might" flag */
2353 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2355 /* Append a special "damage" string */
2356 t = object_desc_chr(t, ' ');
2357 t = object_desc_chr(t, p1);
2358 t = object_desc_chr(t, 'x');
2359 t = object_desc_num(t, power);
2360 t = object_desc_chr(t, p2);
2362 fire_rate = calc_num_fire(o_ptr);
2363 /* Show Fire rate */
2364 if (fire_rate != 0 && power > 0 && known)
2366 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2368 t = object_desc_chr(t, ' ');
2369 t = object_desc_chr(t, p1);
2370 t = object_desc_num(t, fire_rate/100);
2371 t = object_desc_chr(t, '.');
2372 t = object_desc_num(t, fire_rate%100);
2373 t = object_desc_str(t, "turn");
2374 t = object_desc_chr(t, p2);
2382 /* Add the weapon bonuses */
2385 /* Show the tohit/todam on request */
2388 t = object_desc_chr(t, ' ');
2389 t = object_desc_chr(t, p1);
2390 t = object_desc_int(t, o_ptr->to_h);
2391 t = object_desc_chr(t, ',');
2392 t = object_desc_int(t, o_ptr->to_d);
2393 t = object_desc_chr(t, p2);
2396 /* Show the tohit if needed */
2397 else if (o_ptr->to_h)
2399 t = object_desc_chr(t, ' ');
2400 t = object_desc_chr(t, p1);
2401 t = object_desc_int(t, o_ptr->to_h);
2402 t = object_desc_chr(t, p2);
2405 /* Show the todam if needed */
2406 else if (o_ptr->to_d)
2408 t = object_desc_chr(t, ' ');
2409 t = object_desc_chr(t, p1);
2410 t = object_desc_int(t, o_ptr->to_d);
2411 t = object_desc_chr(t, p2);
2415 bow_ptr = &inventory[INVEN_BOW];
2417 /* If have a firing weapon + ammo matches bow */
2418 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2420 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2421 int tmul = bow_tmul(bow_ptr->sval);
2422 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2424 /* See if the bow is "known" - then set damage bonus */
2425 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2427 /* Effect of ammo */
2428 if (known) avgdam += (o_ptr->to_d * 10);
2430 /* Get extra "power" from "extra might" */
2431 if (p_ptr->xtra_might) tmul++;
2433 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2435 /* Launcher multiplier */
2437 avgdam /= (100 * 10);
2439 /* Get extra damage from concentration */
2440 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2442 if (avgdam < 0) avgdam = 0;
2444 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2445 t = object_desc_chr(t, ' ');
2446 t = object_desc_chr(t, p1);
2448 if(show_ammo_no_crit)
2450 /* Damage with no-crit */
2451 t = object_desc_num(t, avgdam);
2452 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2455 /* Apply Expect damage of Critical */
2456 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2457 t = object_desc_num(t, avgdam);
2459 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2460 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2462 if (p_ptr->num_fire == 0)
2464 t = object_desc_chr(t, '0');
2468 /* Calc effects of energy */
2469 avgdam *= (p_ptr->num_fire * 100);
2470 avgdam /= energy_fire;
2471 t = object_desc_num(t, avgdam);
2472 t = object_desc_str(t, show_ammo_detail ? "/current_world_ptr->game_turn" : "");
2474 if(show_ammo_crit_ratio)
2476 int percent = calc_crit_ratio_shot(known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2478 t = object_desc_chr(t, '/');
2479 t = object_desc_num(t, percent / 100);
2480 t = object_desc_chr(t, '.');
2481 if(percent % 100 < 10)
2483 t = object_desc_chr(t, '0');
2485 t = object_desc_num(t, percent % 100);
2486 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2490 t = object_desc_chr(t, p2);
2492 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2494 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2495 s16b energy_fire = 100 - p_ptr->lev;
2497 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2499 /* Display (shot damage/ avg damage) */
2500 t = object_desc_chr(t, ' ');
2501 t = object_desc_chr(t, p1);
2502 t = object_desc_num(t, avgdam);
2503 t = object_desc_chr(t, '/');
2505 /* Calc effects of energy */
2506 avgdam = 100 * avgdam / energy_fire;
2508 t = object_desc_num(t, avgdam);
2509 t = object_desc_chr(t, p2);
2512 /* Add the armor bonuses */
2515 /* Show the armor class info */
2518 t = object_desc_chr(t, ' ');
2519 t = object_desc_chr(t, b1);
2520 t = object_desc_num(t, o_ptr->ac);
2521 t = object_desc_chr(t, ',');
2522 t = object_desc_int(t, o_ptr->to_a);
2523 t = object_desc_chr(t, b2);
2526 /* No base armor, but does increase armor */
2527 else if (o_ptr->to_a)
2529 t = object_desc_chr(t, ' ');
2530 t = object_desc_chr(t, b1);
2531 t = object_desc_int(t, o_ptr->to_a);
2532 t = object_desc_chr(t, b2);
2536 /* Hack -- always show base armor */
2537 else if (show_armour)
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, b2);
2546 /* No more details wanted */
2547 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2550 if (known) /* Known item only */
2553 * Hack -- Wands and Staffs have charges. Make certain how many charges
2554 * a stack of staffs really has is clear. -LM-
2556 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2558 /* Dump " (N charges)" */
2559 t = object_desc_chr(t, ' ');
2560 t = object_desc_chr(t, p1);
2562 /* Clear explaination for staffs. */
2563 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2565 t = object_desc_num(t, o_ptr->number);
2566 t = object_desc_str(t, "x ");
2568 t = object_desc_num(t, o_ptr->pval);
2570 t = object_desc_str(t, "回分");
2572 t = object_desc_str(t, " charge");
2573 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2576 t = object_desc_chr(t, p2);
2578 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2579 * be in any state of charge or discharge, this now includes a number. -LM-
2581 else if (o_ptr->tval == TV_ROD)
2583 /* Hack -- Dump " (# charging)" if relevant */
2586 /* Stacks of rods display an exact count of charging rods. */
2587 if (o_ptr->number > 1)
2590 if (k_ptr->pval == 0) k_ptr->pval = 1;
2592 /* Find out how many rods are charging, by dividing
2593 * current timeout by each rod's maximum timeout.
2594 * Ensure that any remainder is rounded up. Display
2595 * very discharged stacks as merely fully discharged.
2597 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2598 if (power > o_ptr->number) power = o_ptr->number;
2600 /* Display prettily. */
2601 t = object_desc_str(t, " (");
2602 t = object_desc_num(t, power);
2603 t = object_desc_str(t, _("本 充填中)", " charging)"));
2606 /* "one Rod of Perception (1 charging)" would look tacky. */
2609 t = object_desc_str(t, _("(充填中)", " (charging)"));
2614 /* Dump "pval" flags for wearable items */
2615 if (have_pval_flags(flgs))
2617 /* Start the display */
2618 t = object_desc_chr(t, ' ');
2619 t = object_desc_chr(t, p1);
2621 /* Dump the "pval" itself */
2622 t = object_desc_int(t, o_ptr->pval);
2624 /* Do not display the "pval" flags */
2625 if (have_flag(flgs, TR_HIDE_TYPE))
2630 else if (have_flag(flgs, TR_SPEED))
2632 /* Dump " to speed" */
2633 t = object_desc_str(t, _("加速", " to speed"));
2637 else if (have_flag(flgs, TR_BLOWS))
2641 t = object_desc_str(t, "攻撃");
2643 t = object_desc_str(t, " attack");
2646 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2651 else if (have_flag(flgs, TR_STEALTH))
2653 /* Dump " to stealth" */
2654 t = object_desc_str(t, _("隠密", " to stealth"));
2658 else if (have_flag(flgs, TR_SEARCH))
2660 /* Dump " to searching" */
2661 t = object_desc_str(t, _("探索", " to searching"));
2665 else if (have_flag(flgs, TR_INFRA))
2667 /* Dump " to infravision" */
2668 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2671 /* Finish the display */
2672 t = object_desc_chr(t, p2);
2675 /* Hack -- Process Lanterns/Torches */
2676 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2678 /* Hack -- Turns of light for normal lites */
2680 t = object_desc_chr(t, '(');
2682 t = object_desc_str(t, " (with ");
2685 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2686 else t = object_desc_num(t, o_ptr->xtra4);
2687 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2690 /* Indicate charging objects, but not rods. */
2691 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2693 /* Hack -- Dump " (charging)" if relevant */
2694 t = object_desc_str(t, _("(充填中)", " (charging)"));
2699 /* No more details wanted */
2700 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2703 /* Prepare real inscriptions in a buffer */
2706 /* Auto abbreviation inscribe */
2707 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2709 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2720 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2724 /* Use the standard inscription if available */
2725 if (o_ptr->inscription)
2729 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2731 /* Get inscription and convert {%} */
2732 get_inscription(buff, o_ptr);
2734 /* strcat with correct treating of kanji */
2735 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2739 /* No fake inscription yet */
2740 fake_insc_buf[0] = '\0';
2742 /* Use the game-generated "feeling" otherwise, if available */
2745 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2748 /* Note "cursed" if the item is known to be cursed */
2749 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2751 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2754 /* Note "unidentified" if the item is unidentified */
2755 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2756 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2758 && !(o_ptr->ident & IDENT_SENSE))
2760 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2763 /* Mega-Hack -- note empty wands/staffs */
2764 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2766 strcpy(fake_insc_buf, _("空", "empty"));
2769 /* Note "tried" if the object has been tested unsuccessfully */
2770 else if (!aware && object_is_tried(o_ptr))
2772 strcpy(fake_insc_buf, _("未判明", "tried"));
2775 /* Note the discount, if any */
2776 if (o_ptr->discount)
2778 /* Hidden by real inscription unless in a store */
2779 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2781 char discount_num_buf[4];
2783 /* Append to other fake inscriptions if any */
2784 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2786 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2787 strcat(fake_insc_buf, discount_num_buf);
2788 strcat(fake_insc_buf, _("%引き", "% off"));
2793 /* Append the inscription, if any */
2794 if (fake_insc_buf[0] || tmp_val2[0])
2796 /* Append the inscription */
2797 t = object_desc_chr(t, ' ');
2798 t = object_desc_chr(t, c1);
2800 /* Append fake inscriptions */
2801 if (fake_insc_buf[0])
2803 t = object_desc_str(t, fake_insc_buf);
2806 /* Append a separater */
2807 if (fake_insc_buf[0] && tmp_val2[0])
2809 t = object_desc_chr(t, ',');
2810 t = object_desc_chr(t, ' ');
2813 /* Append real inscriptions */
2816 t = object_desc_str(t, tmp_val2);
2819 t = object_desc_chr(t, c2);
2823 my_strcpy(buf, tmp_val, MAX_NLEN);