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 /* Object is in the p_ptr->inventory_list of a store or spoiler */
1383 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1385 /* Don't show flavors */
1388 /* Pretend known and aware */
1393 /* Force to be flavor name only */
1394 if (mode & OD_FORCE_FLAVOR)
1400 /* Cancel shuffling */
1401 flavor_k_ptr = k_ptr;
1404 /* Analyze the object */
1405 switch (o_ptr->tval)
1407 /* Some objects are easy to describe */
1421 monster_race *r_ptr = &r_info[o_ptr->pval];
1427 modstr = _(" (空)", " (empty)");
1432 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1435 t = r_name + r_ptr->name;
1437 if (!(r_ptr->flags1 & RF1_UNIQUE))
1439 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1445 sprintf(tmp_val2, "(%s)", t);
1455 /* Figurines/Statues */
1459 monster_race *r_ptr = &r_info[o_ptr->pval];
1462 modstr = r_name + r_ptr->name;
1464 t = r_name + r_ptr->name;
1466 if (!(r_ptr->flags1 & RF1_UNIQUE))
1468 sprintf(tmp_val2, "%s%s", (is_a_vowel(*t) ? "an " : "a "), t);
1485 monster_race *r_ptr = &r_info[o_ptr->pval];
1487 modstr = r_name + r_ptr->name;
1492 if (r_ptr->flags1 & RF1_UNIQUE)
1493 basenm = "& % of #";
1501 /* Missiles/ Bows/ Weapons */
1530 /* Lites (including a few "Specials") */
1536 /* Amulets (including a few "Specials") */
1539 /* Known artifacts */
1542 if (object_is_fixed_artifact(o_ptr)) break;
1543 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1546 /* Color the object */
1547 modstr = k_name + flavor_k_ptr->flavor_name;
1550 if (!flavor) basenm = "%のアミュレット";
1551 else if (aware) basenm = "%の#アミュレット";
1552 else basenm = "#アミュレット";
1554 if (!flavor) basenm = "& Amulet~ of %";
1555 else if (aware) basenm = "& # Amulet~ of %";
1556 else basenm = "& # Amulet~";
1562 /* Rings (including a few "Specials") */
1565 /* Known artifacts */
1568 if (object_is_fixed_artifact(o_ptr)) break;
1569 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1572 /* Color the object */
1573 modstr = k_name + flavor_k_ptr->flavor_name;
1576 if (!flavor) basenm = "%の指輪";
1577 else if (aware) basenm = "%の#指輪";
1578 else basenm = "#指輪";
1580 if (!flavor) basenm = "& Ring~ of %";
1581 else if (aware) basenm = "& # Ring~ of %";
1582 else basenm = "& # Ring~";
1585 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1597 /* Color the object */
1598 modstr = k_name + flavor_k_ptr->flavor_name;
1601 if (!flavor) basenm = "%の杖";
1602 else if (aware) basenm = "%の#杖";
1605 if (!flavor) basenm = "& Staff~ of %";
1606 else if (aware) basenm = "& # Staff~ of %";
1607 else basenm = "& # Staff~";
1615 /* Color the object */
1616 modstr = k_name + flavor_k_ptr->flavor_name;
1619 if (!flavor) basenm = "%の魔法棒";
1620 else if (aware) basenm = "%の#魔法棒";
1621 else basenm = "#魔法棒";
1623 if (!flavor) basenm = "& Wand~ of %";
1624 else if (aware) basenm = "& # Wand~ of %";
1625 else basenm = "& # Wand~";
1633 /* Color the object */
1634 modstr = k_name + flavor_k_ptr->flavor_name;
1637 if (!flavor) basenm = "%のロッド";
1638 else if (aware) basenm = "%の#ロッド";
1639 else basenm = "#ロッド";
1641 if (!flavor) basenm = "& Rod~ of %";
1642 else if (aware) basenm = "& # Rod~ of %";
1643 else basenm = "& # Rod~";
1651 /* Color the object */
1652 modstr = k_name + flavor_k_ptr->flavor_name;
1655 if (!flavor) basenm = "%の巻物";
1656 else if (aware) basenm = "「#」と書かれた%の巻物";
1657 else basenm = "「#」と書かれた巻物";
1659 if (!flavor) basenm = "& Scroll~ of %";
1660 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1661 else basenm = "& Scroll~ titled \"#\"";
1669 /* Color the object */
1670 modstr = k_name + flavor_k_ptr->flavor_name;
1673 if (!flavor) basenm = "%の薬";
1674 else if (aware) basenm = "%の#薬";
1677 if (!flavor) basenm = "& Potion~ of %";
1678 else if (aware) basenm = "& # Potion~ of %";
1679 else basenm = "& # Potion~";
1687 /* Ordinary food is "boring" */
1688 if (!k_ptr->flavor_name) break;
1690 /* Color the object */
1691 modstr = k_name + flavor_k_ptr->flavor_name;
1694 if (!flavor) basenm = "%のキノコ";
1695 else if (aware) basenm = "%の#キノコ";
1696 else basenm = "#キノコ";
1698 if (!flavor) basenm = "& Mushroom~ of %";
1699 else if (aware) basenm = "& # Mushroom~ of %";
1700 else basenm = "& # Mushroom~";
1708 basenm = _("羊皮紙 - %", "& Parchment~ - %");
1718 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1719 basenm = "& Book~ of Life Magic %";
1721 basenm = "& Life Spellbook~ %";
1727 case TV_SORCERY_BOOK:
1732 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1733 basenm = "& Book~ of Sorcery %";
1735 basenm = "& Sorcery Spellbook~ %";
1741 case TV_NATURE_BOOK:
1746 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1747 basenm = "& Book~ of Nature Magic %";
1749 basenm = "& Nature Spellbook~ %";
1758 basenm = "カオスの魔法書%";
1760 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1761 basenm = "& Book~ of Chaos Magic %";
1763 basenm = "& Chaos Spellbook~ %";
1774 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1775 basenm = "& Book~ of Death Magic %";
1777 basenm = "& Death Spellbook~ %";
1786 basenm = "トランプの魔法書%";
1788 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1789 basenm = "& Book~ of Trump Magic %";
1791 basenm = "& Trump Spellbook~ %";
1797 case TV_ARCANE_BOOK:
1802 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1803 basenm = "& Book~ of Arcane Magic %";
1805 basenm = "& Arcane Spellbook~ %";
1816 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1817 basenm = "& Book~ of Craft Magic %";
1819 basenm = "& Craft Spellbook~ %";
1825 case TV_DAEMON_BOOK:
1830 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1831 basenm = "& Book~ of Daemon Magic %";
1833 basenm = "& Daemon Spellbook~ %";
1839 case TV_CRUSADE_BOOK:
1844 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1845 basenm = "& Book~ of Crusade Magic %";
1847 basenm = "& Crusade Spellbook~ %";
1855 basenm = _("歌集%", "& Song Book~ %");
1859 case TV_HISSATSU_BOOK:
1861 basenm = _("& 武芸の書%", "Book~ of Kendo %");
1870 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1871 basenm = "& Book~ of Hex Magic %";
1873 basenm = "& Hex Spellbook~ %";
1879 /* Hack -- Gold/Gems */
1882 strcpy(buf, basenm);
1886 /* Used in the "p_ptr->inventory_list" routine */
1889 strcpy(buf, _("(なし)", "(nothing)"));
1894 /* Use full name from k_info or a_info */
1895 if (aware && have_flag(flgs, TR_FULL_NAME))
1897 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1898 else basenm = kindname;
1901 /* Start dumping the result */
1905 if (basenm[0] == '&')
1911 if (mode & OD_OMIT_PREFIX)
1915 else if (o_ptr->number > 1)
1917 t = object_desc_kosuu(t, o_ptr);
1918 t = object_desc_str(t, "の ");
1921 /* 英語の場合アーティファクトは The が付くので分かるが
1922 * 日本語では分からないのでマークをつける
1926 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "★");
1927 else if (o_ptr->art_name) t = object_desc_str(t, "☆");
1932 /* The object "expects" a "number" */
1933 if (basenm[0] == '&')
1935 /* Skip the ampersand (and space) */
1939 if (mode & OD_OMIT_PREFIX)
1944 /* Hack -- None left */
1945 else if (o_ptr->number <= 0)
1947 t = object_desc_str(t, "no more ");
1950 /* Extract the number */
1951 else if (o_ptr->number > 1)
1953 t = object_desc_num(t, o_ptr->number);
1954 t = object_desc_chr(t, ' ');
1957 /* Hack -- The only one of its kind */
1958 else if ((known && object_is_artifact(o_ptr)) ||
1959 ((o_ptr->tval == TV_CORPSE) &&
1960 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1962 t = object_desc_str(t, "The ");
1972 case '#': vowel = is_a_vowel(modstr[0]); break;
1973 case '%': vowel = is_a_vowel(*kindname); break;
1974 default: vowel = is_a_vowel(*s); break;
1979 /* A single one, with a vowel */
1980 t = object_desc_str(t, "an ");
1984 /* A single one, without a vowel */
1985 t = object_desc_str(t, "a ");
1990 /* Hack -- objects that "never" take an article */
1997 if (mode & OD_OMIT_PREFIX)
2002 /* Hack -- all gone */
2003 else if (o_ptr->number <= 0)
2005 t = object_desc_str(t, "no more ");
2008 /* Prefix a number if required */
2009 else if (o_ptr->number > 1)
2011 t = object_desc_num(t, o_ptr->number);
2012 t = object_desc_chr(t, ' ');
2015 /* Hack -- The only one of its kind */
2016 else if (known && object_is_artifact(o_ptr))
2018 t = object_desc_str(t, "The ");
2021 /* Hack -- single items get no prefix */
2029 /* Paranoia -- skip illegal tildes */
2030 /* while (*s == '~') s++; */
2033 if (object_is_smith(o_ptr))
2035 t = object_desc_str(t, format("鍛冶師%sの", p_ptr->name));
2038 /* 伝説のアイテム、名のあるアイテムの名前を付加する */
2042 if (o_ptr->art_name)
2044 concptr temp = quark_str(o_ptr->art_name);
2046 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2047 /* 英語版のセーブファイルから来た 'of XXX' は,「XXXの」と表示する */
2048 if (strncmp(temp, "of ", 3) == 0)
2050 t = object_desc_str(t, &temp[3]);
2051 t = object_desc_str(t, "の");
2053 else if ((strncmp(temp, "『", 2) != 0) &&
2054 (strncmp(temp, "《", 2) != 0) &&
2056 t = object_desc_str(t, temp);
2059 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2061 artifact_type *a_ptr = &a_info[o_ptr->name1];
2062 /* '『' から始まらない伝説のアイテムの名前は最初に付加する */
2063 if (strncmp(a_name + a_ptr->name, "『", 2) != 0)
2065 t = object_desc_str(t, a_name + a_ptr->name);
2069 else if (object_is_ego(o_ptr))
2071 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2072 t = object_desc_str(t, e_name + e_ptr->name);
2077 /* Copy the string */
2078 for (s0 = NULL; *s || s0; )
2080 /* The end of the flavour/kind string. */
2087 /* Begin to append the modifier (flavor) */
2088 else if ((*s == '#') && !s0)
2093 /* Paranoia -- Never append multiple modstrs */
2097 /* Begin to append the kind name */
2098 else if ((*s == '%') && !s0)
2103 /* Paranoia -- Never append multiple kindnames */
2111 /* Add a plural if needed */
2112 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2118 /* Hack -- "Cutlass-es" and "Torch-es" */
2119 if ((k == 's') || (k == 'h')) *t++ = 'e';
2141 /* '『'から始まる伝説のアイテムの名前は最後に付加する */
2144 /* ランダムアーティファクトの名前はセーブファイルに記録
2145 されるので、英語版の名前もそれらしく変換する */
2146 if (o_ptr->art_name)
2150 strcpy(temp, quark_str(o_ptr->art_name));
2151 /* MEGA HACK by ita */
2152 if (strncmp(temp, "『", 2) == 0 ||
2153 strncmp(temp, "《", 2) == 0)
2154 t = object_desc_str(t, temp);
2155 else if (temp[0] == '\'')
2157 itemp = strlen(temp);
2158 temp[itemp - 1] = 0;
2159 t = object_desc_str(t, "『");
2160 t = object_desc_str(t, &temp[1]);
2161 t = object_desc_str(t, "』");
2164 else if (object_is_fixed_artifact(o_ptr))
2166 artifact_type *a_ptr = &a_info[o_ptr->name1];
2167 if (strncmp(a_name + a_ptr->name, "『", 2) == 0)
2169 t = object_desc_str(t, a_name + a_ptr->name);
2172 else if (o_ptr->inscription)
2174 concptr str = quark_str(o_ptr->inscription);
2183 if (*str == '#') break;
2189 concptr str_aux = my_strchr(quark_str(o_ptr->inscription), '#');
2191 /* Add the false name */
2192 t = object_desc_str(t,"『");
2193 t = object_desc_str(t, &str_aux[1]);
2194 t = object_desc_str(t,"』");
2199 if (object_is_smith(o_ptr))
2201 t = object_desc_str(t,format(" of %s the Smith",p_ptr->name));
2204 /* Hack -- Append "Artifact" or "Special" names */
2205 if (known && !have_flag(flgs, TR_FULL_NAME))
2207 /* Is it a new random artifact ? */
2208 if (o_ptr->art_name)
2210 t = object_desc_chr(t, ' ');
2211 t = object_desc_str(t, quark_str(o_ptr->art_name));
2214 /* Grab any artifact name */
2215 else if (object_is_fixed_artifact(o_ptr))
2217 artifact_type *a_ptr = &a_info[o_ptr->name1];
2219 t = object_desc_chr(t, ' ');
2220 t = object_desc_str(t, a_name + a_ptr->name);
2223 /* Grab any ego-item name */
2226 if (object_is_ego(o_ptr))
2228 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2230 t = object_desc_chr(t, ' ');
2231 t = object_desc_str(t, e_name + e_ptr->name);
2234 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2237 concptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2239 /* Add the false name */
2240 t = object_desc_chr(t, ' ');
2241 t = object_desc_str(t, &str[1]);
2248 /* No more details wanted */
2249 if (mode & OD_NAME_ONLY) goto object_desc_done;
2251 /* Hack -- Chests must be described in detail */
2252 if (o_ptr->tval == TV_CHEST)
2254 /* Not searched yet */
2260 /* May be "empty" */
2261 else if (!o_ptr->pval)
2263 t = object_desc_str(t, _("(空)", " (empty)"));
2266 /* May be "disarmed" */
2267 else if (o_ptr->pval < 0)
2269 if (chest_traps[0 - o_ptr->pval])
2271 t = object_desc_str(t, _("(解除済)", " (disarmed)"));
2275 t = object_desc_str(t, _("(非施錠)", " (unlocked)"));
2279 /* Describe the traps, if any */
2282 /* Describe the traps */
2283 switch (chest_traps[o_ptr->pval])
2287 t = object_desc_str(t, _("(施錠)", " (Locked)"));
2290 case CHEST_LOSE_STR:
2292 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2295 case CHEST_LOSE_CON:
2297 t = object_desc_str(t, _("(毒針)", " (Poison Needle)"));
2302 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2305 case CHEST_PARALYZE:
2307 t = object_desc_str(t, _("(ガス・トラップ)", " (Gas Trap)"));
2312 t = object_desc_str(t, _("(爆発装置)", " (Explosion Device)"));
2316 case CHEST_BIRD_STORM:
2317 case CHEST_E_SUMMON:
2318 case CHEST_H_SUMMON:
2320 t = object_desc_str(t, _("(召喚のルーン)", " (Summoning Runes)"));
2323 case CHEST_RUNES_OF_EVIL:
2325 t = object_desc_str(t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
2330 t = object_desc_str(t, _("(警報装置)", " (Alarm)"));
2335 t = object_desc_str(t, _("(マルチ・トラップ)", " (Multiple Traps)"));
2343 /* Display the item like a weapon */
2344 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2346 /* Display the item like a weapon */
2347 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2350 /* Display the item like a weapon */
2351 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2353 /* Display the item like armour */
2354 if (o_ptr->ac) show_armour = TRUE;
2357 /* Dump base weapon info */
2358 switch (o_ptr->tval)
2360 /* Missiles and Weapons */
2369 /* In Vault Quest, hide the dice of target weapon. */
2370 if(object_is_quest_target(o_ptr) && !known)
2375 /* Append a "damage" string */
2376 t = object_desc_chr(t, ' ');
2377 t = object_desc_chr(t, p1);
2378 t = object_desc_num(t, o_ptr->dd);
2379 t = object_desc_chr(t, 'd');
2380 t = object_desc_num(t, o_ptr->ds);
2381 t = object_desc_chr(t, p2);
2386 /* Bows get a special "damage string" */
2389 /* Mega-Hack -- Extract the "base power" */
2390 power = bow_tmul(o_ptr->sval);
2392 /* Apply the "Extra Might" flag */
2393 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2395 /* Append a special "damage" string */
2396 t = object_desc_chr(t, ' ');
2397 t = object_desc_chr(t, p1);
2398 t = object_desc_chr(t, 'x');
2399 t = object_desc_num(t, power);
2400 t = object_desc_chr(t, p2);
2402 fire_rate = calc_num_fire(p_ptr, o_ptr);
2403 /* Show Fire rate */
2404 if (fire_rate != 0 && power > 0 && known)
2406 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2408 t = object_desc_chr(t, ' ');
2409 t = object_desc_chr(t, p1);
2410 t = object_desc_num(t, fire_rate/100);
2411 t = object_desc_chr(t, '.');
2412 t = object_desc_num(t, fire_rate%100);
2413 t = object_desc_str(t, "turn");
2414 t = object_desc_chr(t, p2);
2422 /* Add the weapon bonuses */
2425 /* Show the tohit/todam on request */
2428 t = object_desc_chr(t, ' ');
2429 t = object_desc_chr(t, p1);
2430 t = object_desc_int(t, o_ptr->to_h);
2431 t = object_desc_chr(t, ',');
2432 t = object_desc_int(t, o_ptr->to_d);
2433 t = object_desc_chr(t, p2);
2436 /* Show the tohit if needed */
2437 else if (o_ptr->to_h)
2439 t = object_desc_chr(t, ' ');
2440 t = object_desc_chr(t, p1);
2441 t = object_desc_int(t, o_ptr->to_h);
2442 t = object_desc_chr(t, p2);
2445 /* Show the todam if needed */
2446 else if (o_ptr->to_d)
2448 t = object_desc_chr(t, ' ');
2449 t = object_desc_chr(t, p1);
2450 t = object_desc_int(t, o_ptr->to_d);
2451 t = object_desc_chr(t, p2);
2455 bow_ptr = &p_ptr->inventory_list[INVEN_BOW];
2457 /* If have a firing weapon + ammo matches bow */
2458 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2460 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2461 int tmul = bow_tmul(bow_ptr->sval);
2462 ENERGY energy_fire = bow_energy(bow_ptr->sval);
2464 /* See if the bow is "known" - then set damage bonus */
2465 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2467 /* Effect of ammo */
2468 if (known) avgdam += (o_ptr->to_d * 10);
2470 /* Get extra "power" from "extra might" */
2471 if (p_ptr->xtra_might) tmul++;
2473 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2475 /* Launcher multiplier */
2477 avgdam /= (100 * 10);
2479 /* Get extra damage from concentration */
2480 if (p_ptr->concent) avgdam = boost_concentration_damage(p_ptr, avgdam);
2482 if (avgdam < 0) avgdam = 0;
2484 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2485 t = object_desc_chr(t, ' ');
2486 t = object_desc_chr(t, p1);
2488 if(show_ammo_no_crit)
2490 /* Damage with no-crit */
2491 t = object_desc_num(t, avgdam);
2492 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2495 /* Apply Expect damage of Critical */
2496 avgdam = calc_expect_crit_shot(p_ptr, o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2497 t = object_desc_num(t, avgdam);
2499 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2500 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2502 if (p_ptr->num_fire == 0)
2504 t = object_desc_chr(t, '0');
2508 /* Calc effects of energy */
2509 avgdam *= (p_ptr->num_fire * 100);
2510 avgdam /= energy_fire;
2511 t = object_desc_num(t, avgdam);
2512 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2514 if(show_ammo_crit_ratio)
2516 int percent = calc_crit_ratio_shot(p_ptr, known ? o_ptr->to_h : 0, known ? bow_ptr->to_h : 0);
2518 t = object_desc_chr(t, '/');
2519 t = object_desc_num(t, percent / 100);
2520 t = object_desc_chr(t, '.');
2521 if(percent % 100 < 10)
2523 t = object_desc_chr(t, '0');
2525 t = object_desc_num(t, percent % 100);
2526 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2530 t = object_desc_chr(t, p2);
2532 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2534 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2535 s16b energy_fire = 100 - p_ptr->lev;
2537 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2539 /* Display (shot damage/ avg damage) */
2540 t = object_desc_chr(t, ' ');
2541 t = object_desc_chr(t, p1);
2542 t = object_desc_num(t, avgdam);
2543 t = object_desc_chr(t, '/');
2545 /* Calc effects of energy */
2546 avgdam = 100 * avgdam / energy_fire;
2548 t = object_desc_num(t, avgdam);
2549 t = object_desc_chr(t, p2);
2552 /* Add the armor bonuses */
2555 /* Show the armor class info */
2558 t = object_desc_chr(t, ' ');
2559 t = object_desc_chr(t, b1);
2560 t = object_desc_num(t, o_ptr->ac);
2561 t = object_desc_chr(t, ',');
2562 t = object_desc_int(t, o_ptr->to_a);
2563 t = object_desc_chr(t, b2);
2566 /* No base armor, but does increase armor */
2567 else if (o_ptr->to_a)
2569 t = object_desc_chr(t, ' ');
2570 t = object_desc_chr(t, b1);
2571 t = object_desc_int(t, o_ptr->to_a);
2572 t = object_desc_chr(t, b2);
2576 /* Hack -- always show base armor */
2577 else if (show_armour)
2579 t = object_desc_chr(t, ' ');
2580 t = object_desc_chr(t, b1);
2581 t = object_desc_num(t, o_ptr->ac);
2582 t = object_desc_chr(t, b2);
2586 /* No more details wanted */
2587 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2590 if (known) /* Known item only */
2593 * Hack -- Wands and Staffs have charges. Make certain how many charges
2594 * a stack of staffs really has is clear. -LM-
2596 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2598 /* Dump " (N charges)" */
2599 t = object_desc_chr(t, ' ');
2600 t = object_desc_chr(t, p1);
2602 /* Clear explaination for staffs. */
2603 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2605 t = object_desc_num(t, o_ptr->number);
2606 t = object_desc_str(t, "x ");
2608 t = object_desc_num(t, o_ptr->pval);
2610 t = object_desc_str(t, "回分");
2612 t = object_desc_str(t, " charge");
2613 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2616 t = object_desc_chr(t, p2);
2618 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2619 * be in any state of charge or discharge, this now includes a number. -LM-
2621 else if (o_ptr->tval == TV_ROD)
2623 /* Hack -- Dump " (# charging)" if relevant */
2626 /* Stacks of rods display an exact count of charging rods. */
2627 if (o_ptr->number > 1)
2630 if (k_ptr->pval == 0) k_ptr->pval = 1;
2632 /* Find out how many rods are charging, by dividing
2633 * current timeout by each rod's maximum timeout.
2634 * Ensure that any remainder is rounded up. Display
2635 * very discharged stacks as merely fully discharged.
2637 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2638 if (power > o_ptr->number) power = o_ptr->number;
2640 /* Display prettily. */
2641 t = object_desc_str(t, " (");
2642 t = object_desc_num(t, power);
2643 t = object_desc_str(t, _("本 充填中)", " charging)"));
2646 /* "one Rod of Perception (1 charging)" would look tacky. */
2649 t = object_desc_str(t, _("(充填中)", " (charging)"));
2654 /* Dump "pval" flags for wearable items */
2655 if (have_pval_flags(flgs))
2657 /* Start the display */
2658 t = object_desc_chr(t, ' ');
2659 t = object_desc_chr(t, p1);
2661 /* Dump the "pval" itself */
2662 t = object_desc_int(t, o_ptr->pval);
2664 /* Do not display the "pval" flags */
2665 if (have_flag(flgs, TR_HIDE_TYPE))
2670 else if (have_flag(flgs, TR_SPEED))
2672 t = object_desc_str(t, _("加速", " to speed"));
2674 else if (have_flag(flgs, TR_BLOWS))
2676 t = object_desc_str(t, _("攻撃", " attack"));
2678 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2681 else if (have_flag(flgs, TR_STEALTH))
2683 t = object_desc_str(t, _("隠密", " to stealth"));
2685 else if (have_flag(flgs, TR_SEARCH))
2687 t = object_desc_str(t, _("探索", " to searching"));
2689 else if (have_flag(flgs, TR_INFRA))
2691 t = object_desc_str(t, _("赤外線視力", " to infravision"));
2693 t = object_desc_chr(t, p2);
2696 /* Hack -- Process Lanterns/Torches */
2697 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2699 /* Hack -- Turns of light for normal lites */
2700 t = object_desc_str(t, _("(", " (with "));
2701 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2702 else t = object_desc_num(t, o_ptr->xtra4);
2703 t = object_desc_str(t, _("ターンの寿命)", " turns of light)"));
2706 /* Indicate charging objects, but not rods. */
2707 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2709 t = object_desc_str(t, _("(充填中)", " (charging)"));
2713 /* No more details wanted */
2714 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2716 /* Prepare real inscriptions in a buffer */
2719 /* Auto abbreviation inscribe */
2720 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2722 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2733 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2737 /* Use the standard inscription if available */
2738 if (o_ptr->inscription)
2741 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2742 get_inscription(buff, o_ptr);
2743 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2747 /* No fake inscription yet */
2748 fake_insc_buf[0] = '\0';
2750 /* Use the game-generated "feeling" otherwise, if available */
2753 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2756 /* Note "cursed" if the item is known to be cursed */
2757 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2759 strcpy(fake_insc_buf, _("呪われている", "cursed"));
2762 /* Note "unidentified" if the item is unidentified */
2763 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2764 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2766 && !(o_ptr->ident & IDENT_SENSE))
2768 strcpy(fake_insc_buf, _("未鑑定", "unidentified"));
2771 /* Mega-Hack -- note empty wands/staffs */
2772 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2774 strcpy(fake_insc_buf, _("空", "empty"));
2777 /* Note "tried" if the object has been tested unsuccessfully */
2778 else if (!aware && object_is_tried(o_ptr))
2780 strcpy(fake_insc_buf, _("未判明", "tried"));
2783 /* Note the discount, if any */
2784 if (o_ptr->discount)
2786 /* Hidden by real inscription unless in a store */
2787 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2789 char discount_num_buf[4];
2791 /* Append to other fake inscriptions if any */
2792 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2794 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2795 strcat(fake_insc_buf, discount_num_buf);
2796 strcat(fake_insc_buf, _("%引き", "% off"));
2801 /* Append the inscription, if any */
2802 if (fake_insc_buf[0] || tmp_val2[0])
2804 /* Append the inscription */
2805 t = object_desc_chr(t, ' ');
2806 t = object_desc_chr(t, c1);
2808 /* Append fake inscriptions */
2809 if (fake_insc_buf[0])
2811 t = object_desc_str(t, fake_insc_buf);
2814 /* Append a separater */
2815 if (fake_insc_buf[0] && tmp_val2[0])
2817 t = object_desc_chr(t, ',');
2818 t = object_desc_chr(t, ' ');
2821 /* Append real inscriptions */
2824 t = object_desc_str(t, tmp_val2);
2827 t = object_desc_chr(t, c2);
2831 my_strcpy(buf, tmp_val, MAX_NLEN);
2836 * @brief nameバッファ内からベースアイテム名を返す / Strip an "object name" into a buffer
2837 * @param buf ベースアイテム格納先の参照ポインタ
2838 * @param k_idx ベースアイテムID
2841 void strip_name(char *buf, KIND_OBJECT_IDX k_idx)
2845 object_kind *k_ptr = &k_info[k_idx];
2847 concptr str = (k_name + k_ptr->name);
2850 /* Skip past leading characters */
2851 while ((*str == ' ') || (*str == '&')) str++;
2853 /* Copy useful chars */
2854 for (t = buf; *str; str++)
2857 if (iskanji(*str)) { *t++ = *str++; *t++ = *str; continue; }
2859 if (*str != '~') *t++ = *str;
2862 /* Terminate the new name */