2 * @file object-flavor.c
3 * @brief オブジェクトの記述処理 / Mbject flavor code
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
16 #include "cmd-smith.h"
18 #include "player-status.h"
19 #include "player-class.h"
21 #include "objectkind.h"
22 #include "object-hook.h"
23 #include "object-flavor.h"
28 #include "monsterrace.h"
29 #include "object-ego.h"
33 * @brief アイテムの価値記述テーブル
35 const concptr game_inscriptions[] =
39 "壊れている", /* FEEL_BROKEN */
40 "恐ろしい", /* FEEL_TERRIBLE */
41 "無価値", /* FEEL_WORTHLESS */
42 "呪われている", /* FEEL_CURSED */
43 "上質以上", /* FEEL_UNCURSED */
44 "並", /* FEEL_AVERAGE */
46 "高級品", /* FEEL_EXCELLENT */
47 "特別製", /* FEEL_SPECIAL */
49 "broken", /* FEEL_BROKEN */
50 "terrible", /* FEEL_TERRIBLE */
51 "worthless", /* FEEL_WORTHLESS */
52 "cursed", /* FEEL_CURSED */
53 "uncursed", /* FEEL_UNCURSED */
54 "average", /* FEEL_AVERAGE */
55 "good", /* FEEL_GOOD */
56 "excellent", /* FEEL_EXCELLENT */
57 "special", /* FEEL_SPECIAL */
64 * @brief 最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
66 * @return 簡易名称を明らかにするならTRUEを返す。
68 * This function is used only by "flavor_init()"
70 static bool object_easy_know(int i)
72 object_kind *k_ptr = &k_info[i];
74 /* Analyze the "tval" */
89 case TV_HISSATSU_BOOK:
106 /* All Food, Potions, Scrolls, Rods */
120 * @brief 各種語彙からランダムな名前を作成する / Create a name from random parts.
121 * @param out_string 作成した名を保管する参照ポインタ
123 * @details 日本語の場合 aname_j.txt 英語の場合確率に応じて
124 * syllables 配列と elvish.txt を組み合わせる。\n
126 void get_table_name_aux(char *out_string)
130 get_rnd_line("aname_j.txt", 1, Syllable);
131 strcpy(out_string, Syllable);
132 get_rnd_line("aname_j.txt", 2, Syllable);
133 strcat(out_string, Syllable);
135 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
137 static concptr syllables[MAX_SYLLABLES] = {
138 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
139 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
140 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
141 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
142 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
143 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
144 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
145 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
146 "kho", "kli", "klis", "la", "lech", "man", "mar",
147 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
148 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
149 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
150 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
151 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
152 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
153 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
154 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
155 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
156 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
157 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
161 int testcounter = randint1(3) + 1;
163 strcpy(out_string, "");
165 if (randint1(3) == 2)
167 while (testcounter--)
168 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
173 testcounter = randint1(2) + 1;
174 while (testcounter--)
176 (void)get_rnd_line("elvish.txt", 0, Syllable);
177 strcat(out_string, Syllable);
181 out_string[0] = toupper(out_string[1]);
183 out_string[16] = '\0';
188 * @brief ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
189 * @param out_string 作成した名を保管する参照ポインタ
191 * @details get_table_name_aux()ほぼ完全に実装を依存している。
193 void get_table_name(char *out_string)
196 get_table_name_aux(buff);
197 sprintf(out_string, _("『%s』", "'%s'"), buff);
201 * @brief ランダムなシンダリン銘を作成する / Make random Sindarin name
202 * @param out_string 作成した名を保管する参照ポインタ
204 * @details sname.txtが語幹の辞書となっている。
206 void get_table_sindarin_aux(char *out_string)
213 get_rnd_line("sname.txt", 1, Syllable);
215 strcpy(tmp, Syllable);
217 strcpy(out_string, Syllable);
220 get_rnd_line("sname.txt", 2, Syllable);
222 strcat(tmp, Syllable);
223 sindarin_to_kana(out_string, tmp);
225 strcat(out_string, Syllable);
230 * @brief シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
231 * @param out_string 作成した名を保管する参照ポインタ
233 * @details get_table_sindarin_aux()ほぼ完全に実装を依存している。
235 void get_table_sindarin(char *out_string)
238 get_table_sindarin_aux(buff);
239 sprintf(out_string, _("『%s』", "'%s'"), buff);
244 * @brief ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
245 * @param tval シャッフルしたいtval
247 * @details 巻物、各種魔道具などに利用される。
249 static void shuffle_flavors(OBJECT_TYPE_VALUE tval)
251 KIND_OBJECT_IDX *k_idx_list;
252 KIND_OBJECT_IDX k_idx_list_num = 0;
255 /* Allocate an array for a list of k_idx */
256 C_MAKE(k_idx_list, max_k_idx, KIND_OBJECT_IDX);
258 /* Search objects with given tval for shuffle */
259 for (i = 0; i < max_k_idx; i++)
261 object_kind *k_ptr = &k_info[i];
264 if (k_ptr->tval != tval) continue;
266 /* Paranoia -- Skip objects without flavor */
267 if (!k_ptr->flavor) continue;
269 /* Skip objects with a fixed flavor name */
270 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
273 k_idx_list[k_idx_list_num] = i;
275 /* Increase number of remembered indices */
279 /* Shuffle flavors */
280 for (i = 0; i < k_idx_list_num; i++)
282 object_kind *k1_ptr = &k_info[k_idx_list[i]];
283 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
285 /* Swap flavors of this pair */
286 s16b tmp = k1_ptr->flavor;
287 k1_ptr->flavor = k2_ptr->flavor;
288 k2_ptr->flavor = tmp;
291 /* Free an array for a list of k_idx */
292 C_KILL(k_idx_list, max_k_idx, s16b);
296 * @brief ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
299 * Prepare the "variable" part of the "k_info" array.\n
301 * The "color"/"metal"/"type" of an item is its "flavor".\n
302 * For the most part, flavors are assigned randomly each game.\n
304 * Initialize descriptions for the "colored" objects, including:\n
305 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
307 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
308 * Slime Mold Juice, Unused Potion).\n
310 * Scroll titles are always between 6 and 14 letters long. This is\n
311 * ensured because every title is composed of whole words, where every\n
312 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
313 * letters each), and that no scroll is finished until it attempts to\n
314 * grow beyond 15 letters. The first time this can happen is when the\n
315 * current title has 6 letters and the new word has 8 letters, which\n
316 * would result in a 6 letter scroll title.\n
318 * Duplicate titles are avoided by requiring that no two scrolls share\n
319 * the same first four letters (not the most efficient method, and not\n
320 * the least efficient method, but it will always work).\n
322 * Hack -- make sure everything stays the same for each saved game\n
323 * This is accomplished by the use of a saved "random seed", as in\n
324 * "town_gen()". Since no other functions are called while the special\n
325 * seed is in effect, so this function is pretty "safe".\n
327 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
329 void flavor_init(void)
332 u32b state_backup[4];
334 /* Hack -- Backup the RNG state */
335 Rand_state_backup(state_backup);
337 /* Hack -- Induce consistant flavors */
338 Rand_state_set(current_world_ptr->seed_flavor);
341 /* Initialize flavor index of each object by itself */
342 for (i = 0; i < max_k_idx; i++)
344 object_kind *k_ptr = &k_info[i];
346 /* Skip objects without flavor name */
347 if (!k_ptr->flavor_name) continue;
350 * Initialize flavor index to itself
351 * -> Shuffle it later
357 shuffle_flavors(TV_RING);
359 /* Shuffle Amulets */
360 shuffle_flavors(TV_AMULET);
363 shuffle_flavors(TV_STAFF);
366 shuffle_flavors(TV_WAND);
369 shuffle_flavors(TV_ROD);
371 /* Shuffle Mushrooms */
372 shuffle_flavors(TV_FOOD);
374 /* Shuffle Potions */
375 shuffle_flavors(TV_POTION);
377 /* Shuffle Scrolls */
378 shuffle_flavors(TV_SCROLL);
381 /* Hack -- Restore the RNG state */
382 Rand_state_restore(state_backup);
384 /* Analyze every object */
385 for (i = 1; i < max_k_idx; i++)
387 object_kind *k_ptr = &k_info[i];
389 /* Skip "empty" objects */
390 if (!k_ptr->name) continue;
392 /* No flavor yields aware */
393 if (!k_ptr->flavor) k_ptr->aware = TRUE;
395 /* Check for "easily known" */
396 k_ptr->easy_know = object_easy_know(i);
402 * @brief 対象文字配列に一文字だけをコピーする。
403 * @param t 保管先文字列ポインタ
407 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
408 * and return a pointer to the terminator (t + 1).\n
410 static char *object_desc_chr(char *t, char c)
421 * @brief 対象文字配列に文字列をコピーする。
422 * @param t 保管先文字列ポインタ
423 * @param s コピーしたい文字列ポインタ
426 * Print a string "s" into a string "t", as if by strcpy(t, s),
427 * and return a pointer to the terminator.
429 static char *object_desc_str(char *t, concptr s)
431 /* Copy the string */
432 while (*s) *t++ = *s++;
440 * @brief 対象文字配列に符号なし整数値をコピーする。
441 * @param t 保管先文字列ポインタ
445 * Print an unsigned number "n" into a string "t", as if by
446 * sprintf(t, "%u", n), and return a pointer to the terminator.
448 static char *object_desc_num(char *t, uint n)
452 /* Find "size" of "n" */
453 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
455 /* Dump each digit */
461 /* Remove the digit */
464 /* Process next digit */
478 * @brief 日本語の個数表示ルーチン
479 * @param t 保管先文字列ポインタ
480 * @param o_ptr 記述したいオブジェクトの構造体参照ポインタ
483 * cmd1.c で流用するために object_desc_japanese から移動した。
485 char *object_desc_kosuu(char *t, object_type *o_ptr)
487 t = object_desc_num(t, o_ptr->number);
499 t = object_desc_str(t, "本");
504 t = object_desc_str(t, "巻");
509 t = object_desc_str(t, "服");
513 case TV_SORCERY_BOOK:
521 case TV_CRUSADE_BOOK:
523 case TV_HISSATSU_BOOK:
526 t = object_desc_str(t, "冊");
534 t = object_desc_str(t, "着");
541 t = object_desc_str(t, "振");
546 t = object_desc_str(t, "足");
551 t = object_desc_str(t, "枚");
557 if(o_ptr->sval == SV_FOOD_JERKY)
559 t = object_desc_str(t, "切れ");
565 if (o_ptr->number < 10)
567 t = object_desc_str(t, "つ");
571 t = object_desc_str(t, "個");
581 * @brief 対象文字配列に符号あり整数値をコピーする。
582 * @param t 保管先文字列ポインタ
586 * Print an signed number "v" into a string "t", as if by
587 * sprintf(t, "%+d", n), and return a pointer to the terminator.
588 * Note that we always print a sign, either "+" or "-".
590 static char *object_desc_int(char *t, sint v)
597 /* Take the absolute value */
600 /* Use a "minus" sign */
604 /* Positive (or zero) */
607 /* Use the actual number */
610 /* Use a "plus" sign */
614 /* Find "size" of "n" */
615 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
617 /* Dump each digit */
623 /* Remove the digit */
626 /* Process next digit */
637 * オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
639 typedef struct flag_insc_table
650 /*! オブジェクトの特性表示記号テーブルの定義(pval要素) */
651 static flag_insc_table flag_insc_plus[] =
653 { "攻", "At", TR_BLOWS, -1 },
654 { "速", "Sp", TR_SPEED, -1 },
655 { "腕", "St", TR_STR, -1 },
656 { "知", "In", TR_INT, -1 },
657 { "賢", "Wi", TR_WIS, -1 },
658 { "器", "Dx", TR_DEX, -1 },
659 { "耐", "Cn", TR_CON, -1 },
660 { "魅", "Ch", TR_CHR, -1 },
661 { "道", "Md", TR_MAGIC_MASTERY, -1 },
662 { "隠", "Sl", TR_STEALTH, -1 },
663 { "探", "Sr", TR_SEARCH, -1 },
664 { "赤", "If", TR_INFRA, -1 },
665 { "掘", "Dg", TR_TUNNEL, -1 },
666 { NULL, NULL, 0, -1 }
669 /*! オブジェクトの特性表示記号テーブルの定義(免疫) */
670 static flag_insc_table flag_insc_immune[] =
672 { "酸", "Ac", TR_IM_ACID, -1 },
673 { "電", "El", TR_IM_ELEC, -1 },
674 { "火", "Fi", TR_IM_FIRE, -1 },
675 { "冷", "Co", TR_IM_COLD, -1 },
676 { NULL, NULL, 0, -1 }
679 /*! オブジェクトの特性表示記号テーブルの定義(耐性) */
680 static flag_insc_table flag_insc_resistance[] =
682 { "酸", "Ac", TR_RES_ACID, TR_IM_ACID },
683 { "電", "El", TR_RES_ELEC, TR_IM_ELEC },
684 { "火", "Fi", TR_RES_FIRE, TR_IM_FIRE },
685 { "冷", "Co", TR_RES_COLD, TR_IM_COLD },
686 { "毒", "Po", TR_RES_POIS, -1 },
687 { "閃", "Li", TR_RES_LITE, -1 },
688 { "暗", "Dk", TR_RES_DARK, -1 },
689 { "破", "Sh", TR_RES_SHARDS, -1 },
690 { "盲", "Bl", TR_RES_BLIND, -1 },
691 { "乱", "Cf", TR_RES_CONF, -1 },
692 { "轟", "So", TR_RES_SOUND, -1 },
693 { "獄", "Nt", TR_RES_NETHER, -1 },
694 { "因", "Nx", TR_RES_NEXUS, -1 },
695 { "沌", "Ca", TR_RES_CHAOS, -1 },
696 { "劣", "Di", TR_RES_DISEN, -1 },
697 { "恐", "Fe", TR_RES_FEAR, -1 },
698 { NULL, NULL, 0, -1 }
701 /*! オブジェクトの特性表示記号テーブルの定義(その他特性) */
702 static flag_insc_table flag_insc_misc[] =
704 { "易", "Es", TR_EASY_SPELL, -1 },
705 { "減", "Dm", TR_DEC_MANA, -1 },
706 { "投", "Th", TR_THROW, -1 },
707 { "反", "Rf", TR_REFLECT, -1 },
708 { "麻", "Fa", TR_FREE_ACT, -1 },
709 { "視", "Si", TR_SEE_INVIS, -1 },
710 { "経", "Hl", TR_HOLD_EXP, -1 },
711 { "遅", "Sd", TR_SLOW_DIGEST, -1 },
712 { "活", "Rg", TR_REGEN, -1 },
713 { "浮", "Lv", TR_LEVITATION, -1 },
714 { "明", "Lu", TR_LITE_1, -1 },
715 { "明", "Lu", TR_LITE_2, -1 },
716 { "明", "Lu", TR_LITE_3, -1 },
717 { "闇", "Dl", TR_LITE_M1, -1 },
718 { "闇", "Dl", TR_LITE_M2, -1 },
719 { "闇", "Dl", TR_LITE_M3, -1 },
720 { "警", "Wr", TR_WARNING, -1 },
721 { "倍", "Xm", TR_XTRA_MIGHT, -1 },
722 { "射", "Xs", TR_XTRA_SHOTS, -1 },
723 { "瞬", "Te", TR_TELEPORT, -1 },
724 { "怒", "Ag", TR_AGGRAVATE, -1 },
725 { "祝", "Bs", TR_BLESSED, -1 },
726 { "忌", "Ty", TR_TY_CURSE, -1 },
727 { "呪", "C-", TR_ADD_L_CURSE, -1 },
728 { "詛", "C+", TR_ADD_H_CURSE, -1 },
729 { NULL, NULL, 0, -1 }
732 /*! オブジェクトの特性表示記号テーブルの定義(オーラ) */
733 static flag_insc_table flag_insc_aura[] =
735 { "炎", "F", TR_SH_FIRE, -1 },
736 { "電", "E", TR_SH_ELEC, -1 },
737 { "冷", "C", TR_SH_COLD, -1 },
738 { "魔", "M", TR_NO_MAGIC, -1 },
739 { "瞬", "T", TR_NO_TELE, -1 },
740 { NULL, NULL, 0, -1 }
743 /*! オブジェクトの特性表示記号テーブルの定義(属性スレイ) */
744 static flag_insc_table flag_insc_brand[] =
746 { "酸", "A", TR_BRAND_ACID, -1 },
747 { "電", "E", TR_BRAND_ELEC, -1 },
748 { "焼", "F", TR_BRAND_FIRE, -1 },
749 { "凍", "Co", TR_BRAND_COLD, -1 },
750 { "毒", "P", TR_BRAND_POIS, -1 },
751 { "沌", "Ca", TR_CHAOTIC, -1 },
752 { "吸", "V", TR_VAMPIRIC, -1 },
753 { "震", "Q", TR_IMPACT, -1 },
754 { "切", "S", TR_VORPAL, -1 },
755 { "理", "M", TR_FORCE_WEAPON, -1 },
756 { NULL, NULL, 0, -1 }
759 /*! オブジェクトの特性表示記号テーブルの定義(種族スレイ) */
760 static flag_insc_table flag_insc_kill[] =
762 { "邪", "*", TR_KILL_EVIL, -1 },
763 { "人", "p", TR_KILL_HUMAN, -1 },
764 { "龍", "D", TR_KILL_DRAGON, -1 },
765 { "オ", "o", TR_KILL_ORC, -1 },
766 { "ト", "T", TR_KILL_TROLL, -1 },
767 { "巨", "P", TR_KILL_GIANT, -1 },
768 { "デ", "U", TR_KILL_DEMON, -1 },
769 { "死", "L", TR_KILL_UNDEAD, -1 },
770 { "動", "Z", TR_KILL_ANIMAL, -1 },
771 { NULL, NULL, 0, -1 }
774 /*! オブジェクトの特性表示記号テーブルの定義(種族*スレイ*) */
775 static flag_insc_table flag_insc_slay[] =
777 { "邪", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
778 { "人", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
779 { "竜", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
780 { "オ", "o", TR_SLAY_ORC, TR_KILL_ORC },
781 { "ト", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
782 { "巨", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
783 { "デ", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
784 { "死", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
785 { "動", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
786 { NULL, NULL, 0, -1 }
789 /*! オブジェクトの特性表示記号テーブルの定義(ESP1) */
790 static flag_insc_table flag_insc_esp1[] =
792 { "感", "Tele", TR_TELEPATHY, -1 },
793 { "邪", "Evil", TR_ESP_EVIL, -1 },
794 { "善", "Good", TR_ESP_GOOD, -1 },
795 { "無", "Nolv", TR_ESP_NONLIVING, -1 },
796 { "個", "Uniq", TR_ESP_UNIQUE, -1 },
797 { NULL, NULL, 0, -1 }
800 /*! オブジェクトの特性表示記号テーブルの定義(ESP2) */
801 static flag_insc_table flag_insc_esp2[] =
803 { "人", "p", TR_ESP_HUMAN, -1 },
804 { "竜", "D", TR_ESP_DRAGON, -1 },
805 { "オ", "o", TR_ESP_ORC, -1 },
806 { "ト", "T", TR_ESP_TROLL, -1 },
807 { "巨", "P", TR_ESP_GIANT, -1 },
808 { "デ", "U", TR_ESP_DEMON, -1 },
809 { "死", "L", TR_ESP_UNDEAD, -1 },
810 { "動", "Z", TR_ESP_ANIMAL, -1 },
811 { NULL, NULL, 0, -1 }
814 /*! オブジェクトの特性表示記号テーブルの定義(能力維持) */
815 static flag_insc_table flag_insc_sust[] =
817 { "腕", "St", TR_SUST_STR, -1 },
818 { "知", "In", TR_SUST_INT, -1 },
819 { "賢", "Wi", TR_SUST_WIS, -1 },
820 { "器", "Dx", TR_SUST_DEX, -1 },
821 { "耐", "Cn", TR_SUST_CON, -1 },
822 { "魅", "Ch", TR_SUST_CHR, -1 },
823 { NULL, NULL, 0, -1 }
827 static flag_insc_table flag_insc_plus[] =
829 { "At", TR_BLOWS, -1 },
830 { "Sp", TR_SPEED, -1 },
831 { "St", TR_STR, -1 },
832 { "In", TR_INT, -1 },
833 { "Wi", TR_WIS, -1 },
834 { "Dx", TR_DEX, -1 },
835 { "Cn", TR_CON, -1 },
836 { "Ch", TR_CHR, -1 },
837 { "Md", TR_MAGIC_MASTERY, -1 },
838 { "Sl", TR_STEALTH, -1 },
839 { "Sr", TR_SEARCH, -1 },
840 { "If", TR_INFRA, -1 },
841 { "Dg", TR_TUNNEL, -1 },
845 static flag_insc_table flag_insc_immune[] =
847 { "Ac", TR_IM_ACID, -1 },
848 { "El", TR_IM_ELEC, -1 },
849 { "Fi", TR_IM_FIRE, -1 },
850 { "Co", TR_IM_COLD, -1 },
854 static flag_insc_table flag_insc_resistance[] =
856 { "Ac", TR_RES_ACID, TR_IM_ACID },
857 { "El", TR_RES_ELEC, TR_IM_ELEC },
858 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
859 { "Co", TR_RES_COLD, TR_IM_COLD },
860 { "Po", TR_RES_POIS, -1 },
861 { "Li", TR_RES_LITE, -1 },
862 { "Dk", TR_RES_DARK, -1 },
863 { "Sh", TR_RES_SHARDS, -1 },
864 { "Bl", TR_RES_BLIND, -1 },
865 { "Cf", TR_RES_CONF, -1 },
866 { "So", TR_RES_SOUND, -1 },
867 { "Nt", TR_RES_NETHER, -1 },
868 { "Nx", TR_RES_NEXUS, -1 },
869 { "Ca", TR_RES_CHAOS, -1 },
870 { "Di", TR_RES_DISEN, -1 },
871 { "Fe", TR_RES_FEAR, -1 },
875 static flag_insc_table flag_insc_misc[] =
877 { "Es", TR_EASY_SPELL, -1 },
878 { "Dm", TR_DEC_MANA, -1 },
879 { "Th", TR_THROW, -1 },
880 { "Rf", TR_REFLECT, -1 },
881 { "Fa", TR_FREE_ACT, -1 },
882 { "Si", TR_SEE_INVIS, -1 },
883 { "Hl", TR_HOLD_EXP, -1 },
884 { "Sd", TR_SLOW_DIGEST, -1 },
885 { "Rg", TR_REGEN, -1 },
886 { "Lv", TR_LEVITATION, -1 },
887 { "Lu", TR_LITE_1, -1 },
888 { "Lu", TR_LITE_2, -1 },
889 { "Lu", TR_LITE_3, -1 },
890 { "Dl", TR_LITE_M1, -1 },
891 { "Dl", TR_LITE_M2, -1 },
892 { "Dl", TR_LITE_M3, -1 },
893 { "Wr", TR_WARNING, -1 },
894 { "Xm", TR_XTRA_MIGHT, -1 },
895 { "Xs", TR_XTRA_SHOTS, -1 },
896 { "Te", TR_TELEPORT, -1 },
897 { "Ag", TR_AGGRAVATE, -1 },
898 { "Bs", TR_BLESSED, -1 },
899 { "Ty", TR_TY_CURSE, -1 },
900 { "C-", TR_ADD_L_CURSE, -1 },
901 { "C+", TR_ADD_H_CURSE, -1 },
905 static flag_insc_table flag_insc_aura[] =
907 { "F", TR_SH_FIRE, -1 },
908 { "E", TR_SH_ELEC, -1 },
909 { "C", TR_SH_COLD, -1 },
910 { "M", TR_NO_MAGIC, -1 },
911 { "T", TR_NO_TELE, -1 },
915 static flag_insc_table flag_insc_brand[] =
917 { "A", TR_BRAND_ACID, -1 },
918 { "E", TR_BRAND_ELEC, -1 },
919 { "F", TR_BRAND_FIRE, -1 },
920 { "Co", TR_BRAND_COLD, -1 },
921 { "P", TR_BRAND_POIS, -1 },
922 { "Ca", TR_CHAOTIC, -1 },
923 { "V", TR_VAMPIRIC, -1 },
924 { "Q", TR_IMPACT, -1 },
925 { "S", TR_VORPAL, -1 },
926 { "M", TR_FORCE_WEAPON, -1 },
930 static flag_insc_table flag_insc_kill[] =
932 { "*", TR_KILL_EVIL, -1 },
933 { "p", TR_KILL_HUMAN, -1 },
934 { "D", TR_KILL_DRAGON, -1 },
935 { "o", TR_KILL_ORC, -1 },
936 { "T", TR_KILL_TROLL, -1 },
937 { "P", TR_KILL_GIANT, -1 },
938 { "U", TR_KILL_DEMON, -1 },
939 { "L", TR_KILL_UNDEAD, -1 },
940 { "Z", TR_KILL_ANIMAL, -1 },
944 static flag_insc_table flag_insc_slay[] =
946 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
947 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
948 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
949 { "o", TR_SLAY_ORC, TR_KILL_ORC },
950 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
951 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
952 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
953 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
954 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
958 static flag_insc_table flag_insc_esp1[] =
960 { "Tele", TR_TELEPATHY, -1 },
961 { "Evil", TR_ESP_EVIL, -1 },
962 { "Good", TR_ESP_GOOD, -1 },
963 { "Nolv", TR_ESP_NONLIVING, -1 },
964 { "Uniq", TR_ESP_UNIQUE, -1 },
968 static flag_insc_table flag_insc_esp2[] =
970 { "p", TR_ESP_HUMAN, -1 },
971 { "D", TR_ESP_DRAGON, -1 },
972 { "o", TR_ESP_ORC, -1 },
973 { "T", TR_ESP_TROLL, -1 },
974 { "P", TR_ESP_GIANT, -1 },
975 { "U", TR_ESP_DEMON, -1 },
976 { "L", TR_ESP_UNDEAD, -1 },
977 { "Z", TR_ESP_ANIMAL, -1 },
981 static flag_insc_table flag_insc_sust[] =
983 { "St", TR_SUST_STR, -1 },
984 { "In", TR_SUST_INT, -1 },
985 { "Wi", TR_SUST_WIS, -1 },
986 { "Dx", TR_SUST_DEX, -1 },
987 { "Cn", TR_SUST_CON, -1 },
988 { "Ch", TR_SUST_CHR, -1 },
993 /* オブジェクトフラグを追加するための簡易なマクロ / Simple macro for get_inscription() */
994 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
997 * @brief get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
998 * @param fi_ptr 参照する特性表示記号テーブル
999 * @param flgs 対応するオブジェクトのフラグ文字列
1000 * @param kanji TRUEならば漢字記述/FALSEならば英語記述
1001 * @param ptr フラグ群を保管する文字列参照ポインタ
1002 * @return フラグ群を保管する文字列参照ポインタ(ptrと同じ)
1004 * Print an signed number "v" into a string "t", as if by
1005 * sprintf(t, "%+d", n), and return a pointer to the terminator.
1006 * Note that we always print a sign, either "+" or "-".
1008 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
1014 while (fi_ptr->english)
1016 if (have_flag(flgs, fi_ptr->flag) &&
1017 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1019 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
1021 ADD_INSC(fi_ptr->english);
1031 * @brief オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
1032 * @param fi_ptr 参照する特性表示記号テーブル
1033 * @param flgs 対応するオブジェクトのフラグ文字列
1034 * @return 1つでも該当の特性があったらTRUEを返す。
1036 static bool have_flag_of(flag_insc_table *fi_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
1038 while (fi_ptr->english)
1040 if (have_flag(flgs, fi_ptr->flag) &&
1041 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1050 * @brief オブジェクト名の特性短縮表記をまとめて提示する。
1051 * @param ptr 特性短縮表記を格納する文字列ポインタ
1052 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1053 * @param kanji TRUEならば漢字表記 / FALSEなら英語表記
1054 * @param all TRUEならばベースアイテム上で明らかなフラグは省略する
1055 * @return ptrと同じアドレス
1057 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1059 char *prev_ptr = ptr;
1060 BIT_FLAGS flgs[TR_FLAG_SIZE];
1061 object_flags(o_ptr, flgs);
1063 /* Remove obvious flags */
1066 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1070 for (j = 0; j < TR_FLAG_SIZE; j++)
1071 flgs[j] &= ~k_ptr->flags[j];
1073 if (object_is_fixed_artifact(o_ptr))
1075 artifact_type *a_ptr = &a_info[o_ptr->name1];
1077 for (j = 0; j < TR_FLAG_SIZE; j++)
1078 flgs[j] &= ~a_ptr->flags[j];
1081 if (object_is_ego(o_ptr))
1083 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1085 for (j = 0; j < TR_FLAG_SIZE; j++)
1086 flgs[j] &= ~e_ptr->flags[j];
1090 /* Remove lite flags when this is a dark lite object */
1091 if (HAVE_DARK_FLAG(flgs))
1093 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1094 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1095 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1097 else if (HAVE_LITE_FLAG(flgs))
1099 add_flag(flgs, TR_LITE_1);
1100 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1101 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1105 if (have_flag_of(flag_insc_plus, flgs))
1110 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1113 if (have_flag_of(flag_insc_immune, flgs))
1115 if (!kanji && ptr != prev_ptr)
1122 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1125 if (have_flag_of(flag_insc_resistance, flgs))
1129 else if (ptr != prev_ptr)
1135 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1138 if (have_flag_of(flag_insc_misc, flgs))
1140 if (ptr != prev_ptr)
1146 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1149 if (have_flag_of(flag_insc_aura, flgs))
1153 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1156 if (have_flag_of(flag_insc_brand, flgs))
1158 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1161 if (have_flag_of(flag_insc_kill, flgs))
1163 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1166 if (have_flag_of(flag_insc_slay, flgs))
1168 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1173 if (have_flag_of(flag_insc_esp1, flgs) ||
1174 have_flag_of(flag_insc_esp2, flgs))
1176 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1177 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1181 if (have_flag_of(flag_insc_esp1, flgs))
1183 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1184 if (have_flag_of(flag_insc_esp2, flgs))
1186 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1190 if (have_flag_of(flag_insc_sust, flgs))
1194 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1203 * @brief オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
1204 * @param buff 特性短縮表記を格納する文字列ポインタ
1205 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1208 static void get_inscription(char *buff, object_type *o_ptr)
1210 concptr insc = quark_str(o_ptr->inscription);
1213 /* Not fully identified */
1214 if (!(o_ptr->ident & IDENT_MENTAL))
1216 /* Copy until end of line or '#' */
1219 if (*insc == '#') break;
1221 if (iskanji(*insc)) *buff++ = *insc++;
1231 for (; *insc; insc++)
1233 /* Ignore fake artifact inscription */
1234 if (*insc == '#') break;
1236 /* {%} will be automatically converted */
1237 else if ('%' == *insc)
1241 concptr start = ptr;
1243 /* check for too long inscription */
1244 if (ptr >= buff + MAX_NLEN) continue;
1257 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1267 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1282 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
1283 * @param buf 表記を返すための文字列参照ポインタ
1284 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
1285 * @param mode 表記に関するオプション指定
1286 * @return 現在クエスト達成目的のアイテムならばTRUEを返す。
1288 * One can choose the "verbosity" of the description, including whether\n
1289 * or not the "number" of items should be described, and how much detail\n
1290 * should be used when describing the item.\n
1292 * The given "buf" must be MAX_NLEN chars long to hold the longest possible\n
1293 * description, which can get pretty long, including incriptions, such as:\n
1294 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".\n
1295 * Note that the inscription will be clipped to keep the total description\n
1296 * under MAX_NLEN-1 chars (plus a terminator).\n
1298 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,\n
1299 * portable, versions of some common "sprintf()" commands.\n
1301 * Note that all ego-items (when known) append an "Ego-Item Name", unless\n
1302 * the item is also an artifact, which should NEVER happen.\n
1304 * Note that all artifacts (when known) append an "Artifact Name", so we\n
1305 * have special processing for "Specials" (artifact Lites, Rings, Amulets).\n
1306 * The "Specials" never use "modifiers" if they are "known", since they\n
1307 * have special "descriptions", such as "The Necklace of the Dwarves".\n
1309 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),\n
1310 * plus the artifact name, just like any other artifact, if known.\n
1312 * Special Ring's and Amulet's, if not "aware", use the same code as normal\n
1313 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or\n
1314 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,\n
1315 * they will append the artifact name, just like any artifact, if known.\n
1317 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.\n
1320 * OD_NAME_ONLY : The Cloak of Death\n
1321 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]\n
1322 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)\n
1323 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}\n
1325 * OD_OMIT_PREFIX : Forbidden numeric prefix\n
1326 * OD_NO_PLURAL : Forbidden use of plural \n
1327 * OD_STORE : Assume to be aware and known\n
1328 * OD_NO_FLAVOR : Allow to hidden flavor\n
1329 * OD_FORCE_FLAVOR : Get un-shuffled flavor name\n
1331 void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
1333 /* Extract object kind name */
1334 concptr kindname = k_name + k_info[o_ptr->k_idx].name;
1336 /* Extract default "base" string */
1337 concptr basenm = kindname;
1339 /* Assume no "modifier" string */
1340 concptr modstr = "";
1349 bool show_weapon = FALSE;
1350 bool show_armour = FALSE;
1355 char p1 = '(', p2 = ')';
1356 char b1 = '[', b2 = ']';
1357 char c1 = '{', c2 = '}';
1359 char tmp_val[MAX_NLEN+160];
1360 char tmp_val2[MAX_NLEN+10];
1361 char fake_insc_buf[30];
1363 BIT_FLAGS flgs[TR_FLAG_SIZE];
1365 object_type *bow_ptr;
1367 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1368 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1370 /* Extract some flags */
1371 object_flags(o_ptr, flgs);
1373 /* See if the object is "aware" */
1374 if (object_is_aware(o_ptr)) aware = TRUE;
1376 /* See if the object is "known" */
1377 if (object_is_known(o_ptr)) known = TRUE;
1379 /* Allow flavors to be hidden when aware */
1380 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1382 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1384 /* Don't show flavors */
1387 /* Pretend known and aware */
1392 /* Force to be flavor name only */
1393 if (mode & OD_FORCE_FLAVOR)
1399 /* Cancel shuffling */
1400 flavor_k_ptr = k_ptr;
1403 /* Analyze the object */
1404 switch (o_ptr->tval)
1406 /* Some objects are easy to describe */
1420 monster_race *r_ptr = &r_info[o_ptr->pval];
1426 modstr = _(" (空)", " (empty)");
1431 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1434 t = r_name + r_ptr->name;
1436 if (!(r_ptr->flags1 & RF1_UNIQUE))
1438 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1444 sprintf(tmp_val2, "(%s)", t);
1454 /* Figurines/Statues */
1458 monster_race *r_ptr = &r_info[o_ptr->pval];
1461 modstr = r_name + r_ptr->name;
1463 t = r_name + r_ptr->name;
1465 if (!(r_ptr->flags1 & RF1_UNIQUE))
1467 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1484 monster_race *r_ptr = &r_info[o_ptr->pval];
1486 modstr = r_name + r_ptr->name;
1491 if (r_ptr->flags1 & RF1_UNIQUE)
1492 basenm = "& % of #";
1500 /* Missiles/ Bows/ Weapons */
1529 /* Lites (including a few "Specials") */
1535 /* Amulets (including a few "Specials") */
1538 /* Known artifacts */
1541 if (object_is_fixed_artifact(o_ptr)) break;
1542 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1545 /* Color the object */
1546 modstr = k_name + flavor_k_ptr->flavor_name;
1549 if (!flavor) basenm = "%のアミュレット";
1550 else if (aware) basenm = "%の#アミュレット";
1551 else basenm = "#アミュレット";
1553 if (!flavor) basenm = "& Amulet~ of %";
1554 else if (aware) basenm = "& # Amulet~ of %";
1555 else basenm = "& # Amulet~";
1561 /* Rings (including a few "Specials") */
1564 /* Known artifacts */
1567 if (object_is_fixed_artifact(o_ptr)) break;
1568 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
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 = "& Ring~ of %";
1580 else if (aware) basenm = "& # Ring~ of %";
1581 else basenm = "& # Ring~";
1584 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1596 /* Color the object */
1597 modstr = k_name + flavor_k_ptr->flavor_name;
1600 if (!flavor) basenm = "%の杖";
1601 else if (aware) basenm = "%の#杖";
1604 if (!flavor) basenm = "& Staff~ of %";
1605 else if (aware) basenm = "& # Staff~ of %";
1606 else basenm = "& # Staff~";
1614 /* Color the object */
1615 modstr = k_name + flavor_k_ptr->flavor_name;
1618 if (!flavor) basenm = "%の魔法棒";
1619 else if (aware) basenm = "%の#魔法棒";
1620 else basenm = "#魔法棒";
1622 if (!flavor) basenm = "& Wand~ of %";
1623 else if (aware) basenm = "& # Wand~ of %";
1624 else basenm = "& # Wand~";
1632 /* Color the object */
1633 modstr = k_name + flavor_k_ptr->flavor_name;
1636 if (!flavor) basenm = "%のロッド";
1637 else if (aware) basenm = "%の#ロッド";
1638 else basenm = "#ロッド";
1640 if (!flavor) basenm = "& Rod~ of %";
1641 else if (aware) basenm = "& # Rod~ of %";
1642 else basenm = "& # Rod~";
1650 /* Color the object */
1651 modstr = k_name + flavor_k_ptr->flavor_name;
1654 if (!flavor) basenm = "%の巻物";
1655 else if (aware) basenm = "「#」と書かれた%の巻物";
1656 else basenm = "「#」と書かれた巻物";
1658 if (!flavor) basenm = "& Scroll~ of %";
1659 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1660 else basenm = "& Scroll~ titled \"#\"";
1668 /* Color the object */
1669 modstr = k_name + flavor_k_ptr->flavor_name;
1672 if (!flavor) basenm = "%の薬";
1673 else if (aware) basenm = "%の#薬";
1676 if (!flavor) basenm = "& Potion~ of %";
1677 else if (aware) basenm = "& # Potion~ of %";
1678 else basenm = "& # Potion~";
1686 /* Ordinary food is "boring" */
1687 if (!k_ptr->flavor_name) break;
1689 /* Color the object */
1690 modstr = k_name + flavor_k_ptr->flavor_name;
1693 if (!flavor) basenm = "%のキノコ";
1694 else if (aware) basenm = "%の#キノコ";
1695 else basenm = "#キノコ";
1697 if (!flavor) basenm = "& Mushroom~ of %";
1698 else if (aware) basenm = "& # Mushroom~ of %";
1699 else basenm = "& # Mushroom~";
1707 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1717 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1718 basenm = "& Book~ of Life Magic %";
1720 basenm = "& Life Spellbook~ %";
1726 case TV_SORCERY_BOOK:
1731 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1732 basenm = "& Book~ of Sorcery %";
1734 basenm = "& Sorcery Spellbook~ %";
1740 case TV_NATURE_BOOK:
1745 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1746 basenm = "& Book~ of Nature Magic %";
1748 basenm = "& Nature Spellbook~ %";
1757 basenm = "カオスの魔法書%";
1759 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1760 basenm = "& Book~ of Chaos Magic %";
1762 basenm = "& Chaos Spellbook~ %";
1773 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1774 basenm = "& Book~ of Death Magic %";
1776 basenm = "& Death Spellbook~ %";
1785 basenm = "トランプの魔法書%";
1787 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1788 basenm = "& Book~ of Trump Magic %";
1790 basenm = "& Trump Spellbook~ %";
1796 case TV_ARCANE_BOOK:
1801 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1802 basenm = "& Book~ of Arcane Magic %";
1804 basenm = "& Arcane Spellbook~ %";
1815 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1816 basenm = "& Book~ of Craft Magic %";
1818 basenm = "& Craft Spellbook~ %";
1824 case TV_DAEMON_BOOK:
1829 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1830 basenm = "& Book~ of Daemon Magic %";
1832 basenm = "& Daemon Spellbook~ %";
1838 case TV_CRUSADE_BOOK:
1843 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1844 basenm = "& Book~ of Crusade Magic %";
1846 basenm = "& Crusade Spellbook~ %";
1854 basenm = _("歌集%", "& Song Book~ %");
1858 case TV_HISSATSU_BOOK:
1860 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1869 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1870 basenm = "& Book~ of Hex Magic %";
1872 basenm = "& Hex Spellbook~ %";
1878 /* Hack -- Gold/Gems */
1881 strcpy(buf, basenm);
1887 strcpy(buf, _("(なし)", "(nothing)"));
1892 /* Use full name from k_info or a_info */
1893 if (aware && have_flag(flgs, TR_FULL_NAME))
1895 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1896 else basenm = kindname;
1899 /* Start dumping the result */
1903 if (basenm[0] == '&')
1909 if (mode & OD_OMIT_PREFIX)
1913 else if (o_ptr->number > 1)
1915 t = object_desc_kosuu(t, o_ptr);
1916 t = object_desc_str(t, "の ");
1919 /* 英語の場合アーティファクトは The が付くので分かるが
1920 * 日本語では分からないのでマークをつける
1924 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1925 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1930 /* The object "expects" a "number" */
1931 if (basenm[0] == '&')
1933 /* Skip the ampersand (and space) */
1937 if (mode & OD_OMIT_PREFIX)
1942 /* Hack -- None left */
1943 else if (o_ptr->number <= 0)
1945 t = object_desc_str(t, "no more ");
1948 /* Extract the number */
1949 else if (o_ptr->number > 1)
1951 t = object_desc_num(t, o_ptr->number);
1952 t = object_desc_chr(t, ' ');
1955 /* Hack -- The only one of its kind */
1956 else if ((known && object_is_artifact(o_ptr)) ||
1957 ((o_ptr->tval == TV_CORPSE) &&
1958 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1960 t = object_desc_str(t, "The ");
1970 case '#': vowel = is_a_vowel(modstr[0]); break;
1971 case '%': vowel = is_a_vowel(*kindname); break;
1972 default: vowel = is_a_vowel(*s); break;
1977 /* A single one, with a vowel */
1978 t = object_desc_str(t, "an ");
1982 /* A single one, without a vowel */
1983 t = object_desc_str(t, "a ");
1988 /* Hack -- objects that "never" take an article */
1995 if (mode & OD_OMIT_PREFIX)
2000 /* Hack -- all gone */
2001 else if (o_ptr->number <= 0)
2003 t = object_desc_str(t, "no more ");
2006 /* Prefix a number if required */
2007 else if (o_ptr->number > 1)
2009 t = object_desc_num(t, o_ptr->number);
2010 t = object_desc_chr(t, ' ');
2013 /* Hack -- The only one of its kind */
2014 else if (known && object_is_artifact(o_ptr))
2016 t = object_desc_str(t, "The ");
2019 /* Hack -- single items get no prefix */
2027 /* Paranoia -- skip illegal tildes */
2028 /* while (*s == '~') s++; */
2031 if (object_is_smith(o_ptr))
2033 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2036 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2040 if (o_ptr->art_name)
2042 concptr temp = quark_str(o_ptr->art_name);
2044 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2045 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2046 if (strncmp(temp, "of ", 3) == 0)
2048 t = object_desc_str(t, &temp[3]);
2049 t = object_desc_str(t, "の");
2051 else if ((strncmp(temp, "『", 2) != 0) &&
2052 (strncmp(temp, "《", 2) != 0) &&
2054 t = object_desc_str(t, temp);
2057 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2059 artifact_type *a_ptr = &a_info[o_ptr->name1];
2060 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2061 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2063 t = object_desc_str(t, a_name + a_ptr->name);
2067 else if (object_is_ego(o_ptr))
2069 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2070 t = object_desc_str(t, e_name + e_ptr->name);
2075 /* Copy the string */
2076 for (s0 = NULL; *s || s0; )
2078 /* The end of the flavour/kind string. */
2085 /* Begin to append the modifier (flavor) */
2086 else if ((*s == '#') && !s0)
2091 /* Paranoia -- Never append multiple modstrs */
2095 /* Begin to append the kind name */
2096 else if ((*s == '%') && !s0)
2101 /* Paranoia -- Never append multiple kindnames */
2109 /* Add a plural if needed */
2110 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2116 /* Hack -- "Cutlass-es" and "Torch-es" */
2117 if ((k == 's') || (k == 'h')) *t++ = 'e';
2139 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2142 /* ランダムアーティファクトの名前はセーブファイルに記録
2143 されるので、英語版の名前もそれらしく変換する */
2144 if (o_ptr->art_name)
2148 strcpy(temp, quark_str(o_ptr->art_name));
2149 /* MEGA HACK by ita */
2150 if (strncmp(temp, "『", 2) == 0 ||
2151 strncmp(temp, "《", 2) == 0)
2152 t = object_desc_str(t, temp);
2153 else if (temp[0] == '\'')
2155 itemp = strlen(temp);
2156 temp[itemp - 1] = 0;
2157 t = object_desc_str(t, "『");
2158 t = object_desc_str(t, &temp[1]);
2159 t = object_desc_str(t, "』");
2162 else if (object_is_fixed_artifact(o_ptr))
2164 artifact_type *a_ptr = &a_info[o_ptr->name1];
2165 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2167 t = object_desc_str(t, a_name + a_ptr->name);
2170 else if (o_ptr->inscription)
2172 concptr str = quark_str(o_ptr->inscription);
2181 if (*str == '#') break;
2187 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2189 /* Add the false name */
2190 t = object_desc_str(t,"『");
2191 t = object_desc_str(t, &str_aux[1]);
2192 t = object_desc_str(t,"』");
2197 if (object_is_smith(o_ptr))
2199 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2202 /* Hack -- Append "Artifact" or "Special" names */
2203 if (known && !have_flag(flgs, TR_FULL_NAME))
2205 /* Is it a new random artifact ? */
2206 if (o_ptr->art_name)
2208 t = object_desc_chr(t, ' ');
2209 t = object_desc_str(t, quark_str(o_ptr->art_name));
2212 /* Grab any artifact name */
2213 else if (object_is_fixed_artifact(o_ptr))
2215 artifact_type *a_ptr = &a_info[o_ptr->name1];
2217 t = object_desc_chr(t, ' ');
2218 t = object_desc_str(t, a_name + a_ptr->name);
2221 /* Grab any ego-item name */
2224 if (object_is_ego(o_ptr))
2226 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2228 t = object_desc_chr(t, ' ');
2229 t = object_desc_str(t, e_name + e_ptr->name);
2232 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2235 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2237 /* Add the false name */
2238 t = object_desc_chr(t, ' ');
2239 t = object_desc_str(t, &str[1]);
2246 /* No more details wanted */
2247 if (mode & OD_NAME_ONLY) goto object_desc_done;
2249 /* Hack -- Chests must be described in detail */
2250 if (o_ptr->tval == TV_CHEST)
2252 /* Not searched yet */
2258 /* May be "empty" */
2259 else if (!o_ptr->pval)
2261 t = object_desc_str(t, _("(空)", " (empty)"));
2264 /* May be "disarmed" */
2265 else if (o_ptr->pval < 0)
2267 if (chest_traps[0 - o_ptr->pval])
2269 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2273 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2277 /* Describe the traps, if any */
2280 /* Describe the traps */
2281 switch (chest_traps[o_ptr->pval])
2285 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2288 case CHEST_LOSE_STR:
2290 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2293 case CHEST_LOSE_CON:
2295 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2300 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2303 case CHEST_PARALYZE:
2305 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2310 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2314 case CHEST_BIRD_STORM:
2315 case CHEST_E_SUMMON:
2316 case CHEST_H_SUMMON:
2318 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2321 case CHEST_RUNES_OF_EVIL:
2323 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2328 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2333 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2341 /* Display the item like a weapon */
2342 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2344 /* Display the item like a weapon */
2345 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2348 /* Display the item like a weapon */
2349 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2351 /* Display the item like armour */
2352 if (o_ptr->ac) show_armour = TRUE;
2355 /* Dump base weapon info */
2356 switch (o_ptr->tval)
2358 /* Missiles and Weapons */
2367 /* In Vault Quest, hide the dice of target weapon. */
2368 if(object_is_quest_target(o_ptr) && !known)
2373 /* Append a "damage" string */
2374 t = object_desc_chr(t, ' ');
2375 t = object_desc_chr(t, p1);
2376 t = object_desc_num(t, o_ptr->dd);
2377 t = object_desc_chr(t, 'd');
2378 t = object_desc_num(t, o_ptr->ds);
2379 t = object_desc_chr(t, p2);
2384 /* Bows get a special "damage string" */
2387 /* Mega-Hack -- Extract the "base power" */
2388 power = bow_tmul(o_ptr->sval);
2390 /* Apply the "Extra Might" flag */
2391 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2393 /* Append a special "damage" string */
2394 t = object_desc_chr(t, ' ');
2395 t = object_desc_chr(t, p1);
2396 t = object_desc_chr(t, 'x');
2397 t = object_desc_num(t, power);
2398 t = object_desc_chr(t, p2);
2400 fire_rate = calc_num_fire(p_ptr, o_ptr);
2401 /* Show Fire rate */
2402 if (fire_rate != 0 && power > 0 && known)
2404 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2406 t = object_desc_chr(t, ' ');
2407 t = object_desc_chr(t, p1);
2408 t = object_desc_num(t, fire_rate/100);
2409 t = object_desc_chr(t, '.');
2410 t = object_desc_num(t, fire_rate%100);
2411 t = object_desc_str(t, "turn");
2412 t = object_desc_chr(t, p2);
2420 /* Add the weapon bonuses */
2423 /* Show the tohit/todam on request */
2426 t = object_desc_chr(t, ' ');
2427 t = object_desc_chr(t, p1);
2428 t = object_desc_int(t, o_ptr->to_h);
2429 t = object_desc_chr(t, ',');
2430 t = object_desc_int(t, o_ptr->to_d);
2431 t = object_desc_chr(t, p2);
2434 /* Show the tohit if needed */
2435 else if (o_ptr->to_h)
2437 t = object_desc_chr(t, ' ');
2438 t = object_desc_chr(t, p1);
2439 t = object_desc_int(t, o_ptr->to_h);
2440 t = object_desc_chr(t, p2);
2443 /* Show the todam if needed */
2444 else if (o_ptr->to_d)
2446 t = object_desc_chr(t, ' ');
2447 t = object_desc_chr(t, p1);
2448 t = object_desc_int(t, o_ptr->to_d);
2449 t = object_desc_chr(t, p2);
2453 bow_ptr = &p_ptr->inventory_list[INVEN_BOW];
2455 /* If have a firing weapon + ammo matches bow */
2456 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2458 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2459 int tmul = bow_tmul(bow_ptr->sval);
2460 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2462 /* See if the bow is "known" - then set damage bonus */
2463 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2465 /* Effect of ammo */
2466 if (known) avgdam += (o_ptr->to_d * 10);
2468 /* Get extra "power" from "extra might" */
2469 if (p_ptr->xtra_might) tmul++;
2471 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2473 /* Launcher multiplier */
2475 avgdam /= (100 * 10);
2477 /* Get extra damage from concentration */
2478 if (p_ptr->concent) avgdam = boost_concentration_damage(p_ptr, avgdam);
2480 if (avgdam < 0) avgdam = 0;
2482 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2483 t = object_desc_chr(t, ' ');
2484 t = object_desc_chr(t, p1);
2486 if(show_ammo_no_crit)
2488 /* Damage with no-crit */
2489 t = object_desc_num(t, avgdam);
2490 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2493 /* Apply Expect damage of Critical */
2494 avgdam = calc_expect_crit_shot(p_ptr, o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2495 t = object_desc_num(t, avgdam);
2497 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2498 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2500 if (p_ptr->num_fire == 0)
2502 t = object_desc_chr(t, '0');
2506 /* Calc effects of energy */
2507 avgdam *= (p_ptr->num_fire * 100);
2508 avgdam /= energy_fire;
2509 t = object_desc_num(t, avgdam);
2510 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2512 if(show_ammo_crit_ratio)
2514 int percent = calc_crit_ratio_shot(p_ptr, known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2516 t = object_desc_chr(t, '/');
2517 t = object_desc_num(t, percent / 100);
2518 t = object_desc_chr(t, '.');
2519 if(percent % 100 < 10)
2521 t = object_desc_chr(t, '0');
2523 t = object_desc_num(t, percent % 100);
2524 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2528 t = object_desc_chr(t, p2);
2530 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2532 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2533 s16b energy_fire = 100 - p_ptr->lev;
2535 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2537 /* Display (shot damage/ avg damage) */
2538 t = object_desc_chr(t, ' ');
2539 t = object_desc_chr(t, p1);
2540 t = object_desc_num(t, avgdam);
2541 t = object_desc_chr(t, '/');
2543 /* Calc effects of energy */
2544 avgdam = 100 * avgdam / energy_fire;
2546 t = object_desc_num(t, avgdam);
2547 t = object_desc_chr(t, p2);
2550 /* Add the armor bonuses */
2553 /* Show the armor class info */
2556 t = object_desc_chr(t, ' ');
2557 t = object_desc_chr(t, b1);
2558 t = object_desc_num(t, o_ptr->ac);
2559 t = object_desc_chr(t, ',');
2560 t = object_desc_int(t, o_ptr->to_a);
2561 t = object_desc_chr(t, b2);
2564 /* No base armor, but does increase armor */
2565 else if (o_ptr->to_a)
2567 t = object_desc_chr(t, ' ');
2568 t = object_desc_chr(t, b1);
2569 t = object_desc_int(t, o_ptr->to_a);
2570 t = object_desc_chr(t, b2);
2574 /* Hack -- always show base armor */
2575 else if (show_armour)
2577 t = object_desc_chr(t, ' ');
2578 t = object_desc_chr(t, b1);
2579 t = object_desc_num(t, o_ptr->ac);
2580 t = object_desc_chr(t, b2);
2584 /* No more details wanted */
2585 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2588 if (known) /* Known item only */
2591 * Hack -- Wands and Staffs have charges. Make certain how many charges
2592 * a stack of staffs really has is clear. -LM-
2594 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2596 /* Dump " (N charges)" */
2597 t = object_desc_chr(t, ' ');
2598 t = object_desc_chr(t, p1);
2600 /* Clear explaination for staffs. */
2601 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2603 t = object_desc_num(t, o_ptr->number);
2604 t = object_desc_str(t, "x ");
2606 t = object_desc_num(t, o_ptr->pval);
2608 t = object_desc_str(t, "回分");
2610 t = object_desc_str(t, " charge");
2611 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2614 t = object_desc_chr(t, p2);
2616 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2617 * be in any state of charge or discharge, this now includes a number. -LM-
2619 else if (o_ptr->tval == TV_ROD)
2621 /* Hack -- Dump " (# charging)" if relevant */
2624 /* Stacks of rods display an exact count of charging rods. */
2625 if (o_ptr->number > 1)
2628 if (k_ptr->pval == 0) k_ptr->pval = 1;
2630 /* Find out how many rods are charging, by dividing
2631 * current timeout by each rod's maximum timeout.
2632 * Ensure that any remainder is rounded up. Display
2633 * very discharged stacks as merely fully discharged.
2635 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2636 if (power > o_ptr->number) power = o_ptr->number;
2638 /* Display prettily. */
2639 t = object_desc_str(t, " (");
2640 t = object_desc_num(t, power);
2641 t = object_desc_str(t, _("本 充填中)", " charging)"));
2644 /* "one Rod of Perception (1 charging)" would look tacky. */
2647 t = object_desc_str(t, _("(充填中)", " (charging)"));
2652 /* Dump "pval" flags for wearable items */
2653 if (have_pval_flags(flgs))
2655 /* Start the display */
2656 t = object_desc_chr(t, ' ');
2657 t = object_desc_chr(t, p1);
2659 /* Dump the "pval" itself */
2660 t = object_desc_int(t, o_ptr->pval);
2662 /* Do not display the "pval" flags */
2663 if (have_flag(flgs, TR_HIDE_TYPE))
2668 else if (have_flag(flgs, TR_SPEED))
2670 t = object_desc_str(t, _("加速", " to speed"));
2672 else if (have_flag(flgs, TR_BLOWS))
2674 t = object_desc_str(t, _("攻撃", " attack"));
2676 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2679 else if (have_flag(flgs, TR_STEALTH))
2681 t = object_desc_str(t, _("隠密", " to stealth"));
2683 else if (have_flag(flgs, TR_SEARCH))
2685 t = object_desc_str(t, _("探索", " to searching"));
2687 else if (have_flag(flgs, TR_INFRA))
2689 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2691 t = object_desc_chr(t, p2);
2694 /* Hack -- Process Lanterns/Torches */
2695 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2697 /* Hack -- Turns of light for normal lites */
2698 t = object_desc_str(t, _("(", " (with "));
2699 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2700 else t = object_desc_num(t, o_ptr->xtra4);
2701 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2704 /* Indicate charging objects, but not rods. */
2705 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2707 t = object_desc_str(t, _("(充填中)", " (charging)"));
2711 /* No more details wanted */
2712 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2714 /* Prepare real inscriptions in a buffer */
2717 /* Auto abbreviation inscribe */
2718 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2720 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2731 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2735 /* Use the standard inscription if available */
2736 if (o_ptr->inscription)
2739 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2740 get_inscription(buff, o_ptr);
2741 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2745 /* No fake inscription yet */
2746 fake_insc_buf[0] = '\0';
2748 /* Use the game-generated "feeling" otherwise, if available */
2751 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2754 /* Note "cursed" if the item is known to be cursed */
2755 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2757 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2760 /* Note "unidentified" if the item is unidentified */
2761 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2762 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2764 && !(o_ptr->ident & IDENT_SENSE))
2766 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2769 /* Mega-Hack -- note empty wands/staffs */
2770 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2772 strcpy(fake_insc_buf, _("空", "empty"));
2775 /* Note "tried" if the object has been tested unsuccessfully */
2776 else if (!aware && object_is_tried(o_ptr))
2778 strcpy(fake_insc_buf, _("未判明", "tried"));
2781 /* Note the discount, if any */
2782 if (o_ptr->discount)
2784 /* Hidden by real inscription unless in a store */
2785 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2787 char discount_num_buf[4];
2789 /* Append to other fake inscriptions if any */
2790 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2792 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2793 strcat(fake_insc_buf, discount_num_buf);
2794 strcat(fake_insc_buf, _("%引き", "% off"));
2799 /* Append the inscription, if any */
2800 if (fake_insc_buf[0] || tmp_val2[0])
2802 /* Append the inscription */
2803 t = object_desc_chr(t, ' ');
2804 t = object_desc_chr(t, c1);
2806 /* Append fake inscriptions */
2807 if (fake_insc_buf[0])
2809 t = object_desc_str(t, fake_insc_buf);
2812 /* Append a separater */
2813 if (fake_insc_buf[0] && tmp_val2[0])
2815 t = object_desc_chr(t, ',');
2816 t = object_desc_chr(t, ' ');
2819 /* Append real inscriptions */
2822 t = object_desc_str(t, tmp_val2);
2825 t = object_desc_chr(t, c2);
2829 my_strcpy(buf, tmp_val, MAX_NLEN);
2834 * @brief nameバッファ内からベースアイテム名を返す / Strip an "object name" into a buffer
2835 * @param buf ベースアイテム格納先の参照ポインタ
2836 * @param k_idx ベースアイテムID
2839 void strip_name(char *buf, KIND_OBJECT_IDX k_idx)
2843 object_kind *k_ptr = &k_info[k_idx];
2845 concptr str = (k_name + k_ptr->name);
2848 /* Skip past leading characters */
2849 while ((*str == ' ') || (*str == '&')) str++;
2851 /* Copy useful chars */
2852 for (t = buf; *str; str++)
2855 if (iskanji(*str)) { *t++ = *str++; *t++ = *str; continue; }
2857 if (*str != '~') *t++ = *str;
2860 /* Terminate the new name */