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 * @brief ºÇ½é¤«¤é´Ê°×¤Ê̾¾Î¤¬ÌÀ¤é¤«¤Ë¤Ê¤ë¥Ù¡¼¥¹¥¢¥¤¥Æ¥à¤ÎȽÄê¡£ / Certain items, if aware, are known instantly
17 * @param i ¥Ù¡¼¥¹¥¢¥¤¥Æ¥àID
18 * @return ´Ê°×̾¾Î¤òÌÀ¤é¤«¤Ë¤¹¤ë¤Ê¤éTRUE¤òÊÖ¤¹¡£
20 * This function is used only by "flavor_init()"
22 static bool object_easy_know(int i)
24 object_kind *k_ptr = &k_info[i];
26 /* Analyze the "tval" */
41 case TV_HISSATSU_BOOK:
58 /* All Food, Potions, Scrolls, Rods */
73 * @brief ³Æ¼ï¸ì×䫤é¥é¥ó¥À¥à¤Ê̾Á°¤òºîÀ®¤¹¤ë / Create a name from random parts.
74 * @param out_string ºîÀ®¤·¤¿Ì¾¤òÊݴɤ¹¤ë»²¾È¥Ý¥¤¥ó¥¿
76 * @details ÆüËܸì¤Î¾ì¹ç aname_j.txt ±Ñ¸ì¤Î¾ì¹ç³ÎΨ¤Ë±þ¤¸¤Æ
77 * syllables ÇÛÎó¤È elvish.txt ¤òÁȤ߹ç¤ï¤»¤ë¡£\n
79 void get_table_name_aux(char *out_string)
83 get_rnd_line("aname_j.txt", 1, Syllable);
84 strcpy(out_string, Syllable);
85 get_rnd_line("aname_j.txt", 2, Syllable);
86 strcat(out_string, Syllable);
88 #define MAX_SYLLABLES 164 /* Used with scrolls (see below) */
90 static cptr syllables[MAX_SYLLABLES] = {
91 "a", "ab", "ag", "aks", "ala", "an", "ankh", "app",
92 "arg", "arze", "ash", "aus", "ban", "bar", "bat", "bek",
93 "bie", "bin", "bit", "bjor", "blu", "bot", "bu",
94 "byt", "comp", "con", "cos", "cre", "dalf", "dan",
95 "den", "der", "doe", "dok", "eep", "el", "eng", "er", "ere", "erk",
96 "esh", "evs", "fa", "fid", "flit", "for", "fri", "fu", "gan",
97 "gar", "glen", "gop", "gre", "ha", "he", "hyd", "i",
98 "ing", "ion", "ip", "ish", "it", "ite", "iv", "jo",
99 "kho", "kli", "klis", "la", "lech", "man", "mar",
100 "me", "mi", "mic", "mik", "mon", "mung", "mur", "nag", "nej",
101 "nelg", "nep", "ner", "nes", "nis", "nih", "nin", "o",
102 "od", "ood", "org", "orn", "ox", "oxy", "pay", "pet",
103 "ple", "plu", "po", "pot", "prok", "re", "rea", "rhov",
104 "ri", "ro", "rog", "rok", "rol", "sa", "san", "sat",
105 "see", "sef", "seh", "shu", "ski", "sna", "sne", "snik",
106 "sno", "so", "sol", "sri", "sta", "sun", "ta", "tab",
107 "tem", "ther", "ti", "tox", "trol", "tue", "turs", "u",
108 "ulk", "um", "un", "uni", "ur", "val", "viv", "vly",
109 "vom", "wah", "wed", "werg", "wex", "whon", "wun", "x",
110 "yerg", "yp", "zun", "tri", "blaa", "jah", "bul", "on",
114 int testcounter = randint1(3) + 1;
116 strcpy(out_string, "");
118 if (randint1(3) == 2)
120 while (testcounter--)
121 strcat(out_string, syllables[randint0(MAX_SYLLABLES)]);
126 testcounter = randint1(2) + 1;
127 while (testcounter--)
129 (void)get_rnd_line("elvish.txt", 0, Syllable);
130 strcat(out_string, Syllable);
134 out_string[0] = toupper(out_string[1]);
136 out_string[16] = '\0';
141 * @brief ¥é¥ó¥À¥à¤Ê̾Á°¤ò¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥ÈÌäȤ·¤ÆÀ°·Á¤¹¤ë¡£ / Create a name from random parts with quotes.
142 * @param out_string ºîÀ®¤·¤¿Ì¾¤òÊݴɤ¹¤ë»²¾È¥Ý¥¤¥ó¥¿
144 * @details get_table_name_aux()¤Û¤Ü´°Á´¤Ë¼ÂÁõ¤ò°Í¸¤·¤Æ¤¤¤ë¡£
146 void get_table_name(char *out_string)
149 get_table_name_aux(buff);
152 sprintf(out_string, "¡Ø%s¡Ù", buff);
154 sprintf(out_string, "'%s'", buff);
159 * @brief ¥é¥ó¥À¥à¤Ê¥·¥ó¥À¥ê¥óÌäòºîÀ®¤¹¤ë / Make random Sindarin name
160 * @param out_string ºîÀ®¤·¤¿Ì¾¤òÊݴɤ¹¤ë»²¾È¥Ý¥¤¥ó¥¿
162 * @details sname.txt¤¬¸ì´´¤Î¼½ñ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
164 void get_table_sindarin_aux(char *out_string)
171 get_rnd_line("sname.txt", 1, Syllable);
173 strcpy(tmp, Syllable);
175 strcpy(out_string, Syllable);
178 get_rnd_line("sname.txt", 2, Syllable);
180 strcat(tmp, Syllable);
181 sindarin_to_kana(out_string, tmp);
183 strcat(out_string, Syllable);
188 * @brief ¥·¥ó¥À¥ê¥óÌäò¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥ÈÍѤËÀ°·Á¤¹¤ë¡£ / Make random Sindarin name with quotes
189 * @param out_string ºîÀ®¤·¤¿Ì¾¤òÊݴɤ¹¤ë»²¾È¥Ý¥¤¥ó¥¿
191 * @details get_table_sindarin_aux()¤Û¤Ü´°Á´¤Ë¼ÂÁõ¤ò°Í¸¤·¤Æ¤¤¤ë¡£
193 void get_table_sindarin(char *out_string)
196 get_table_sindarin_aux(buff);
199 sprintf(out_string, "¡Ø%s¡Ù", buff);
201 sprintf(out_string, "'%s'", buff);
207 * @brief ¥Ù¡¼¥¹¥¢¥¤¥Æ¥à¤Î̤³ÎÄê̾¤ò¶¦ÄÌtval´Ö¤Ç¥·¥ã¥Ã¥Õ¥ë¤¹¤ë / Shuffle flavor indices of a group of objects with given tval
208 * @param byte ¥·¥ã¥Ã¥Õ¥ë¤·¤¿¤¤tval
210 * @details ´¬Êª¡¢³Æ¼ïËâÆ»¶ñ¤Ê¤É¤ËÍøÍѤµ¤ì¤ë¡£
212 static void shuffle_flavors(byte tval)
215 int k_idx_list_num = 0;
218 /* Allocate an array for a list of k_idx */
219 C_MAKE(k_idx_list, max_k_idx, s16b);
221 /* Search objects with given tval for shuffle */
222 for (i = 0; i < max_k_idx; i++)
224 object_kind *k_ptr = &k_info[i];
227 if (k_ptr->tval != tval) continue;
229 /* Paranoia -- Skip objects without flavor */
230 if (!k_ptr->flavor) continue;
232 /* Skip objects with a fixed flavor name */
233 if (have_flag(k_ptr->flags, TR_FIXED_FLAVOR)) continue;
236 k_idx_list[k_idx_list_num] = i;
238 /* Increase number of remembered indices */
242 /* Shuffle flavors */
243 for (i = 0; i < k_idx_list_num; i++)
245 object_kind *k1_ptr = &k_info[k_idx_list[i]];
246 object_kind *k2_ptr = &k_info[k_idx_list[randint0(k_idx_list_num)]];
248 /* Swap flavors of this pair */
249 s16b tmp = k1_ptr->flavor;
250 k1_ptr->flavor = k2_ptr->flavor;
251 k2_ptr->flavor = tmp;
254 /* Free an array for a list of k_idx */
255 C_KILL(k_idx_list, max_k_idx, s16b);
259 * @brief ¥²¡¼¥à³«»Ï»þ¤Ë¹Ô¤ï¤ì¤ë¥Ù¡¼¥¹¥¢¥¤¥Æ¥à¤Î½é´ü²½¥ë¡¼¥Á¥ó / Prepare the "variable" part of the "k_info" array.
262 * Prepare the "variable" part of the "k_info" array.\n
264 * The "color"/"metal"/"type" of an item is its "flavor".\n
265 * For the most part, flavors are assigned randomly each game.\n
267 * Initialize descriptions for the "colored" objects, including:\n
268 * Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.\n
270 * The first 4 entries for potions are fixed (Water, Apple Juice,\n
271 * Slime Mold Juice, Unused Potion).\n
273 * Scroll titles are always between 6 and 14 letters long. This is\n
274 * ensured because every title is composed of whole words, where every\n
275 * word is from 1 to 8 letters long (one or two syllables of 1 to 4\n
276 * letters each), and that no scroll is finished until it attempts to\n
277 * grow beyond 15 letters. The first time this can happen is when the\n
278 * current title has 6 letters and the new word has 8 letters, which\n
279 * would result in a 6 letter scroll title.\n
281 * Duplicate titles are avoided by requiring that no two scrolls share\n
282 * the same first four letters (not the most efficient method, and not\n
283 * the least efficient method, but it will always work).\n
285 * Hack -- make sure everything stays the same for each saved game\n
286 * This is accomplished by the use of a saved "random seed", as in\n
287 * "town_gen()". Since no other functions are called while the special\n
288 * seed is in effect, so this function is pretty "safe".\n
290 * Note that the "hacked seed" may provide an RNG with alternating parity!\n
292 void flavor_init(void)
295 u32b state_backup[4];
297 /* Hack -- Backup the RNG state */
298 Rand_state_backup(state_backup);
300 /* Hack -- Induce consistant flavors */
301 Rand_state_init(seed_flavor);
304 /* Initialize flavor index of each object by itself */
305 for (i = 0; i < max_k_idx; i++)
307 object_kind *k_ptr = &k_info[i];
309 /* Skip objects without flavor name */
310 if (!k_ptr->flavor_name) continue;
313 * Initialize flavor index to itself
314 * -> Shuffle it later
320 shuffle_flavors(TV_RING);
322 /* Shuffle Amulets */
323 shuffle_flavors(TV_AMULET);
326 shuffle_flavors(TV_STAFF);
329 shuffle_flavors(TV_WAND);
332 shuffle_flavors(TV_ROD);
334 /* Shuffle Mushrooms */
335 shuffle_flavors(TV_FOOD);
337 /* Shuffle Potions */
338 shuffle_flavors(TV_POTION);
340 /* Shuffle Scrolls */
341 shuffle_flavors(TV_SCROLL);
344 /* Hack -- Restore the RNG state */
345 Rand_state_restore(state_backup);
347 /* Analyze every object */
348 for (i = 1; i < max_k_idx; i++)
350 object_kind *k_ptr = &k_info[i];
352 /* Skip "empty" objects */
353 if (!k_ptr->name) continue;
355 /* No flavor yields aware */
356 if (!k_ptr->flavor) k_ptr->aware = TRUE;
358 /* Check for "easily known" */
359 k_ptr->easy_know = object_easy_know(i);
365 * @brief ÂоÝʸ»úÇÛÎó¤Ë°ìʸ»ú¤À¤±¤ò¥³¥Ô¡¼¤¹¤ë¡£
366 * @param t ÊÝ´ÉÀèʸ»úÎó¥Ý¥¤¥ó¥¿
367 * @param c Êݴɤ·¤¿¤¤1ʸ»ú
370 * Print a char "c" into a string "t", as if by sprintf(t, "%c", c),\n
371 * and return a pointer to the terminator (t + 1).\n
373 static char *object_desc_chr(char *t, char c)
386 * @brief ÂоÝʸ»úÇÛÎó¤Ëʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¡£
387 * @param t ÊÝ´ÉÀèʸ»úÎó¥Ý¥¤¥ó¥¿
388 * @param c ¥³¥Ô¡¼¤·¤¿¤¤Ê¸»úÎó¥Ý¥¤¥ó¥¿
391 * Print a string "s" into a string "t", as if by strcpy(t, s),
392 * and return a pointer to the terminator.
394 static char *object_desc_str(char *t, cptr s)
396 /* Copy the string */
397 while (*s) *t++ = *s++;
407 * @brief ÂоÝʸ»úÇÛÎó¤ËÉä¹æ¤Ê¤·À°¿ôÃͤò¥³¥Ô¡¼¤¹¤ë¡£
408 * @param t ÊÝ´ÉÀèʸ»úÎó¥Ý¥¤¥ó¥¿
409 * @param n ¥³¥Ô¡¼¤·¤¿¤¤¿ôÃÍ
412 * Print an unsigned number "n" into a string "t", as if by
413 * sprintf(t, "%u", n), and return a pointer to the terminator.
415 static char *object_desc_num(char *t, uint n)
419 /* Find "size" of "n" */
420 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
422 /* Dump each digit */
428 /* Remove the digit */
431 /* Process next digit */
447 * @brief ÆüËܸì¤Î¸Ä¿ôɽ¼¨¥ë¡¼¥Á¥ó
448 * @param t ÊÝ´ÉÀèʸ»úÎó¥Ý¥¤¥ó¥¿
449 * @param o_ptr µ½Ò¤·¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
452 * cmd1.c ¤ÇήÍѤ¹¤ë¤¿¤á¤Ë object_desc_japanese ¤«¤é°ÜÆ°¤·¤¿¡£
454 char *object_desc_kosuu(char *t, object_type *o_ptr)
456 t = object_desc_num(t, o_ptr->number);
468 t = object_desc_str(t, "ËÜ");
473 t = object_desc_str(t, "´¬");
478 t = object_desc_str(t, "Éþ");
482 case TV_SORCERY_BOOK:
490 case TV_CRUSADE_BOOK:
492 case TV_HISSATSU_BOOK:
495 t = object_desc_str(t, "ºý");
503 t = object_desc_str(t, "Ãå");
510 t = object_desc_str(t, "¿¶");
515 t = object_desc_str(t, "");
520 t = object_desc_str(t, "Ëç");
523 /* ¿©¤Ù¤â¤Î by ita */
526 if(o_ptr->sval == SV_FOOD_JERKY)
528 t = object_desc_str(t, "ÀÚ¤ì");
534 if (o_ptr->number < 10)
536 t = object_desc_str(t, "¤Ä");
540 t = object_desc_str(t, "¸Ä");
550 * @brief ÂоÝʸ»úÇÛÎó¤ËÉä¹æ¤¢¤êÀ°¿ôÃͤò¥³¥Ô¡¼¤¹¤ë¡£
551 * @param t ÊÝ´ÉÀèʸ»úÎó¥Ý¥¤¥ó¥¿
552 * @param n ¥³¥Ô¡¼¤·¤¿¤¤¿ôÃÍ
555 * Print an signed number "v" into a string "t", as if by
556 * sprintf(t, "%+d", n), and return a pointer to the terminator.
557 * Note that we always print a sign, either "+" or "-".
559 static char *object_desc_int(char *t, sint v)
566 /* Take the absolute value */
569 /* Use a "minus" sign */
573 /* Positive (or zero) */
576 /* Use the actual number */
579 /* Use a "plus" sign */
583 /* Find "size" of "n" */
584 for (p = 1; n >= p * 10; p = p * 10) /* loop */;
586 /* Dump each digit */
592 /* Remove the digit */
595 /* Process next digit */
608 * ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤Î¹½Â¤ÂÎ / Structs and tables for Auto Inscription for flags
610 typedef struct flag_insc_table
621 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(pvalÍ×ÁÇ) */
622 static flag_insc_table flag_insc_plus[] =
624 { "¹¶", "At", TR_BLOWS, -1 },
625 { "®", "Sp", TR_SPEED, -1 },
626 { "ÏÓ", "St", TR_STR, -1 },
627 { "ÃÎ", "In", TR_INT, -1 },
628 { "¸", "Wi", TR_WIS, -1 },
629 { "´ï", "Dx", TR_DEX, -1 },
630 { "ÂÑ", "Cn", TR_CON, -1 },
631 { "̥", "Ch", TR_CHR, -1 },
632 { "ƻ", "Md", TR_MAGIC_MASTERY, -1 },
633 { "±£", "Sl", TR_STEALTH, -1 },
634 { "õ", "Sr", TR_SEARCH, -1 },
635 { "ÀÖ", "If", TR_INFRA, -1 },
636 { "·¡", "Dg", TR_TUNNEL, -1 },
637 { NULL, NULL, 0, -1 }
640 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(ÌȱÖ) */
641 static flag_insc_table flag_insc_immune[] =
643 { "»À", "Ac", TR_IM_ACID, -1 },
644 { "ÅÅ", "El", TR_IM_ELEC, -1 },
645 { "²Ð", "Fi", TR_IM_FIRE, -1 },
646 { "Îä", "Co", TR_IM_COLD, -1 },
647 { NULL, NULL, 0, -1 }
650 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(ÂÑÀ) */
651 static flag_insc_table flag_insc_resistance[] =
653 { "»À", "Ac", TR_RES_ACID, TR_IM_ACID },
654 { "ÅÅ", "El", TR_RES_ELEC, TR_IM_ELEC },
655 { "²Ð", "Fi", TR_RES_FIRE, TR_IM_FIRE },
656 { "Îä", "Co", TR_RES_COLD, TR_IM_COLD },
657 { "ÆÇ", "Po", TR_RES_POIS, -1 },
658 { "Á®", "Li", TR_RES_LITE, -1 },
659 { "°Å", "Dk", TR_RES_DARK, -1 },
660 { "ÇË", "Sh", TR_RES_SHARDS, -1 },
661 { "ÌÕ", "Bl", TR_RES_BLIND, -1 },
662 { "Íð", "Cf", TR_RES_CONF, -1 },
663 { "¹ì", "So", TR_RES_SOUND, -1 },
664 { "¹ö", "Nt", TR_RES_NETHER, -1 },
665 { "°ø", "Nx", TR_RES_NEXUS, -1 },
666 { "ÆÙ", "Ca", TR_RES_CHAOS, -1 },
667 { "Îô", "Di", TR_RES_DISEN, -1 },
668 { "¶²", "Fe", TR_RES_FEAR, -1 },
669 { NULL, NULL, 0, -1 }
672 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(¤½¤Î¾ÆÃÀ) */
673 static flag_insc_table flag_insc_misc[] =
675 { "°×", "Es", TR_EASY_SPELL, -1 },
676 { "¸º", "Dm", TR_DEC_MANA, -1 },
677 { "Åê", "Th", TR_THROW, -1 },
678 { "ȿ", "Rf", TR_REFLECT, -1 },
679 { "Ëã", "Fa", TR_FREE_ACT, -1 },
680 { "ȑ", "Si", TR_SEE_INVIS, -1 },
681 { "·Ð", "Hl", TR_HOLD_LIFE, -1 },
682 { "ÃÙ", "Sd", TR_SLOW_DIGEST, -1 },
683 { "³è", "Rg", TR_REGEN, -1 },
684 { "Éâ", "Lv", TR_LEVITATION, -1 },
685 { "ÌÀ", "Lu", TR_LITE_1, -1 },
686 { "ÌÀ", "Lu", TR_LITE_2, -1 },
687 { "ÌÀ", "Lu", TR_LITE_3, -1 },
688 { "°Ç", "Dl", TR_LITE_M1, -1 },
689 { "°Ç", "Dl", TR_LITE_M2, -1 },
690 { "°Ç", "Dl", TR_LITE_M3, -1 },
691 { "·Ù", "Wr", TR_WARNING, -1 },
692 { "ÇÜ", "Xm", TR_XTRA_MIGHT, -1 },
693 { "¼Í", "Xs", TR_XTRA_SHOTS, -1 },
694 { "½Ö", "Te", TR_TELEPORT, -1 },
695 { "ÅÜ", "Ag", TR_AGGRAVATE, -1 },
696 { "½Ë", "Bs", TR_BLESSED, -1 },
697 { "´÷", "Ty", TR_TY_CURSE, -1 },
698 { "¼ö", "C-", TR_ADD_L_CURSE, -1 },
699 { "ëÇ", "C+", TR_ADD_H_CURSE, -1 },
700 { NULL, NULL, 0, -1 }
703 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(¥ª¡¼¥é) */
704 static flag_insc_table flag_insc_aura[] =
706 { "±ê", "F", TR_SH_FIRE, -1 },
707 { "ÅÅ", "E", TR_SH_ELEC, -1 },
708 { "Îä", "C", TR_SH_COLD, -1 },
709 { "Ëâ", "M", TR_NO_MAGIC, -1 },
710 { "½Ö", "T", TR_NO_TELE, -1 },
711 { NULL, NULL, 0, -1 }
714 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(°À¥¹¥ì¥¤) */
715 static flag_insc_table flag_insc_brand[] =
717 { "»À", "A", TR_BRAND_ACID, -1 },
718 { "ÅÅ", "E", TR_BRAND_ELEC, -1 },
719 { "¾Æ", "F", TR_BRAND_FIRE, -1 },
720 { "Åà", "Co", TR_BRAND_COLD, -1 },
721 { "ÆÇ", "P", TR_BRAND_POIS, -1 },
722 { "ÆÙ", "Ca", TR_CHAOTIC, -1 },
723 { "µÛ", "V", TR_VAMPIRIC, -1 },
724 { "¿Ì", "Q", TR_IMPACT, -1 },
725 { "ÀÚ", "S", TR_VORPAL, -1 },
726 { "Íý", "M", TR_FORCE_WEAPON, -1 },
727 { NULL, NULL, 0, -1 }
730 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(¼ï²¥¹¥ì¥¤) */
731 static flag_insc_table flag_insc_kill[] =
733 { "¼Ù", "*", TR_KILL_EVIL, -1 },
734 { "¿Í", "p", TR_KILL_HUMAN, -1 },
735 { "ζ", "D", TR_KILL_DRAGON, -1 },
736 { "¥ª", "o", TR_KILL_ORC, -1 },
737 { "¥È", "T", TR_KILL_TROLL, -1 },
738 { "µð", "P", TR_KILL_GIANT, -1 },
739 { "¥Ç", "U", TR_KILL_DEMON, -1 },
740 { "Ȉ", "L", TR_KILL_UNDEAD, -1 },
741 { "ư", "Z", TR_KILL_ANIMAL, -1 },
742 { NULL, NULL, 0, -1 }
745 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(¼ï²*¥¹¥ì¥¤*) */
746 static flag_insc_table flag_insc_slay[] =
748 { "¼Ù", "*", TR_SLAY_EVIL, TR_KILL_EVIL },
749 { "¿Í", "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
750 { "ε", "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
751 { "¥ª", "o", TR_SLAY_ORC, TR_KILL_ORC },
752 { "¥È", "T", TR_SLAY_TROLL, TR_KILL_TROLL },
753 { "µð", "P", TR_SLAY_GIANT, TR_KILL_GIANT },
754 { "¥Ç", "U", TR_SLAY_DEMON, TR_KILL_DEMON },
755 { "Ȉ", "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
756 { "ư", "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
757 { NULL, NULL, 0, -1 }
760 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(ESP1) */
761 static flag_insc_table flag_insc_esp1[] =
763 { "´¶", "Tele", TR_TELEPATHY, -1 },
764 { "¼Ù", "Evil", TR_ESP_EVIL, -1 },
765 { "Á±", "Good", TR_ESP_GOOD, -1 },
766 { "̵", "Nolv", TR_ESP_NONLIVING, -1 },
767 { "¸Ä", "Uniq", TR_ESP_UNIQUE, -1 },
768 { NULL, NULL, 0, -1 }
771 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(ESP2) */
772 static flag_insc_table flag_insc_esp2[] =
774 { "¿Í", "p", TR_ESP_HUMAN, -1 },
775 { "ε", "D", TR_ESP_DRAGON, -1 },
776 { "¥ª", "o", TR_ESP_ORC, -1 },
777 { "¥È", "T", TR_ESP_TROLL, -1 },
778 { "µð", "P", TR_ESP_GIANT, -1 },
779 { "¥Ç", "U", TR_ESP_DEMON, -1 },
780 { "Ȉ", "L", TR_ESP_UNDEAD, -1 },
781 { "ư", "Z", TR_ESP_ANIMAL, -1 },
782 { NULL, NULL, 0, -1 }
785 /*! ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÆÃÀɽ¼¨µ¹æ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ(ǽÎÏ°Ý»ý) */
786 static flag_insc_table flag_insc_sust[] =
788 { "ÏÓ", "St", TR_SUST_STR, -1 },
789 { "ÃÎ", "In", TR_SUST_INT, -1 },
790 { "¸", "Wi", TR_SUST_WIS, -1 },
791 { "´ï", "Dx", TR_SUST_DEX, -1 },
792 { "ÂÑ", "Cn", TR_SUST_CON, -1 },
793 { "̥", "Ch", TR_SUST_CHR, -1 },
794 { NULL, NULL, 0, -1 }
798 static flag_insc_table flag_insc_plus[] =
800 { "At", TR_BLOWS, -1 },
801 { "Sp", TR_SPEED, -1 },
802 { "St", TR_STR, -1 },
803 { "In", TR_INT, -1 },
804 { "Wi", TR_WIS, -1 },
805 { "Dx", TR_DEX, -1 },
806 { "Cn", TR_CON, -1 },
807 { "Ch", TR_CHR, -1 },
808 { "Md", TR_MAGIC_MASTERY, -1 },
809 { "Sl", TR_STEALTH, -1 },
810 { "Sr", TR_SEARCH, -1 },
811 { "If", TR_INFRA, -1 },
812 { "Dg", TR_TUNNEL, -1 },
816 static flag_insc_table flag_insc_immune[] =
818 { "Ac", TR_IM_ACID, -1 },
819 { "El", TR_IM_ELEC, -1 },
820 { "Fi", TR_IM_FIRE, -1 },
821 { "Co", TR_IM_COLD, -1 },
825 static flag_insc_table flag_insc_resistance[] =
827 { "Ac", TR_RES_ACID, TR_IM_ACID },
828 { "El", TR_RES_ELEC, TR_IM_ELEC },
829 { "Fi", TR_RES_FIRE, TR_IM_FIRE },
830 { "Co", TR_RES_COLD, TR_IM_COLD },
831 { "Po", TR_RES_POIS, -1 },
832 { "Li", TR_RES_LITE, -1 },
833 { "Dk", TR_RES_DARK, -1 },
834 { "Sh", TR_RES_SHARDS, -1 },
835 { "Bl", TR_RES_BLIND, -1 },
836 { "Cf", TR_RES_CONF, -1 },
837 { "So", TR_RES_SOUND, -1 },
838 { "Nt", TR_RES_NETHER, -1 },
839 { "Nx", TR_RES_NEXUS, -1 },
840 { "Ca", TR_RES_CHAOS, -1 },
841 { "Di", TR_RES_DISEN, -1 },
842 { "Fe", TR_RES_FEAR, -1 },
846 static flag_insc_table flag_insc_misc[] =
848 { "Es", TR_EASY_SPELL, -1 },
849 { "Dm", TR_DEC_MANA, -1 },
850 { "Th", TR_THROW, -1 },
851 { "Rf", TR_REFLECT, -1 },
852 { "Fa", TR_FREE_ACT, -1 },
853 { "Si", TR_SEE_INVIS, -1 },
854 { "Hl", TR_HOLD_LIFE, -1 },
855 { "Sd", TR_SLOW_DIGEST, -1 },
856 { "Rg", TR_REGEN, -1 },
857 { "Lv", TR_LEVITATION, -1 },
858 { "Lu", TR_LITE_1, -1 },
859 { "Lu", TR_LITE_2, -1 },
860 { "Lu", TR_LITE_3, -1 },
861 { "Dl", TR_LITE_M1, -1 },
862 { "Dl", TR_LITE_M2, -1 },
863 { "Dl", TR_LITE_M3, -1 },
864 { "Wr", TR_WARNING, -1 },
865 { "Xm", TR_XTRA_MIGHT, -1 },
866 { "Xs", TR_XTRA_SHOTS, -1 },
867 { "Te", TR_TELEPORT, -1 },
868 { "Ag", TR_AGGRAVATE, -1 },
869 { "Bs", TR_BLESSED, -1 },
870 { "Ty", TR_TY_CURSE, -1 },
871 { "C-", TR_ADD_L_CURSE, -1 },
872 { "C+", TR_ADD_H_CURSE, -1 },
876 static flag_insc_table flag_insc_aura[] =
878 { "F", TR_SH_FIRE, -1 },
879 { "E", TR_SH_ELEC, -1 },
880 { "C", TR_SH_COLD, -1 },
881 { "M", TR_NO_MAGIC, -1 },
882 { "T", TR_NO_TELE, -1 },
886 static flag_insc_table flag_insc_brand[] =
888 { "A", TR_BRAND_ACID, -1 },
889 { "E", TR_BRAND_ELEC, -1 },
890 { "F", TR_BRAND_FIRE, -1 },
891 { "Co", TR_BRAND_COLD, -1 },
892 { "P", TR_BRAND_POIS, -1 },
893 { "Ca", TR_CHAOTIC, -1 },
894 { "V", TR_VAMPIRIC, -1 },
895 { "Q", TR_IMPACT, -1 },
896 { "S", TR_VORPAL, -1 },
897 { "M", TR_FORCE_WEAPON, -1 },
901 static flag_insc_table flag_insc_kill[] =
903 { "*", TR_KILL_EVIL, -1 },
904 { "p", TR_KILL_HUMAN, -1 },
905 { "D", TR_KILL_DRAGON, -1 },
906 { "o", TR_KILL_ORC, -1 },
907 { "T", TR_KILL_TROLL, -1 },
908 { "P", TR_KILL_GIANT, -1 },
909 { "U", TR_KILL_DEMON, -1 },
910 { "L", TR_KILL_UNDEAD, -1 },
911 { "Z", TR_KILL_ANIMAL, -1 },
915 static flag_insc_table flag_insc_slay[] =
917 { "*", TR_SLAY_EVIL, TR_KILL_EVIL },
918 { "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
919 { "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
920 { "o", TR_SLAY_ORC, TR_KILL_ORC },
921 { "T", TR_SLAY_TROLL, TR_KILL_TROLL },
922 { "P", TR_SLAY_GIANT, TR_KILL_GIANT },
923 { "U", TR_SLAY_DEMON, TR_KILL_DEMON },
924 { "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
925 { "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
929 static flag_insc_table flag_insc_esp1[] =
931 { "Tele", TR_TELEPATHY, -1 },
932 { "Evil", TR_ESP_EVIL, -1 },
933 { "Good", TR_ESP_GOOD, -1 },
934 { "Nolv", TR_ESP_NONLIVING, -1 },
935 { "Uniq", TR_ESP_UNIQUE, -1 },
939 static flag_insc_table flag_insc_esp2[] =
941 { "p", TR_ESP_HUMAN, -1 },
942 { "D", TR_ESP_DRAGON, -1 },
943 { "o", TR_ESP_ORC, -1 },
944 { "T", TR_ESP_TROLL, -1 },
945 { "P", TR_ESP_GIANT, -1 },
946 { "U", TR_ESP_DEMON, -1 },
947 { "L", TR_ESP_UNDEAD, -1 },
948 { "Z", TR_ESP_ANIMAL, -1 },
952 static flag_insc_table flag_insc_sust[] =
954 { "St", TR_SUST_STR, -1 },
955 { "In", TR_SUST_INT, -1 },
956 { "Wi", TR_SUST_WIS, -1 },
957 { "Dx", TR_SUST_DEX, -1 },
958 { "Cn", TR_SUST_CON, -1 },
959 { "Ch", TR_SUST_CHR, -1 },
964 /* Simple macro for get_inscription() */
965 #define ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR)))
968 * Helper function for get_inscription()
970 static char *inscribe_flags_aux(flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE], bool kanji, char *ptr)
976 while (fi_ptr->english)
978 if (have_flag(flgs, fi_ptr->flag) &&
979 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
981 ADD_INSC(kanji ? fi_ptr->japanese : fi_ptr->english);
983 ADD_INSC(fi_ptr->english);
993 * Special variation of have_flag for auto-inscription
995 static bool have_flag_of(flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE])
997 while (fi_ptr->english)
999 if (have_flag(flgs, fi_ptr->flag) &&
1000 (fi_ptr->except_flag == -1 || !have_flag(flgs, fi_ptr->except_flag)))
1008 static char *get_ability_abbreviation(char *ptr, object_type *o_ptr, bool kanji, bool all)
1010 char *prev_ptr = ptr;
1011 u32b flgs[TR_FLAG_SIZE];
1013 /* Extract the flags */
1014 object_flags(o_ptr, flgs);
1016 /* Remove obvious flags */
1019 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1023 for (j = 0; j < TR_FLAG_SIZE; j++)
1024 flgs[j] &= ~k_ptr->flags[j];
1026 if (object_is_fixed_artifact(o_ptr))
1028 artifact_type *a_ptr = &a_info[o_ptr->name1];
1030 for (j = 0; j < TR_FLAG_SIZE; j++)
1031 flgs[j] &= ~a_ptr->flags[j];
1034 if (object_is_ego(o_ptr))
1036 ego_item_type *e_ptr = &e_info[o_ptr->name2];
1038 for (j = 0; j < TR_FLAG_SIZE; j++)
1039 flgs[j] &= ~e_ptr->flags[j];
1043 /* Remove lite flags when this is a dark lite object */
1044 if (have_dark_flag(flgs))
1046 if (have_flag(flgs, TR_LITE_1)) remove_flag(flgs, TR_LITE_1);
1047 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1048 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1050 else if (have_lite_flag(flgs))
1052 add_flag(flgs, TR_LITE_1);
1053 if (have_flag(flgs, TR_LITE_2)) remove_flag(flgs, TR_LITE_2);
1054 if (have_flag(flgs, TR_LITE_3)) remove_flag(flgs, TR_LITE_3);
1058 if (have_flag_of(flag_insc_plus, flgs))
1063 ptr = inscribe_flags_aux(flag_insc_plus, flgs, kanji, ptr);
1066 if (have_flag_of(flag_insc_immune, flgs))
1068 if (!kanji && ptr != prev_ptr)
1075 ptr = inscribe_flags_aux(flag_insc_immune, flgs, kanji, ptr);
1078 if (have_flag_of(flag_insc_resistance, flgs))
1082 else if (ptr != prev_ptr)
1088 ptr = inscribe_flags_aux(flag_insc_resistance, flgs, kanji, ptr);
1091 if (have_flag_of(flag_insc_misc, flgs))
1093 if (ptr != prev_ptr)
1099 ptr = inscribe_flags_aux(flag_insc_misc, flgs, kanji, ptr);
1102 if (have_flag_of(flag_insc_aura, flgs))
1106 ptr = inscribe_flags_aux(flag_insc_aura, flgs, kanji, ptr);
1109 if (have_flag_of(flag_insc_brand, flgs))
1111 ptr = inscribe_flags_aux(flag_insc_brand, flgs, kanji, ptr);
1114 if (have_flag_of(flag_insc_kill, flgs))
1116 ptr = inscribe_flags_aux(flag_insc_kill, flgs, kanji, ptr);
1119 if (have_flag_of(flag_insc_slay, flgs))
1121 ptr = inscribe_flags_aux(flag_insc_slay, flgs, kanji, ptr);
1126 if (have_flag_of(flag_insc_esp1, flgs) ||
1127 have_flag_of(flag_insc_esp2, flgs))
1129 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1130 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1134 if (have_flag_of(flag_insc_esp1, flgs))
1136 ptr = inscribe_flags_aux(flag_insc_esp1, flgs, kanji, ptr);
1137 if (have_flag_of(flag_insc_esp2, flgs))
1139 ptr = inscribe_flags_aux(flag_insc_esp2, flgs, kanji, ptr);
1143 if (have_flag_of(flag_insc_sust, flgs))
1147 ptr = inscribe_flags_aux(flag_insc_sust, flgs, kanji, ptr);
1156 * Get object inscription with auto inscription of object flags.
1158 static void get_inscription(char *buff, object_type *o_ptr)
1160 cptr insc = quark_str(o_ptr->inscription);
1163 /* Not fully identified */
1164 if (!(o_ptr->ident & IDENT_MENTAL))
1166 /* Copy until end of line or '#' */
1169 if (*insc == '#') break;
1171 if (iskanji(*insc)) *buff++ = *insc++;
1181 for (; *insc; insc++)
1183 /* Ignore fake artifact inscription */
1184 if (*insc == '#') break;
1186 /* {%} will be automatically converted */
1187 else if ('%' == *insc)
1193 /* check for too long inscription */
1194 if (ptr >= buff + MAX_NLEN) continue;
1207 if ('a' == insc[1] && 'l' == insc[2] && 'l' == insc[3])
1217 ptr = get_ability_abbreviation(ptr, o_ptr, kanji, all);
1230 bool object_is_quest_target(object_type *o_ptr)
1232 if (p_ptr->inside_quest)
1234 int a_idx = quest[p_ptr->inside_quest].k_idx;
1237 artifact_type *a_ptr = &a_info[a_idx];
1238 if (!(a_ptr->gen_flags & TRG_INSTA_ART))
1240 if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
1252 * Creates a description of the item "o_ptr", and stores it in "out_val".
1254 * One can choose the "verbosity" of the description, including whether
1255 * or not the "number" of items should be described, and how much detail
1256 * should be used when describing the item.
1258 * The given "buf" must be MAX_NLEN chars long to hold the longest possible
1259 * description, which can get pretty long, including incriptions, such as:
1260 * "no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".
1261 * Note that the inscription will be clipped to keep the total description
1262 * under MAX_NLEN-1 chars (plus a terminator).
1264 * Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,
1265 * portable, versions of some common "sprintf()" commands.
1267 * Note that all ego-items (when known) append an "Ego-Item Name", unless
1268 * the item is also an artifact, which should NEVER happen.
1270 * Note that all artifacts (when known) append an "Artifact Name", so we
1271 * have special processing for "Specials" (artifact Lites, Rings, Amulets).
1272 * The "Specials" never use "modifiers" if they are "known", since they
1273 * have special "descriptions", such as "The Necklace of the Dwarves".
1275 * Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),
1276 * plus the artifact name, just like any other artifact, if known.
1278 * Special Ring's and Amulet's, if not "aware", use the same code as normal
1279 * rings and amulets, and if "aware", use the "k_info" base-name (Ring or
1280 * Amulet or Necklace). They will NEVER "append" the "k_info" name. But,
1281 * they will append the artifact name, just like any artifact, if known.
1283 * Hack -- Display "The One Ring" as "a Plain Gold Ring" until aware.
1286 * OD_NAME_ONLY : The Cloak of Death
1287 * OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]
1288 * OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)
1289 * 0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}
1291 * OD_OMIT_PREFIX : Forbidden numeric prefix
1292 * OD_NO_PLURAL : Forbidden use of plural
1293 * OD_STORE : Assume to be aware and known
1294 * OD_NO_FLAVOR : Allow to hidden flavor
1295 * OD_FORCE_FLAVOR : Get un-shuffled flavor name
1297 void object_desc(char *buf, object_type *o_ptr, u32b mode)
1299 /* Extract object kind name */
1300 cptr kindname = k_name + k_info[o_ptr->k_idx].name;
1302 /* Extract default "base" string */
1303 cptr basenm = kindname;
1305 /* Assume no "modifier" string */
1315 bool show_weapon = FALSE;
1316 bool show_armour = FALSE;
1321 char p1 = '(', p2 = ')';
1322 char b1 = '[', b2 = ']';
1323 char c1 = '{', c2 = '}';
1325 char tmp_val[MAX_NLEN+160];
1326 char tmp_val2[MAX_NLEN+10];
1327 char fake_insc_buf[30];
1329 u32b flgs[TR_FLAG_SIZE];
1331 object_type *bow_ptr;
1333 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1334 object_kind *flavor_k_ptr = &k_info[k_ptr->flavor];
1336 /* Extract some flags */
1337 object_flags(o_ptr, flgs);
1339 /* See if the object is "aware" */
1340 if (object_is_aware(o_ptr)) aware = TRUE;
1342 /* See if the object is "known" */
1343 if (object_is_known(o_ptr)) known = TRUE;
1345 /* Allow flavors to be hidden when aware */
1346 if (aware && ((mode & OD_NO_FLAVOR) || plain_descriptions)) flavor = FALSE;
1348 /* Object is in the inventory of a store or spoiler */
1349 if ((mode & OD_STORE) || (o_ptr->ident & IDENT_STORE))
1351 /* Don't show flavors */
1354 /* Pretend known and aware */
1359 /* Force to be flavor name only */
1360 if (mode & OD_FORCE_FLAVOR)
1366 /* Cancel shuffling */
1367 flavor_k_ptr = k_ptr;
1370 /* Analyze the object */
1371 switch (o_ptr->tval)
1373 /* Some objects are easy to describe */
1387 monster_race *r_ptr = &r_info[o_ptr->pval];
1396 modstr = " (empty)";
1402 sprintf(tmp_val2, " (%s)",r_name + r_ptr->name);
1405 cptr t = r_name + r_ptr->name;
1407 if (!(r_ptr->flags1 & RF1_UNIQUE))
1409 sprintf(tmp_val2, " (%s%s)", (is_a_vowel(*t) ? "an " : "a "), t);
1415 sprintf(tmp_val2, "(%s)", t);
1425 /* Figurines/Statues */
1429 monster_race *r_ptr = &r_info[o_ptr->pval];
1432 modstr = r_name + r_ptr->name;
1434 cptr 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);
1455 monster_race *r_ptr = &r_info[o_ptr->pval];
1457 modstr = r_name + r_ptr->name;
1462 if (r_ptr->flags1 & RF1_UNIQUE)
1463 basenm = "& % of #";
1471 /* Missiles/ Bows/ Weapons */
1500 /* Lites (including a few "Specials") */
1506 /* Amulets (including a few "Specials") */
1509 /* Known artifacts */
1512 if (object_is_fixed_artifact(o_ptr)) break;
1513 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1516 /* Color the object */
1517 modstr = k_name + flavor_k_ptr->flavor_name;
1520 if (!flavor) basenm = "%¤Î¥¢¥ß¥å¥ì¥Ã¥È";
1521 else if (aware) basenm = "%¤Î#¥¢¥ß¥å¥ì¥Ã¥È";
1522 else basenm = "#¥¢¥ß¥å¥ì¥Ã¥È";
1524 if (!flavor) basenm = "& Amulet~ of %";
1525 else if (aware) basenm = "& # Amulet~ of %";
1526 else basenm = "& # Amulet~";
1532 /* Rings (including a few "Specials") */
1535 /* Known artifacts */
1538 if (object_is_fixed_artifact(o_ptr)) break;
1539 if (k_ptr->gen_flags & TRG_INSTA_ART) break;
1542 /* Color the object */
1543 modstr = k_name + flavor_k_ptr->flavor_name;
1546 if (!flavor) basenm = "%¤Î»ØÎØ";
1547 else if (aware) basenm = "%¤Î#»ØÎØ";
1548 else basenm = "#»ØÎØ";
1550 if (!flavor) basenm = "& Ring~ of %";
1551 else if (aware) basenm = "& # Ring~ of %";
1552 else basenm = "& # Ring~";
1555 if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
1567 /* Color the object */
1568 modstr = k_name + flavor_k_ptr->flavor_name;
1571 if (!flavor) basenm = "%¤Î¾ó";
1572 else if (aware) basenm = "%¤Î#¾ó";
1573 else basenm = "#¾ó";
1575 if (!flavor) basenm = "& Staff~ of %";
1576 else if (aware) basenm = "& # Staff~ of %";
1577 else basenm = "& # Staff~";
1585 /* Color the object */
1586 modstr = k_name + flavor_k_ptr->flavor_name;
1589 if (!flavor) basenm = "%¤ÎËâË¡ËÀ";
1590 else if (aware) basenm = "%¤Î#ËâË¡ËÀ";
1591 else basenm = "#ËâË¡ËÀ";
1593 if (!flavor) basenm = "& Wand~ of %";
1594 else if (aware) basenm = "& # Wand~ of %";
1595 else basenm = "& # Wand~";
1603 /* Color the object */
1604 modstr = k_name + flavor_k_ptr->flavor_name;
1607 if (!flavor) basenm = "%¤Î¥í¥Ã¥É";
1608 else if (aware) basenm = "%¤Î#¥í¥Ã¥É";
1609 else basenm = "#¥í¥Ã¥É";
1611 if (!flavor) basenm = "& Rod~ of %";
1612 else if (aware) basenm = "& # Rod~ of %";
1613 else basenm = "& # Rod~";
1621 /* Color the object */
1622 modstr = k_name + flavor_k_ptr->flavor_name;
1625 if (!flavor) basenm = "%¤Î´¬Êª";
1626 else if (aware) basenm = "¡Ö#¡×¤È½ñ¤«¤ì¤¿%¤Î´¬Êª";
1627 else basenm = "¡Ö#¡×¤È½ñ¤«¤ì¤¿´¬Êª";
1629 if (!flavor) basenm = "& Scroll~ of %";
1630 else if (aware) basenm = "& Scroll~ titled \"#\" of %";
1631 else basenm = "& Scroll~ titled \"#\"";
1639 /* Color the object */
1640 modstr = k_name + flavor_k_ptr->flavor_name;
1643 if (!flavor) basenm = "%¤ÎÌô";
1644 else if (aware) basenm = "%¤Î#Ìô";
1645 else basenm = "#Ìô";
1647 if (!flavor) basenm = "& Potion~ of %";
1648 else if (aware) basenm = "& # Potion~ of %";
1649 else basenm = "& # Potion~";
1657 /* Ordinary food is "boring" */
1658 if (!k_ptr->flavor_name) break;
1660 /* Color the object */
1661 modstr = k_name + flavor_k_ptr->flavor_name;
1664 if (!flavor) basenm = "%¤Î¥¥Î¥³";
1665 else if (aware) basenm = "%¤Î#¥¥Î¥³";
1666 else basenm = "#¥¥Î¥³";
1668 if (!flavor) basenm = "& Mushroom~ of %";
1669 else if (aware) basenm = "& # Mushroom~ of %";
1670 else basenm = "& # Mushroom~";
1679 basenm = "ÍÓÈé»æ - %";
1681 basenm = "& Parchment~ - %";
1690 basenm = "À¸Ì¿¤ÎËâË¡½ñ%";
1692 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1693 basenm = "& Book~ of Life Magic %";
1695 basenm = "& Life Spellbook~ %";
1701 case TV_SORCERY_BOOK:
1704 basenm = "Àç½Ñ¤ÎËâË¡½ñ%";
1706 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1707 basenm = "& Book~ of Sorcery %";
1709 basenm = "& Sorcery Spellbook~ %";
1715 case TV_NATURE_BOOK:
1718 basenm = "¼«Á³¤ÎËâË¡½ñ%";
1720 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1721 basenm = "& Book~ of Nature Magic %";
1723 basenm = "& Nature Spellbook~ %";
1732 basenm = "¥«¥ª¥¹¤ÎËâË¡½ñ%";
1734 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1735 basenm = "& Book~ of Chaos Magic %";
1737 basenm = "& Chaos Spellbook~ %";
1746 basenm = "°Å¹õ¤ÎËâË¡½ñ%";
1748 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1749 basenm = "& Book~ of Death Magic %";
1751 basenm = "& Death Spellbook~ %";
1760 basenm = "¥È¥é¥ó¥×¤ÎËâË¡½ñ%";
1762 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1763 basenm = "& Book~ of Trump Magic %";
1765 basenm = "& Trump Spellbook~ %";
1771 case TV_ARCANE_BOOK:
1774 basenm = "Èë½Ñ¤ÎËâË¡½ñ%";
1776 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1777 basenm = "& Book~ of Arcane Magic %";
1779 basenm = "& Arcane Spellbook~ %";
1788 basenm = "¾¢¤ÎËâË¡½ñ%";
1790 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1791 basenm = "& Book~ of Craft Magic %";
1793 basenm = "& Craft Spellbook~ %";
1799 case TV_DAEMON_BOOK:
1802 basenm = "°Ëâ¤ÎËâË¡½ñ%";
1804 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1805 basenm = "& Book~ of Daemon Magic %";
1807 basenm = "& Daemon Spellbook~ %";
1813 case TV_CRUSADE_BOOK:
1816 basenm = "Ç˼٤ÎËâË¡½ñ%";
1818 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1819 basenm = "& Book~ of Crusade Magic %";
1821 basenm = "& Crusade Spellbook~ %";
1832 basenm = "& Song Book~ %";
1838 case TV_HISSATSU_BOOK:
1841 basenm = "& Éð·Ý¤Î½ñ%";
1843 basenm = "Book~ of Kendo %";
1852 basenm = "¼ö½Ñ¤ÎËâË¡½ñ%";
1854 if (mp_ptr->spell_book == TV_LIFE_BOOK)
1855 basenm = "& Book~ of Hex Magic %";
1857 basenm = "& Hex Spellbook~ %";
1863 /* Hack -- Gold/Gems */
1866 strcpy(buf, basenm);
1870 /* Used in the "inventory" routine */
1874 strcpy(buf, "(¤Ê¤·)");
1876 strcpy(buf, "(nothing)");
1883 /* Use full name from k_info or a_info */
1884 if (aware && have_flag(flgs, TR_FULL_NAME))
1886 if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
1887 else basenm = kindname;
1890 /* Start dumping the result */
1894 if (basenm[0] == '&')
1900 if (mode & OD_OMIT_PREFIX)
1904 else if (o_ptr->number > 1)
1906 t = object_desc_kosuu(t, o_ptr);
1907 t = object_desc_str(t, "¤Î ");
1910 /* ±Ñ¸ì¤Î¾ì¹ç¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤Ï The ¤¬ÉÕ¤¯¤Î¤Çʬ¤«¤ë¤¬
1911 * ÆüËܸì¤Ç¤Ïʬ¤«¤é¤Ê¤¤¤Î¤Ç¥Þ¡¼¥¯¤ò¤Ä¤±¤ë
1915 if (object_is_fixed_artifact(o_ptr)) t = object_desc_str(t, "¡ú");
1916 else if (o_ptr->art_name) t = object_desc_str(t, "¡ù");
1921 /* The object "expects" a "number" */
1922 if (basenm[0] == '&')
1924 /* Skip the ampersand (and space) */
1928 if (mode & OD_OMIT_PREFIX)
1933 /* Hack -- None left */
1934 else if (o_ptr->number <= 0)
1936 t = object_desc_str(t, "no more ");
1939 /* Extract the number */
1940 else if (o_ptr->number > 1)
1942 t = object_desc_num(t, o_ptr->number);
1943 t = object_desc_chr(t, ' ');
1946 /* Hack -- The only one of its kind */
1947 else if ((known && object_is_artifact(o_ptr)) ||
1948 ((o_ptr->tval == TV_CORPSE) &&
1949 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)))
1951 t = object_desc_str(t, "The ");
1961 case '#': vowel = is_a_vowel(modstr[0]); break;
1962 case '%': vowel = is_a_vowel(*kindname); break;
1963 default: vowel = is_a_vowel(*s); break;
1968 /* A single one, with a vowel */
1969 t = object_desc_str(t, "an ");
1973 /* A single one, without a vowel */
1974 t = object_desc_str(t, "a ");
1979 /* Hack -- objects that "never" take an article */
1986 if (mode & OD_OMIT_PREFIX)
1991 /* Hack -- all gone */
1992 else if (o_ptr->number <= 0)
1994 t = object_desc_str(t, "no more ");
1997 /* Prefix a number if required */
1998 else if (o_ptr->number > 1)
2000 t = object_desc_num(t, o_ptr->number);
2001 t = object_desc_chr(t, ' ');
2004 /* Hack -- The only one of its kind */
2005 else if (known && object_is_artifact(o_ptr))
2007 t = object_desc_str(t, "The ");
2010 /* Hack -- single items get no prefix */
2018 /* Paranoia -- skip illegal tildes */
2019 /* while (*s == '~') s++; */
2022 if (object_is_smith(o_ptr))
2024 t = object_desc_str(t, format("ÃÃÌê»Õ%s¤Î", player_name));
2027 /* ÅÁÀâ¤Î¥¢¥¤¥Æ¥à¡¢Ì¾¤Î¤¢¤ë¥¢¥¤¥Æ¥à¤Î̾Á°¤òÉղ乤ë */
2030 /* ¥é¥ó¥À¥à¡¦¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È */
2031 if (o_ptr->art_name)
2033 cptr temp = quark_str(o_ptr->art_name);
2035 /* '¡Ø' ¤«¤é»Ï¤Þ¤é¤Ê¤¤ÅÁÀâ¤Î¥¢¥¤¥Æ¥à¤Î̾Á°¤ÏºÇ½é¤ËÉղ乤ë */
2036 /* ±Ñ¸ìÈǤΥ»¡¼¥Ö¥Õ¥¡¥¤¥ë¤«¤éÍ褿 'of XXX' ¤Ï,¡ÖXXX¤Î¡×¤Èɽ¼¨¤¹¤ë */
2037 if (strncmp(temp, "of ", 3) == 0)
2039 t = object_desc_str(t, &temp[3]);
2040 t = object_desc_str(t, "¤Î");
2042 else if ((strncmp(temp, "¡Ø", 2) != 0) &&
2043 (strncmp(temp, "¡Ô", 2) != 0) &&
2045 t = object_desc_str(t, temp);
2047 /* ÅÁÀâ¤Î¥¢¥¤¥Æ¥à */
2048 else if (o_ptr->name1 && !have_flag(flgs, TR_FULL_NAME))
2050 artifact_type *a_ptr = &a_info[o_ptr->name1];
2051 /* '¡Ø' ¤«¤é»Ï¤Þ¤é¤Ê¤¤ÅÁÀâ¤Î¥¢¥¤¥Æ¥à¤Î̾Á°¤ÏºÇ½é¤ËÉղ乤ë */
2052 if (strncmp(a_name + a_ptr->name, "¡Ø", 2) != 0)
2054 t = object_desc_str(t, a_name + a_ptr->name);
2057 /* ̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à */
2058 else if (object_is_ego(o_ptr))
2060 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2061 t = object_desc_str(t, e_name + e_ptr->name);
2066 /* Copy the string */
2067 for (s0 = NULL; *s || s0; )
2069 /* The end of the flavour/kind string. */
2076 /* Begin to append the modifier (flavor) */
2077 else if ((*s == '#') && !s0)
2082 /* Paranoia -- Never append multiple modstrs */
2086 /* Begin to append the kind name */
2087 else if ((*s == '%') && !s0)
2092 /* Paranoia -- Never append multiple kindnames */
2100 /* Add a plural if needed */
2101 if (!(mode & OD_NO_PLURAL) && (o_ptr->number != 1))
2105 /* XXX XXX XXX Mega-Hack */
2107 /* Hack -- "Cutlass-es" and "Torch-es" */
2108 if ((k == 's') || (k == 'h')) *t++ = 'e';
2130 /* '¡Ø'¤«¤é»Ï¤Þ¤ëÅÁÀâ¤Î¥¢¥¤¥Æ¥à¤Î̾Á°¤ÏºÇ¸å¤ËÉղ乤ë */
2133 /* ¥é¥ó¥À¥à¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤Î̾Á°¤Ï¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ËµÏ¿
2134 ¤µ¤ì¤ë¤Î¤Ç¡¢±Ñ¸ìÈǤÎ̾Á°¤â¤½¤ì¤é¤·¤¯ÊÑ´¹¤¹¤ë */
2135 if (o_ptr->art_name)
2139 strcpy(temp, quark_str(o_ptr->art_name));
2140 /* MEGA HACK by ita */
2141 if (strncmp(temp, "¡Ø", 2) == 0 ||
2142 strncmp(temp, "¡Ô", 2) == 0)
2143 t = object_desc_str(t, temp);
2144 else if (temp[0] == '\'')
2146 itemp = strlen(temp);
2147 temp[itemp - 1] = 0;
2148 t = object_desc_str(t, "¡Ø");
2149 t = object_desc_str(t, &temp[1]);
2150 t = object_desc_str(t, "¡Ù");
2153 else if (object_is_fixed_artifact(o_ptr))
2155 artifact_type *a_ptr = &a_info[o_ptr->name1];
2156 if (strncmp(a_name + a_ptr->name, "¡Ø", 2) == 0)
2158 t = object_desc_str(t, a_name + a_ptr->name);
2161 else if (o_ptr->inscription)
2163 cptr str = quark_str(o_ptr->inscription);
2172 if (*str == '#') break;
2178 cptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2180 /* Add the false name */
2181 t = object_desc_str(t,"¡Ø");
2182 t = object_desc_str(t, &str[1]);
2183 t = object_desc_str(t,"¡Ù");
2188 if (object_is_smith(o_ptr))
2190 t = object_desc_str(t,format(" of %s the Smith",player_name));
2193 /* Hack -- Append "Artifact" or "Special" names */
2194 if (known && !have_flag(flgs, TR_FULL_NAME))
2196 /* Is it a new random artifact ? */
2197 if (o_ptr->art_name)
2199 t = object_desc_chr(t, ' ');
2200 t = object_desc_str(t, quark_str(o_ptr->art_name));
2203 /* Grab any artifact name */
2204 else if (object_is_fixed_artifact(o_ptr))
2206 artifact_type *a_ptr = &a_info[o_ptr->name1];
2208 t = object_desc_chr(t, ' ');
2209 t = object_desc_str(t, a_name + a_ptr->name);
2212 /* Grab any ego-item name */
2215 if (object_is_ego(o_ptr))
2217 ego_item_type *e_ptr = &e_info[o_ptr->name2];
2219 t = object_desc_chr(t, ' ');
2220 t = object_desc_str(t, e_name + e_ptr->name);
2223 if (o_ptr->inscription && my_strchr(quark_str(o_ptr->inscription), '#'))
2226 cptr str = my_strchr(quark_str(o_ptr->inscription), '#');
2228 /* Add the false name */
2229 t = object_desc_chr(t, ' ');
2230 t = object_desc_str(t, &str[1]);
2237 /* No more details wanted */
2238 if (mode & OD_NAME_ONLY) goto object_desc_done;
2240 /* Hack -- Chests must be described in detail */
2241 if (o_ptr->tval == TV_CHEST)
2243 /* Not searched yet */
2249 /* May be "empty" */
2250 else if (!o_ptr->pval)
2253 t = object_desc_str(t, "(¶õ)");
2255 t = object_desc_str(t, " (empty)");
2259 /* May be "disarmed" */
2260 else if (o_ptr->pval < 0)
2262 if (chest_traps[0 - o_ptr->pval])
2265 t = object_desc_str(t, "(²ò½üºÑ)");
2267 t = object_desc_str(t, " (disarmed)");
2273 t = object_desc_str(t, "(Èó»Ü¾û)");
2275 t = object_desc_str(t, " (unlocked)");
2280 /* Describe the traps, if any */
2283 /* Describe the traps */
2284 switch (chest_traps[o_ptr->pval])
2289 t = object_desc_str(t, "(»Ü¾û)");
2291 t = object_desc_str(t, " (Locked)");
2295 case CHEST_LOSE_STR:
2298 t = object_desc_str(t, "(ÆÇ¿Ë)");
2300 t = object_desc_str(t, " (Poison Needle)");
2304 case CHEST_LOSE_CON:
2307 t = object_desc_str(t, "(ÆÇ¿Ë)");
2309 t = object_desc_str(t, " (Poison Needle)");
2316 t = object_desc_str(t, "(¥¬¥¹¡¦¥È¥é¥Ã¥×)");
2318 t = object_desc_str(t, " (Gas Trap)");
2322 case CHEST_PARALYZE:
2325 t = object_desc_str(t, "(¥¬¥¹¡¦¥È¥é¥Ã¥×)");
2327 t = object_desc_str(t, " (Gas Trap)");
2334 t = object_desc_str(t, "(ÇúȯÁõÃÖ)");
2336 t = object_desc_str(t, " (Explosion Device)");
2341 case CHEST_BIRD_STORM:
2342 case CHEST_E_SUMMON:
2343 case CHEST_H_SUMMON:
2346 t = object_desc_str(t, "(¾¤´¤Î¥ë¡¼¥ó)");
2348 t = object_desc_str(t, " (Summoning Runes)");
2352 case CHEST_RUNES_OF_EVIL:
2355 t = object_desc_str(t, "(¼Ù°¤Ê¥ë¡¼¥ó)");
2357 t = object_desc_str(t, " (Gleaming Black Runes)");
2364 t = object_desc_str(t, "(·ÙÊóÁõÃÖ)");
2366 t = object_desc_str(t, " (Alarm)");
2373 t = object_desc_str(t, "(¥Þ¥ë¥Á¡¦¥È¥é¥Ã¥×)");
2375 t = object_desc_str(t, " (Multiple Traps)");
2384 /* Display the item like a weapon */
2385 if (have_flag(flgs, TR_SHOW_MODS)) show_weapon = TRUE;
2387 /* Display the item like a weapon */
2388 if (object_is_smith(o_ptr) && (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE))
2391 /* Display the item like a weapon */
2392 if (o_ptr->to_h && o_ptr->to_d) show_weapon = TRUE;
2394 /* Display the item like armour */
2395 if (o_ptr->ac) show_armour = TRUE;
2398 /* Dump base weapon info */
2399 switch (o_ptr->tval)
2401 /* Missiles and Weapons */
2410 /* In Vault Quest, hide the dice of target weapon. */
2411 if(object_is_quest_target(o_ptr) && !known)
2416 /* Append a "damage" string */
2417 t = object_desc_chr(t, ' ');
2418 t = object_desc_chr(t, p1);
2419 t = object_desc_num(t, o_ptr->dd);
2420 t = object_desc_chr(t, 'd');
2421 t = object_desc_num(t, o_ptr->ds);
2422 t = object_desc_chr(t, p2);
2428 /* Bows get a special "damage string" */
2431 /* Mega-Hack -- Extract the "base power" */
2432 power = bow_tmul(o_ptr->sval);
2434 /* Apply the "Extra Might" flag */
2435 if (have_flag(flgs, TR_XTRA_MIGHT)) power++;
2437 /* Append a special "damage" string */
2438 t = object_desc_chr(t, ' ');
2439 t = object_desc_chr(t, p1);
2440 t = object_desc_chr(t, 'x');
2441 t = object_desc_num(t, power);
2442 t = object_desc_chr(t, p2);
2444 fire_rate = calc_num_fire(o_ptr);
2445 /* Show Fire rate */
2446 if (fire_rate != 0 && power > 0 && known)
2448 fire_rate = bow_energy(o_ptr->sval) / fire_rate;
2450 t = object_desc_chr(t, ' ');
2451 t = object_desc_chr(t, p1);
2452 t = object_desc_num(t, fire_rate/100);
2453 t = object_desc_chr(t, '.');
2454 t = object_desc_num(t, fire_rate%100);
2455 t = object_desc_str(t, "turn");
2456 t = object_desc_chr(t, p2);
2464 /* Add the weapon bonuses */
2467 /* Show the tohit/todam on request */
2470 t = object_desc_chr(t, ' ');
2471 t = object_desc_chr(t, p1);
2472 t = object_desc_int(t, o_ptr->to_h);
2473 t = object_desc_chr(t, ',');
2474 t = object_desc_int(t, o_ptr->to_d);
2475 t = object_desc_chr(t, p2);
2478 /* Show the tohit if needed */
2479 else if (o_ptr->to_h)
2481 t = object_desc_chr(t, ' ');
2482 t = object_desc_chr(t, p1);
2483 t = object_desc_int(t, o_ptr->to_h);
2484 t = object_desc_chr(t, p2);
2487 /* Show the todam if needed */
2488 else if (o_ptr->to_d)
2490 t = object_desc_chr(t, ' ');
2491 t = object_desc_chr(t, p1);
2492 t = object_desc_int(t, o_ptr->to_d);
2493 t = object_desc_chr(t, p2);
2497 bow_ptr = &inventory[INVEN_BOW];
2499 /* If have a firing weapon + ammo matches bow */
2500 if (bow_ptr->k_idx && (o_ptr->tval == p_ptr->tval_ammo))
2502 int avgdam = o_ptr->dd * (o_ptr->ds + 1) * 10 / 2;
2503 int tmul = bow_tmul(bow_ptr->sval);
2504 s16b energy_fire = bow_energy(bow_ptr->sval);
2506 /* See if the bow is "known" - then set damage bonus */
2507 if (object_is_known(bow_ptr)) avgdam += (bow_ptr->to_d * 10);
2509 /* Effect of ammo */
2510 if (known) avgdam += (o_ptr->to_d * 10);
2512 /* Get extra "power" from "extra might" */
2513 if (p_ptr->xtra_might) tmul++;
2515 tmul = tmul * (100 + (int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
2517 /* Launcher multiplier */
2519 avgdam /= (100 * 10);
2521 /* Get extra damage from concentration */
2522 if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
2524 if (avgdam < 0) avgdam = 0;
2526 /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
2527 t = object_desc_chr(t, ' ');
2528 t = object_desc_chr(t, p1);
2530 if(show_ammo_no_crit)
2532 /* Damage with no-crit */
2533 t = object_desc_num(t, avgdam);
2534 t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2537 /* Apply Expect damage of Critical */
2538 avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
2539 t = object_desc_num(t, avgdam);
2541 t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
2542 : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
2544 if (p_ptr->num_fire == 0)
2546 t = object_desc_chr(t, '0');
2550 /* Calc effects of energy */
2551 avgdam *= (p_ptr->num_fire * 100);
2552 avgdam /= energy_fire;
2553 t = object_desc_num(t, avgdam);
2554 t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
2556 if(show_ammo_crit_ratio)
2558 int percent = calc_crit_ratio_shot(o_ptr->weight,
2559 known ? o_ptr->to_h : 0,
2560 object_is_known(bow_ptr) ? bow_ptr->to_h : 0, avgdam);
2562 t = object_desc_chr(t, '/');
2563 t = object_desc_num(t, percent / 100);
2564 t = object_desc_chr(t, '.');
2565 t = object_desc_num(t, percent % 100);
2566 t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
2570 t = object_desc_chr(t, p2);
2572 else if ((p_ptr->pclass == CLASS_NINJA) && (o_ptr->tval == TV_SPIKE))
2574 int avgdam = p_ptr->mighty_throw ? (1 + 3) : 1;
2575 s16b energy_fire = 100 - p_ptr->lev;
2577 avgdam += ((p_ptr->lev + 30) * (p_ptr->lev + 30) - 900) / 55;
2579 /* Display (shot damage/ avg damage) */
2580 t = object_desc_chr(t, ' ');
2581 t = object_desc_chr(t, p1);
2582 t = object_desc_num(t, avgdam);
2583 t = object_desc_chr(t, '/');
2585 /* Calc effects of energy */
2586 avgdam = 100 * avgdam / energy_fire;
2588 t = object_desc_num(t, avgdam);
2589 t = object_desc_chr(t, p2);
2592 /* Add the armor bonuses */
2595 /* Show the armor class info */
2598 t = object_desc_chr(t, ' ');
2599 t = object_desc_chr(t, b1);
2600 t = object_desc_num(t, o_ptr->ac);
2601 t = object_desc_chr(t, ',');
2602 t = object_desc_int(t, o_ptr->to_a);
2603 t = object_desc_chr(t, b2);
2606 /* No base armor, but does increase armor */
2607 else if (o_ptr->to_a)
2609 t = object_desc_chr(t, ' ');
2610 t = object_desc_chr(t, b1);
2611 t = object_desc_int(t, o_ptr->to_a);
2612 t = object_desc_chr(t, b2);
2616 /* Hack -- always show base armor */
2617 else if (show_armour)
2619 t = object_desc_chr(t, ' ');
2620 t = object_desc_chr(t, b1);
2621 t = object_desc_num(t, o_ptr->ac);
2622 t = object_desc_chr(t, b2);
2626 /* No more details wanted */
2627 if (mode & OD_NAME_AND_ENCHANT) goto object_desc_done;
2630 if (known) /* Known item only */
2633 * Hack -- Wands and Staffs have charges. Make certain how many charges
2634 * a stack of staffs really has is clear. -LM-
2636 if (((o_ptr->tval == TV_STAFF) || (o_ptr->tval == TV_WAND)))
2638 /* Dump " (N charges)" */
2639 t = object_desc_chr(t, ' ');
2640 t = object_desc_chr(t, p1);
2642 /* Clear explaination for staffs. */
2643 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
2645 t = object_desc_num(t, o_ptr->number);
2646 t = object_desc_str(t, "x ");
2648 t = object_desc_num(t, o_ptr->pval);
2650 t = object_desc_str(t, "²óʬ");
2652 t = object_desc_str(t, " charge");
2653 if (o_ptr->pval != 1) t = object_desc_chr(t, 's');
2656 t = object_desc_chr(t, p2);
2658 /* Hack -- Rods have a "charging" indicator. Now that stacks of rods may
2659 * be in any state of charge or discharge, this now includes a number. -LM-
2661 else if (o_ptr->tval == TV_ROD)
2663 /* Hack -- Dump " (# charging)" if relevant */
2666 /* Stacks of rods display an exact count of charging rods. */
2667 if (o_ptr->number > 1)
2670 if (k_ptr->pval == 0) k_ptr->pval = 1;
2672 /* Find out how many rods are charging, by dividing
2673 * current timeout by each rod's maximum timeout.
2674 * Ensure that any remainder is rounded up. Display
2675 * very discharged stacks as merely fully discharged.
2677 power = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
2678 if (power > o_ptr->number) power = o_ptr->number;
2680 /* Display prettily. */
2681 t = object_desc_str(t, " (");
2682 t = object_desc_num(t, power);
2684 t = object_desc_str(t, "ËÜ ½¼Å¶Ãæ)");
2686 t = object_desc_str(t, " charging)");
2690 /* "one Rod of Perception (1 charging)" would look tacky. */
2694 t = object_desc_str(t, "(½¼Å¶Ãæ)");
2696 t = object_desc_str(t, " (charging)");
2702 /* Dump "pval" flags for wearable items */
2703 if (have_pval_flags(flgs))
2705 /* Start the display */
2706 t = object_desc_chr(t, ' ');
2707 t = object_desc_chr(t, p1);
2709 /* Dump the "pval" itself */
2710 t = object_desc_int(t, o_ptr->pval);
2712 /* Do not display the "pval" flags */
2713 if (have_flag(flgs, TR_HIDE_TYPE))
2719 else if (have_flag(flgs, TR_SPEED))
2721 /* Dump " to speed" */
2723 t = object_desc_str(t, "²Ã®");
2725 t = object_desc_str(t, " to speed");
2730 else if (have_flag(flgs, TR_BLOWS))
2734 t = object_desc_str(t, "¹¶·â");
2736 t = object_desc_str(t, " attack");
2739 if (ABS(o_ptr->pval) != 1) t = object_desc_chr(t, 's');
2744 else if (have_flag(flgs, TR_STEALTH))
2746 /* Dump " to stealth" */
2748 t = object_desc_str(t, "±£Ì©");
2750 t = object_desc_str(t, " to stealth");
2755 else if (have_flag(flgs, TR_SEARCH))
2757 /* Dump " to searching" */
2759 t = object_desc_str(t, "õº÷");
2761 t = object_desc_str(t, " to searching");
2766 else if (have_flag(flgs, TR_INFRA))
2768 /* Dump " to infravision" */
2770 t = object_desc_str(t, "ÀÖ³°Àþ»ëÎÏ");
2772 t = object_desc_str(t, " to infravision");
2776 /* Finish the display */
2777 t = object_desc_chr(t, p2);
2780 /* Hack -- Process Lanterns/Torches */
2781 if ((o_ptr->tval == TV_LITE) && (!(object_is_fixed_artifact(o_ptr) || (o_ptr->sval == SV_LITE_FEANOR))))
2783 /* Hack -- Turns of light for normal lites */
2785 t = object_desc_chr(t, '(');
2787 t = object_desc_str(t, " (with ");
2790 if (o_ptr->name2 == EGO_LITE_LONG) t = object_desc_num(t, o_ptr->xtra4 * 2);
2791 else t = object_desc_num(t, o_ptr->xtra4);
2793 t = object_desc_str(t, "¥¿¡¼¥ó¤Î¼÷Ì¿)");
2795 t = object_desc_str(t, " turns of light)");
2799 /* Indicate charging objects, but not rods. */
2800 if (o_ptr->timeout && (o_ptr->tval != TV_ROD))
2802 /* Hack -- Dump " (charging)" if relevant */
2804 t = object_desc_str(t, "(½¼Å¶Ãæ)");
2806 t = object_desc_str(t, " (charging)");
2812 /* No more details wanted */
2813 if (mode & OD_OMIT_INSCRIPTION) goto object_desc_done;
2816 /* Prepare real inscriptions in a buffer */
2819 /* Auto abbreviation inscribe */
2820 if ((abbrev_extra || abbrev_all) && (o_ptr->ident & IDENT_MENTAL))
2822 if (!o_ptr->inscription || !my_strchr(quark_str(o_ptr->inscription), '%'))
2833 get_ability_abbreviation(tmp_val2, o_ptr, kanji, all);
2837 /* Use the standard inscription if available */
2838 if (o_ptr->inscription)
2842 if (tmp_val2[0]) strcat(tmp_val2, ", ");
2844 /* Get inscription and convert {%} */
2845 get_inscription(buff, o_ptr);
2847 /* strcat with correct treating of kanji */
2848 my_strcat(tmp_val2, buff, sizeof(tmp_val2));
2852 /* No fake inscription yet */
2853 fake_insc_buf[0] = '\0';
2855 /* Use the game-generated "feeling" otherwise, if available */
2858 strcpy(fake_insc_buf, game_inscriptions[o_ptr->feeling]);
2861 /* Note "cursed" if the item is known to be cursed */
2862 else if (object_is_cursed(o_ptr) && (known || (o_ptr->ident & IDENT_SENSE)))
2865 strcpy(fake_insc_buf, "¼ö¤ï¤ì¤Æ¤¤¤ë");
2867 strcpy(fake_insc_buf, "cursed");
2871 /* Note "unidentified" if the item is unidentified */
2872 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)
2873 || (o_ptr->tval == TV_LITE) || (o_ptr->tval == TV_FIGURINE))
2875 && !(o_ptr->ident & IDENT_SENSE))
2878 strcpy(fake_insc_buf, "̤´ÕÄê");
2880 strcpy(fake_insc_buf, "unidentified");
2884 /* Mega-Hack -- note empty wands/staffs */
2885 else if (!known && (o_ptr->ident & IDENT_EMPTY))
2888 strcpy(fake_insc_buf, "¶õ");
2890 strcpy(fake_insc_buf, "empty");
2894 /* Note "tried" if the object has been tested unsuccessfully */
2895 else if (!aware && object_is_tried(o_ptr))
2898 strcpy(fake_insc_buf, "̤ȽÌÀ");
2900 strcpy(fake_insc_buf, "tried");
2904 /* Note the discount, if any */
2905 if (o_ptr->discount)
2907 /* Hidden by real inscription unless in a store */
2908 if (!tmp_val2[0] || (o_ptr->ident & IDENT_STORE))
2910 char discount_num_buf[4];
2912 /* Append to other fake inscriptions if any */
2913 if (fake_insc_buf[0]) strcat(fake_insc_buf, ", ");
2915 (void)object_desc_num(discount_num_buf, o_ptr->discount);
2916 strcat(fake_insc_buf, discount_num_buf);
2918 strcat(fake_insc_buf, "%°ú¤");
2920 strcat(fake_insc_buf, "% off");
2926 /* Append the inscription, if any */
2927 if (fake_insc_buf[0] || tmp_val2[0])
2929 /* Append the inscription */
2930 t = object_desc_chr(t, ' ');
2931 t = object_desc_chr(t, c1);
2933 /* Append fake inscriptions */
2934 if (fake_insc_buf[0])
2936 t = object_desc_str(t, fake_insc_buf);
2939 /* Append a separater */
2940 if (fake_insc_buf[0] && tmp_val2[0])
2942 t = object_desc_chr(t, ',');
2943 t = object_desc_chr(t, ' ');
2946 /* Append real inscriptions */
2949 t = object_desc_str(t, tmp_val2);
2952 t = object_desc_chr(t, c2);
2956 my_strcpy(buf, tmp_val, MAX_NLEN);