3 /* Purpose: Interface commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 * mark strings for auto dump
19 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
20 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
23 * Remove old lines automatically generated before.
25 static void remove_auto_dump(cptr orig_file, cptr mark)
27 FILE *tmp_fff, *orig_fff;
31 bool between_mark = FALSE;
34 long header_location = 0;
35 char header_mark_str[80];
36 char footer_mark_str[80];
39 sprintf(header_mark_str, auto_dump_header, mark);
40 sprintf(footer_mark_str, auto_dump_footer, mark);
42 mark_len = strlen(footer_mark_str);
44 /* If original file is not exist, nothing to do */
45 orig_fff = my_fopen(orig_file, "r");
52 tmp_fff = my_fopen_temp(tmp_file, 1024);
55 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
57 msg_format("Failed to create temporary file %s.", tmp_file);
65 if (my_fgets(orig_fff, buf, sizeof(buf)))
69 fseek(orig_fff, header_location, SEEK_SET);
81 if (!strcmp(buf, header_mark_str))
83 header_location = ftell(orig_fff);
90 fprintf(tmp_fff, "%s\n", buf);
95 if (!strncmp(buf, footer_mark_str, mark_len))
99 if (!sscanf(buf + mark_len, " (%d)", &tmp)
102 fseek(orig_fff, header_location, SEEK_SET);
105 between_mark = FALSE;
118 /* copy contents of temporally file */
120 tmp_fff = my_fopen(tmp_file, "r");
121 orig_fff = my_fopen(orig_file, "w");
123 while (!my_fgets(tmp_fff, buf, sizeof(buf)))
124 fprintf(orig_fff, "%s\n", buf);
135 * Open file to append auto dump.
137 static FILE *open_auto_dump(cptr buf, cptr mark, int *line)
141 char header_mark_str[80];
146 sprintf(header_mark_str, auto_dump_header, mark);
148 /* Remove old macro dumps */
149 remove_auto_dump(buf, mark);
151 /* Append to the file */
152 fff = my_fopen(buf, "a");
157 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
159 msg_format("Failed to open %s.", buf);
170 fprintf(fff, "%s\n", header_mark_str);
173 fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
174 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
176 fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
177 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
185 * Append foot part and close auto dump.
187 static void close_auto_dump(FILE *fff, cptr mark, int line_num)
189 char footer_mark_str[80];
191 sprintf(footer_mark_str, auto_dump_footer, mark);
195 fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
196 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
198 fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
199 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
203 fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
215 * Take note to the dialy.
218 errr do_cmd_write_nikki(int type, int num, cptr note)
224 cptr note_level = "";
225 bool do_level = TRUE;
227 static bool disable_nikki = FALSE;
229 extract_day_hour_min(&day, &hour, &min);
231 if (disable_nikki) return(-1);
233 if (type == NIKKI_FIX_QUEST_C ||
234 type == NIKKI_FIX_QUEST_F ||
235 type == NIKKI_RAND_QUEST_C ||
236 type == NIKKI_RAND_QUEST_F ||
237 type == NIKKI_TO_QUEST)
241 old_quest = p_ptr->inside_quest;
242 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
244 /* Get the quest text */
245 init_flags = INIT_ASSIGN;
247 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
249 /* Reset the old quest number */
250 p_ptr->inside_quest = old_quest;
254 sprintf(file_name,"playrecord-%s.txt",savefile_base);
256 /* different filne name to avoid mixing */
257 sprintf(file_name,"playrec-%s.txt",savefile_base);
260 /* Hack -- drop permissions */
263 /* Build the filename */
264 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
266 /* File type is "TEXT" */
267 FILE_TYPE(FILE_TYPE_TEXT);
269 fff = my_fopen(buf, "a");
274 /* Hack -- grab permissions */
277 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
279 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
288 if (p_ptr->inside_arena)
290 note_level = "¥¢¥ê¡¼¥Ê:";
292 note_level = "Arane:";
296 note_level = "ÃϾå:";
298 note_level = "Surface:";
300 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
302 note_level = "¥¯¥¨¥¹¥È:";
304 note_level = "Quest:";
308 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
310 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
319 fprintf(fff, "%dÆüÌÜ\n",day);
321 fprintf(fff, "Day %d\n",day);
330 fprintf(fff, "%s\n",note);
334 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
340 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
342 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
349 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
351 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
355 case NIKKI_FIX_QUEST_C:
357 if (quest[num].flags & QUEST_FLAG_SILENT) break;
359 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
361 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
365 case NIKKI_FIX_QUEST_F:
367 if (quest[num].flags & QUEST_FLAG_SILENT) break;
369 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
371 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
375 case NIKKI_RAND_QUEST_C:
378 strcpy(name, r_name+r_info[quest[num].r_idx].name);
380 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
382 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
386 case NIKKI_RAND_QUEST_F:
389 strcpy(name, r_name+r_info[quest[num].r_idx].name);
391 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
393 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
397 case NIKKI_MAXDEAPTH:
400 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
402 fprintf(fff, " %2d:%02d %20s reached level %d of %s for the first time.\n", hour, min, note_level, num, d_name+d_info[dungeon_type].name);
409 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
411 fprintf(fff, " %2d:%02d %20s reset recall level of %s to %d %s.\n", hour, min, note_level, d_name + d_info[num].name, max_dlv[num], note);
418 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
429 if (!(dun_level+num)) to = "ÃϾå";
430 else to = format("%d³¬", dun_level+num);
432 if (!(dun_level+num)) to = "the surfice";
433 else to = format("level %d", dun_level+num);
438 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
440 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
448 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
450 fprintf(fff, " %2d:%02d %20s recall to dungeon level %d of %s.\n", hour, min, note_level, max_dlv[dungeon_type], d_name+d_info[dungeon_type].name);
454 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
456 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
462 if (quest[num].flags & QUEST_FLAG_SILENT) break;
464 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
466 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
473 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¡¦¥Æ¥ì¥Ý¡¼¥È¤Çæ½Ð¤·¤¿¡£\n", hour, min, note_level);
475 fprintf(fff, " %2d:%02d %20s Get out using teleport level.\n", hour, min, note_level);
482 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
484 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
491 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
493 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
503 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, p_ptr->arena_number + 1, note);
505 int n = p_ptr->arena_number + 1;
506 fprintf(fff, " %2d:%02d %20s beaten by %s in the %d%s fight.\n", hour, min, note_level, note, n, (n%10==1?"st":n%10==2?"nd":n%10==3?"rd":"th"));
511 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
513 fprintf(fff, " %2d:%02d %20s win the %d%s fight (%s).\n", hour, min, note_level, num, (num%10==1?"st":num%10==2?"nd":num%10==3?"rd":"th"), note);
515 if (num == MAX_ARENA_MONS)
518 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
520 fprintf(fff, " win all fight to become a Chanpion.\n");
529 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
531 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
546 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
548 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
552 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
554 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
569 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
571 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
575 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Ñ¥¿¡¼¥ó¤ÎÎϤǰÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
577 fprintf(fff, " %2d:%02d %20s use Pattern to teleport to %s.\n", hour, min, note_level, to);
584 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
586 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
590 case NIKKI_GAMESTART:
592 time_t ct = time((time_t*)0);
596 fprintf(fff, "%s %s",note, ctime(&ct));
599 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
602 case NIKKI_NAMED_PET:
604 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
609 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
611 fprintf(fff, "decide to travel together with %s.\n", note);
616 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
618 fprintf(fff, "unname %s.\n", note);
623 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
625 fprintf(fff, "dismiss %s.\n", note);
630 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
632 fprintf(fff, "%s die.\n", note);
637 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
639 fprintf(fff, "move to other map leaving %s behind.\n", note);
644 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
646 fprintf(fff, "lose sight of %s.\n", note);
651 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
653 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
658 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
660 fprintf(fff, "%s is crushed by falling rocks.\n", note);
675 /* Hack -- grab permissions */
678 if (do_level) write_level = FALSE;
684 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
686 static void do_cmd_disp_nikki(void)
688 char nikki_title[256];
693 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
694 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
705 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
706 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
707 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
708 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
713 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
722 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
724 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
725 "Attack is the best form of defence.",
727 "An unexpected windfall",
728 "A drowning man will catch at a straw",
729 "Don't count your chickens before they are hatched.",
730 "It is no use crying over spilt milk.",
731 "Seeing is believing.",
732 "Strike the iron while it is hot.",
733 "I don't care what follows.",
734 "To dig a well to put out a house on fire.",
735 "Tomorrow is another day.",
736 "Easy come, easy go.",
737 "The more haste, the less speed.",
738 "Where there is life, there is hope.",
739 "There is no royal road to *WINNER*.",
740 "Danger past, God forgotten.",
741 "The best thing to do now is to run away.",
742 "Life is but an empty dream.",
743 "Dead men tell no tales.",
744 "A book that remains shut is but a block.",
745 "Misfortunes never come singly.",
746 "A little knowledge is a dangerous thing.",
747 "History repeats itself.",
748 "*WINNER* was not built in a day.",
749 "Ignorance is bliss.",
750 "To lose is to win?",
751 "No medicine can cure folly.",
752 "All good things come to an end.",
753 "M$ Empire strikes back.",
754 "To see is to believe",
756 "Quest of The World's Greatest Brain"};
759 sprintf(file_name,"playrecord-%s.txt",savefile_base);
761 sprintf(file_name,"playrec-%s.txt",savefile_base);
764 /* Hack -- drop permissions */
767 /* Build the filename */
768 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
770 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
771 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
772 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
773 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
774 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
777 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
778 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
780 sprintf(nikki_title, "Legend of %s %s '%s'",
781 ap_ptr->title, player_name, tmp);
784 /* Display the file contents */
785 show_file(FALSE, buf, nikki_title, -1, 0);
787 /* Hack -- grab permissions */
791 static void do_cmd_bunshou(void)
794 char bunshou[80] = "\0";
797 if (get_string("ÆâÍÆ: ", tmp, 79))
799 if (get_string("diary note: ", tmp, 79))
802 strcpy(bunshou, tmp);
804 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
808 static void do_cmd_last_get(void)
813 if (record_o_name[0] == '\0') return;
816 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
818 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
820 if (!get_check(buf)) return;
825 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
827 sprintf(buf,"descover %s.", record_o_name);
829 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
833 static void do_cmd_erase_nikki(void)
840 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
842 if (!get_check("Do you really want to delete all your record? ")) return;
846 sprintf(file_name,"playrecord-%s.txt",savefile_base);
848 sprintf(file_name,"playrec-%s.txt",savefile_base);
851 /* Hack -- drop permissions */
854 /* Build the filename */
855 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
857 /* Remove the file */
860 fff = my_fopen(buf, "w");
864 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
866 msg_format("deleted record.");
870 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
872 msg_format("failed to delete %s.", buf);
877 /* Hack -- grab permissions */
884 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
890 void do_cmd_nikki(void)
894 /* File type is "TEXT" */
895 FILE_TYPE(FILE_TYPE_TEXT);
897 /* Save the screen */
900 /* Interact until done */
906 /* Ask for a choice */
908 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
910 prt("[ Play Record ]", 2, 0);
914 /* Give some choices */
916 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
917 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
918 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
919 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
921 prt("(1) Display your record", 4, 5);
922 prt("(2) Add record", 5, 5);
923 prt("(3) Record item you last get/identify", 6, 5);
924 prt("(4) Delete your record", 7, 5);
930 prt("¥³¥Þ¥ó¥É:", 18, 0);
932 prt("Command: ", 18, 0);
940 if (i == ESCAPE) break;
954 do_cmd_erase_nikki();
961 default: /* Unknown option */
969 /* Restore the screen */
974 * Hack -- redraw the screen
976 * This command performs various low level updates, clears all the "extra"
977 * windows, does a total redraw of the main window, and requests all of the
978 * interesting updates and redraws that I can think of.
980 * This command is also used to "instantiate" the results of the user
981 * selecting various things, such as graphics mode, so it must call
982 * the "TERM_XTRA_REACT" hook before redrawing the windows.
984 void do_cmd_redraw(void)
991 /* Hack -- react to changes */
992 Term_xtra(TERM_XTRA_REACT, 0);
995 /* Combine and Reorder the pack (later) */
996 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1000 p_ptr->update |= (PU_TORCH);
1003 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1005 /* Forget lite/view */
1006 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1008 /* Update lite/view */
1009 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1011 /* Update monsters */
1012 p_ptr->update |= (PU_MONSTERS);
1014 /* Redraw everything */
1015 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1018 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1021 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1025 /* Hack -- update */
1028 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1031 /* Redraw every window */
1032 for (j = 0; j < 8; j++)
1035 if (!angband_term[j]) continue;
1038 Term_activate(angband_term[j]);
1053 * Hack -- change name
1055 void do_cmd_change_name(void)
1064 /* Save the screen */
1072 /* Display the player */
1073 display_player(mode);
1078 display_player(mode);
1083 Term_putstr(2, 23, -1, TERM_WHITE,
1084 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1086 Term_putstr(2, 23, -1, TERM_WHITE,
1087 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1095 if (c == ESCAPE) break;
1102 /* Process the player name */
1103 process_player_name(FALSE);
1109 sprintf(tmp, "%s.txt", player_base);
1111 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1113 if (get_string("File name: ", tmp, 80))
1117 if (tmp[0] && (tmp[0] != ' '))
1119 file_character(tmp, TRUE);
1136 /* Flush messages */
1140 /* Restore the screen */
1143 /* Redraw everything */
1144 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1151 * Recall the most recent message
1153 void do_cmd_message_one(void)
1155 /* Recall one message XXX XXX XXX */
1156 prt(format("> %s", message_str(0)), 0, 0);
1161 * Show previous messages to the user -BEN-
1163 * The screen format uses line 0 and 23 for headers and prompts,
1164 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1166 * This command shows you which commands you are viewing, and allows
1167 * you to "search" for strings in the recall.
1169 * Note that messages may be longer than 80 characters, but they are
1170 * displayed using "infinite" length, with a special sub-command to
1171 * "slide" the virtual display to the left or right.
1173 * Attempt to only hilite the matching portions of the string.
1175 void do_cmd_messages(int num_now)
1186 Term_get_size(&wid, &hgt);
1195 /* Total messages */
1198 /* Start on first message */
1201 /* Start at leftmost edge */
1204 /* Save the screen */
1207 /* Process requests until done */
1213 /* Dump up to 20 lines of messages */
1214 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1216 cptr msg = message_str(i+j);
1218 /* Apply horizontal scroll */
1219 msg = (strlen(msg) >= q) ? (msg + q) : "";
1221 /* Dump the messages, bottom to top */
1222 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1224 /* Hilite "shower" */
1229 /* Display matches */
1230 while ((str = strstr(str, shower)) != NULL)
1232 int len = strlen(shower);
1234 /* Display the match */
1235 Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
1243 /* Display header XXX XXX XXX */
1246 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1247 i, i+j-1, n, q), 0, 0);
1249 prt(format("Message Recall (%d-%d of %d), Offset %d",
1250 i, i+j-1, n, q), 0, 0);
1254 /* Display prompt (not very informative) */
1256 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1258 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1265 /* Exit on Escape */
1266 if (k == ESCAPE) break;
1268 /* Hack -- Save the old index */
1271 /* Horizontal scroll */
1275 q = (q >= 40) ? (q - 40) : 0;
1281 /* Horizontal scroll */
1291 /* Hack -- handle show */
1296 prt("¶¯Ä´: ", hgt - 1, 0);
1298 prt("Show: ", hgt - 1, 0);
1302 /* Get a "shower" string, or continue */
1303 if (!askfor_aux(shower, 80)) continue;
1309 /* Hack -- handle find */
1316 prt("¸¡º÷: ", hgt - 1, 0);
1318 prt("Find: ", hgt - 1, 0);
1322 /* Get a "finder" string, or continue */
1323 if (!askfor_aux(finder, 80)) continue;
1326 strcpy(shower, finder);
1329 for (z = i + 1; z < n; z++)
1331 cptr msg = message_str(z);
1334 if (strstr(msg, finder))
1345 /* Recall 1 older message */
1346 if ((k == '8') || (k == '\n') || (k == '\r'))
1348 /* Go newer if legal */
1349 if (i + 1 < n) i += 1;
1352 /* Recall 10 older messages */
1355 /* Go older if legal */
1356 if (i + 10 < n) i += 10;
1359 /* Recall 20 older messages */
1360 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1362 /* Go older if legal */
1363 if (i + 20 < n) i += 20;
1366 /* Recall 20 newer messages */
1367 if ((k == 'n') || (k == KTRL('N')))
1369 /* Go newer (if able) */
1370 i = (i >= 20) ? (i - 20) : 0;
1373 /* Recall 10 newer messages */
1376 /* Go newer (if able) */
1377 i = (i >= 20) ? (i - 20) : 0;
1380 /* Recall 1 newer messages */
1383 /* Go newer (if able) */
1384 i = (i >= 1) ? (i - 1) : 0;
1387 /* Hack -- Error of some kind */
1391 /* Restore the screen */
1398 * Number of cheating options
1405 static option_type cheat_info[CHEAT_MAX] =
1407 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1409 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1411 "cheat_peek", "Peek into object creation"
1415 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1417 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1419 "cheat_hear", "Peek into monster creation"
1423 { &cheat_room, FALSE, 255, 0x04, 0x00,
1425 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1427 "cheat_room", "Peek into dungeon creation"
1431 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1433 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë"
1435 "cheat_xtra", "Peek into something else"
1439 { &cheat_know, FALSE, 255, 0x10, 0x00,
1441 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë"
1443 "cheat_know", "Know complete monster info"
1447 { &cheat_live, FALSE, 255, 0x20, 0x00,
1449 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë"
1451 "cheat_live", "Allow player to avoid death"
1455 { &cheat_save, FALSE, 255, 0x40, 0x00,
1457 "cheat_save", "»à¤ó¤À»þ¥»¡¼¥Ö¤¹¤ë¤«³Îǧ¤¹¤ë"
1459 "cheat_save", "Ask for saving death"
1465 * Interact with some options for cheating
1467 static void do_cmd_options_cheat(cptr info)
1471 int i, k = 0, n = CHEAT_MAX;
1479 /* Interact with the player */
1484 /* Prompt XXX XXX XXX */
1486 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1488 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1494 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1495 prt(" << Ãí°Õ >>", 11, 0);
1496 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1497 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1498 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1500 /* Display the options */
1501 for (i = 0; i < n; i++)
1503 byte a = TERM_WHITE;
1505 /* Color current option */
1506 if (i == k) a = TERM_L_BLUE;
1508 /* Display the option text */
1509 sprintf(buf, "%-48s: %s (%s)",
1510 cheat_info[i].o_desc,
1512 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1514 (*cheat_info[i].o_var ? "yes" : "no "),
1517 cheat_info[i].o_text);
1518 c_prt(a, buf, i + 2, 0);
1521 /* Hilite current option */
1522 move_cursor(k + 2, 50);
1528 * HACK - Try to translate the key into a direction
1529 * to allow using the roguelike keys for navigation.
1531 dir = get_keymap_dir(ch);
1532 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1546 k = (n + k - 1) % n;
1565 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1567 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1569 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1570 (*cheat_info[k].o_var) = TRUE;
1579 (*cheat_info[k].o_var) = FALSE;
1587 strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text);
1589 strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text);
1591 /* Peruse the help file */
1592 (void)show_file(TRUE, buf, NULL, 0, 0);
1608 static option_type autosave_info[2] =
1610 { &autosave_l, FALSE, 255, 0x01, 0x00,
1612 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1614 "autosave_l", "Autosave when entering new levels" },
1618 { &autosave_t, FALSE, 255, 0x02, 0x00,
1620 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1622 "autosave_t", "Timed autosave" },
1628 static s16b toggle_frequency(s16b current)
1630 if (current == 0) return 50;
1631 if (current == 50) return 100;
1632 if (current == 100) return 250;
1633 if (current == 250) return 500;
1634 if (current == 500) return 1000;
1635 if (current == 1000) return 2500;
1636 if (current == 2500) return 5000;
1637 if (current == 5000) return 10000;
1638 if (current == 10000) return 25000;
1645 * Interact with some options for cheating
1647 static void do_cmd_options_autosave(cptr info)
1651 int i, k = 0, n = 2;
1659 /* Interact with the player */
1662 /* Prompt XXX XXX XXX */
1664 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1666 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1671 /* Display the options */
1672 for (i = 0; i < n; i++)
1674 byte a = TERM_WHITE;
1676 /* Color current option */
1677 if (i == k) a = TERM_L_BLUE;
1679 /* Display the option text */
1680 sprintf(buf, "%-48s: %s (%s)",
1681 autosave_info[i].o_desc,
1683 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1685 (*autosave_info[i].o_var ? "yes" : "no "),
1688 autosave_info[i].o_text);
1689 c_prt(a, buf, i + 2, 0);
1693 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1695 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1700 /* Hilite current option */
1701 move_cursor(k + 2, 50);
1717 k = (n + k - 1) % n;
1735 (*autosave_info[k].o_var) = TRUE;
1744 (*autosave_info[k].o_var) = FALSE;
1752 autosave_freq = toggle_frequency(autosave_freq);
1754 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1755 autosave_freq), 5, 0);
1757 prt(format("Timed autosave frequency: every %d turns",
1758 autosave_freq), 5, 0);
1766 (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0);
1768 (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0);
1786 #define PAGE_AUTODESTROY 7
1789 * Interact with some options
1791 void do_cmd_options_aux(int page, cptr info)
1794 int i, k = 0, n = 0, l;
1799 /* Lookup the options */
1800 for (i = 0; i < 24; i++) opt[i] = 0;
1802 /* Scan the options */
1803 for (i = 0; option_info[i].o_desc; i++)
1805 /* Notice options on this "page" */
1806 if (option_info[i].o_page == page) opt[n++] = i;
1813 /* Interact with the player */
1818 /* Prompt XXX XXX XXX */
1820 sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, y/n:Êѹ¹, ESC:½ªÎ», ?:¥Ø¥ë¥×) ", info);
1822 sprintf(buf, "%s (RET:next, y/n:change, ESC:accept, ?:help) ", info);
1828 /* HACK -- description for easy-auto-destroy options */
1830 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
1832 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
1835 /* Display the options */
1836 for (i = 0; i < n; i++)
1838 byte a = TERM_WHITE;
1840 /* Color current option */
1841 if (i == k) a = TERM_L_BLUE;
1843 /* Display the option text */
1844 sprintf(buf, "%-48s: %s (%.19s)",
1845 option_info[opt[i]].o_desc,
1847 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1849 (*option_info[opt[i]].o_var ? "yes" : "no "),
1852 option_info[opt[i]].o_text);
1853 if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1854 else c_prt(a, buf, i + 2, 0);
1857 if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3;
1860 /* Hilite current option */
1861 move_cursor(k + 2 + l, 50);
1867 * HACK - Try to translate the key into a direction
1868 * to allow using the roguelike keys for navigation.
1870 dir = get_keymap_dir(ch);
1871 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1885 k = (n + k - 1) % n;
1902 (*option_info[opt[k]].o_var) = TRUE;
1911 (*option_info[opt[k]].o_var) = FALSE;
1919 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1926 strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text);
1928 strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text);
1930 /* Peruse the help file */
1931 (void)show_file(TRUE, buf, NULL, 0, 0);
1948 * Modify the "window" options
1950 static void do_cmd_options_win(void)
1964 /* Memorize old flags */
1965 for (j = 0; j < 8; j++)
1967 /* Acquire current flags */
1968 old_flag[j] = window_flag[j];
1978 /* Prompt XXX XXX XXX */
1980 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1982 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1986 /* Display the windows */
1987 for (j = 0; j < 8; j++)
1989 byte a = TERM_WHITE;
1991 cptr s = angband_term_name[j];
1994 if (j == x) a = TERM_L_BLUE;
1996 /* Window name, staggered, centered */
1997 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
2000 /* Display the options */
2001 for (i = 0; i < 16; i++)
2003 byte a = TERM_WHITE;
2005 cptr str = window_flag_desc[i];
2008 if (i == y) a = TERM_L_BLUE;
2012 if (!str) str = "(̤»ÈÍÑ)";
2014 if (!str) str = "(Unused option)";
2019 Term_putstr(0, i + 5, -1, a, str);
2021 /* Display the windows */
2022 for (j = 0; j < 8; j++)
2024 byte a = TERM_WHITE;
2029 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2032 if (window_flag[j] & (1L << i)) c = 'X';
2035 Term_putch(35 + j * 5, i + 5, a, c);
2040 Term_gotoxy(35 + x * 5, y + 5);
2058 for (j = 0; j < 8; j++)
2060 window_flag[j] &= ~(1L << y);
2064 for (i = 0; i < 16; i++)
2066 window_flag[x] &= ~(1L << i);
2079 window_flag[x] |= (1L << y);
2087 window_flag[x] &= ~(1L << y);
2094 (void)show_file(TRUE, "joption.txt#Window", NULL, 0, 0);
2096 (void)show_file(TRUE, "option.txt#Window", NULL, 0, 0);
2106 d = get_keymap_dir(ch);
2108 x = (x + ddx[d] + 8) % 8;
2109 y = (y + ddy[d] + 16) % 16;
2116 /* Notice changes */
2117 for (j = 0; j < 8; j++)
2122 if (!angband_term[j]) continue;
2124 /* Ignore non-changes */
2125 if (window_flag[j] == old_flag[j]) continue;
2128 Term_activate(angband_term[j]);
2145 * Set or unset various options.
2147 * The user must use the "Ctrl-R" command to "adapt" to changes
2148 * in any options which control "visual" aspects of the game.
2150 void do_cmd_options(void)
2155 /* Save the screen */
2164 /* Why are we here */
2166 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2168 prt("Options", 2, 0);
2172 /* Give some choices */
2174 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2175 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2176 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2177 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2178 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2179 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2180 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2181 /* Special choices */
2182 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2183 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2184 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2186 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2188 prt("(1) Input Options", 4, 5);
2189 prt("(2) Output Options", 5, 5);
2190 prt("(3) Game-Play Options", 6, 5);
2191 prt("(4) Disturbance Options", 7, 5);
2192 prt("(5) Efficiency Options", 8, 5);
2193 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2194 prt("(R) Play-record Options", 10, 5);
2196 /* Special choices */
2197 prt("(D) Base Delay Factor", 12, 5);
2198 prt("(H) Hitpoint Warning", 13, 5);
2199 prt("(A) Autosave Options", 14, 5);
2203 prt("(W) Window Flags", 15, 5);
2206 if (p_ptr->noscore || allow_debug_opts)
2210 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2212 prt("(C) Cheating Options", 16, 5);
2219 prt("¥³¥Þ¥ó¥É:", 18, 0);
2221 prt("Command: ", 18, 0);
2229 if (k == ESCAPE) break;
2234 /* General Options */
2237 /* Process the general options */
2239 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2241 do_cmd_options_aux(1, "Input Options");
2247 /* General Options */
2250 /* Process the general options */
2252 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2254 do_cmd_options_aux(2, "Output Options");
2260 /* Inventory Options */
2265 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2267 do_cmd_options_aux(3, "Game-Play Options");
2273 /* Disturbance Options */
2278 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2280 do_cmd_options_aux(4, "Disturbance Options");
2286 /* Efficiency Options */
2291 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2293 do_cmd_options_aux(5, "Efficiency Options");
2299 /* Object auto-destruction Options */
2304 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2306 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2311 /* Play-record Options */
2317 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2319 do_cmd_options_aux(10, "Play-record Option");
2324 /* Cheating Options */
2327 if (!p_ptr->noscore && !allow_debug_opts)
2329 /* Cheat options are not permitted */
2336 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2338 do_cmd_options_cheat("Cheaters never win");
2348 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2350 do_cmd_options_autosave("Autosave");
2361 do_cmd_options_win();
2362 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2363 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2364 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2365 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2369 /* Hack -- Delay Speed */
2375 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2377 prt("Command: Base Delay Factor", 18, 0);
2381 /* Get a new value */
2384 int msec = delay_factor * delay_factor * delay_factor;
2386 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2387 delay_factor, msec), 22, 0);
2389 prt(format("Current base delay factor: %d (%d msec)",
2390 delay_factor, msec), 22, 0);
2394 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2396 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2400 if (k == ESCAPE) break;
2404 (void)show_file(TRUE, "joption.txt#BaseDelay", NULL, 0, 0);
2406 (void)show_file(TRUE, "option.txt#BaseDelay", NULL, 0, 0);
2410 else if (isdigit(k)) delay_factor = D2I(k);
2417 /* Hack -- hitpoint warning factor */
2423 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2425 prt("Command: Hitpoint Warning", 18, 0);
2429 /* Get a new value */
2433 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2434 hitpoint_warn), 22, 0);
2436 prt(format("Current hitpoint warning: %d0%%",
2437 hitpoint_warn), 22, 0);
2441 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2443 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2447 if (k == ESCAPE) break;
2451 (void)show_file(TRUE, "joption.txt#Hitpoint", NULL, 0, 0);
2453 (void)show_file(TRUE, "option.txt#Hitpoint", NULL, 0, 0);
2457 else if (isdigit(k)) hitpoint_warn = D2I(k);
2466 (void)show_file(TRUE, "joption.txt", NULL, 0, 0);
2468 (void)show_file(TRUE, "option.txt", NULL, 0, 0);
2473 /* Unknown option */
2482 /* Flush messages */
2487 /* Restore the screen */
2490 /* Hack - Redraw equippy chars */
2491 p_ptr->redraw |= (PR_EQUIPPY);
2497 * Ask for a "user pref line" and process it
2499 * XXX XXX XXX Allow absolute file names?
2501 void do_cmd_pref(void)
2508 /* Ask for a "user pref command" */
2510 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2512 if (!get_string("Pref: ", buf, 80)) return;
2516 /* Process that pref command */
2517 (void)process_pref_file_command(buf);
2520 void do_cmd_pickpref(void)
2526 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2528 if(!get_check("Reload auto-pick preference file? ")) return;
2531 /* Free old entries */
2534 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2536 sprintf(buf, "picktype-%s.prf", player_name);
2538 sprintf(buf, "pickpref-%s.prf", player_name);
2540 err = process_pickpref_file(buf);
2545 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2547 msg_format("loaded '%s'.", buf);
2551 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2553 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2557 err = process_pickpref_file("picktype.prf");
2559 err = process_pickpref_file("pickpref.prf");
2565 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2567 msg_print("loaded 'pickpref.prf'.");
2574 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2576 if(err) msg_print("Failed to reload autopick preference.");
2583 * Hack -- append all current macros to the given file
2585 static errr macro_dump(cptr fname)
2587 static cptr mark = "Macro Dump";
2595 /* Build the filename */
2596 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2598 /* File type is "TEXT" */
2599 FILE_TYPE(FILE_TYPE_TEXT);
2601 /* Append to the file */
2602 fff = open_auto_dump(buf, mark, &line_num);
2603 if (!fff) return (-1);
2607 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2609 fprintf(fff, "\n# Automatic macro dump\n\n");
2614 for (i = 0; i < macro__num; i++)
2616 /* Extract the action */
2617 ascii_to_text(buf, macro__act[i]);
2619 /* Dump the macro */
2620 fprintf(fff, "A:%s\n", buf);
2622 /* Extract the action */
2623 ascii_to_text(buf, macro__pat[i]);
2625 /* Dump normal macros */
2626 fprintf(fff, "P:%s\n", buf);
2631 /* count number of lines */
2636 close_auto_dump(fff, mark, line_num);
2644 * Hack -- ask for a "trigger" (see below)
2646 * Note the complex use of the "inkey()" function from "util.c".
2648 * Note that both "flush()" calls are extremely important.
2650 static void do_cmd_macro_aux(char *buf)
2660 /* Do not process macros */
2666 /* Read the pattern */
2672 /* Do not process macros */
2675 /* Do not wait for keys */
2678 /* Attempt to read a key */
2689 /* Convert the trigger */
2690 ascii_to_text(tmp, buf);
2692 /* Hack -- display the trigger */
2693 Term_addstr(-1, TERM_WHITE, tmp);
2700 * Hack -- ask for a keymap "trigger" (see below)
2702 * Note that both "flush()" calls are extremely important. This may
2703 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2705 static void do_cmd_macro_aux_keymap(char *buf)
2719 /* Convert to ascii */
2720 ascii_to_text(tmp, buf);
2722 /* Hack -- display the trigger */
2723 Term_addstr(-1, TERM_WHITE, tmp);
2732 * Hack -- append all keymaps to the given file
2734 static errr keymap_dump(cptr fname)
2736 static cptr mark = "Keymap Dump";
2748 if (rogue_like_commands)
2750 mode = KEYMAP_MODE_ROGUE;
2756 mode = KEYMAP_MODE_ORIG;
2760 /* Build the filename */
2761 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2763 /* File type is "TEXT" */
2764 FILE_TYPE(FILE_TYPE_TEXT);
2766 /* Append to the file */
2767 fff = open_auto_dump(buf, mark, &line_num);
2768 if (!fff) return -1;
2772 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2774 fprintf(fff, "\n# Automatic keymap dump\n\n");
2779 for (i = 0; i < 256; i++)
2783 /* Loop up the keymap */
2784 act = keymap_act[mode][i];
2786 /* Skip empty keymaps */
2789 /* Encode the key */
2792 ascii_to_text(key, buf);
2794 /* Encode the action */
2795 ascii_to_text(buf, act);
2797 /* Dump the macro */
2798 fprintf(fff, "A:%s\n", buf);
2799 fprintf(fff, "C:%d:%s\n", mode, key);
2804 close_auto_dump(fff, mark, line_num);
2813 * Interact with "macros"
2815 * Note that the macro "action" must be defined before the trigger.
2817 * Could use some helpful instructions on this page. XXX XXX XXX
2819 void do_cmd_macros(void)
2831 if (rogue_like_commands)
2833 mode = KEYMAP_MODE_ROGUE;
2839 mode = KEYMAP_MODE_ORIG;
2842 /* File type is "TEXT" */
2843 FILE_TYPE(FILE_TYPE_TEXT);
2850 /* Process requests until done */
2858 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2860 prt("Interact with Macros", 2, 0);
2865 /* Describe that action */
2867 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2869 prt("Current action (if any) shown below:", 20, 0);
2873 /* Analyze the current action */
2874 ascii_to_text(buf, macro__buf);
2876 /* Display the current action */
2882 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2884 prt("(1) Load a user pref file", 4, 5);
2889 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2890 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2891 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2892 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2893 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2894 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2895 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2896 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2897 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2899 prt("(2) Append macros to a file", 5, 5);
2900 prt("(3) Query a macro", 6, 5);
2901 prt("(4) Create a macro", 7, 5);
2902 prt("(5) Remove a macro", 8, 5);
2903 prt("(6) Append keymaps to a file", 9, 5);
2904 prt("(7) Query a keymap", 10, 5);
2905 prt("(8) Create a keymap", 11, 5);
2906 prt("(9) Remove a keymap", 12, 5);
2907 prt("(0) Enter a new action", 13, 5);
2910 #endif /* ALLOW_MACROS */
2914 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2916 prt("Command: ", 16, 0);
2924 if (i == ESCAPE) break;
2926 /* Load a 'macro' file */
2933 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2935 prt("Command: Load a user pref file", 16, 0);
2941 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2943 prt("File: ", 18, 0);
2947 /* Default filename */
2948 sprintf(tmp, "%s.prf", player_name);
2950 /* Ask for a file */
2951 if (!askfor_aux(tmp, 80)) continue;
2953 /* Process the given filename */
2954 err = process_pref_file(tmp);
2958 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2960 msg_format("Loaded default '%s'.", tmp);
2967 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2969 msg_format("Failed to load '%s'!");
2975 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2977 msg_format("Loaded '%s'.", tmp);
2989 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2991 prt("Command: Append macros to a file", 16, 0);
2997 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2999 prt("File: ", 18, 0);
3003 /* Default filename */
3004 sprintf(tmp, "%s.prf", player_name);
3006 /* Ask for a file */
3007 if (!askfor_aux(tmp, 80)) continue;
3009 /* Dump the macros */
3010 (void)macro_dump(tmp);
3014 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3016 msg_print("Appended macros.");
3028 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
3030 prt("Command: Query a macro", 16, 0);
3036 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3038 prt("Trigger: ", 18, 0);
3042 /* Get a macro trigger */
3043 do_cmd_macro_aux(buf);
3045 /* Acquire action */
3046 k = macro_find_exact(buf);
3053 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3055 msg_print("Found no macro.");
3063 /* Obtain the action */
3064 strcpy(macro__buf, macro__act[k]);
3066 /* Analyze the current action */
3067 ascii_to_text(buf, macro__buf);
3069 /* Display the current action */
3074 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3076 msg_print("Found a macro.");
3082 /* Create a macro */
3087 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3089 prt("Command: Create a macro", 16, 0);
3095 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3097 prt("Trigger: ", 18, 0);
3101 /* Get a macro trigger */
3102 do_cmd_macro_aux(buf);
3109 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3111 prt("Action: ", 20, 0);
3115 /* Convert to text */
3116 ascii_to_text(tmp, macro__buf);
3118 /* Get an encoded action */
3119 if (askfor_aux(tmp, 80))
3121 /* Convert to ascii */
3122 text_to_ascii(macro__buf, tmp);
3124 /* Link the macro */
3125 macro_add(buf, macro__buf);
3129 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3131 msg_print("Added a macro.");
3137 /* Remove a macro */
3142 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3144 prt("Command: Remove a macro", 16, 0);
3150 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3152 prt("Trigger: ", 18, 0);
3156 /* Get a macro trigger */
3157 do_cmd_macro_aux(buf);
3159 /* Link the macro */
3160 macro_add(buf, buf);
3164 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3166 msg_print("Removed a macro.");
3176 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3178 prt("Command: Append keymaps to a file", 16, 0);
3184 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3186 prt("File: ", 18, 0);
3190 /* Default filename */
3191 sprintf(tmp, "%s.prf", player_name);
3193 /* Ask for a file */
3194 if (!askfor_aux(tmp, 80)) continue;
3196 /* Dump the macros */
3197 (void)keymap_dump(tmp);
3201 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3203 msg_print("Appended keymaps.");
3208 /* Query a keymap */
3215 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3217 prt("Command: Query a keymap", 16, 0);
3223 prt("²¡¤¹¥¡¼: ", 18, 0);
3225 prt("Keypress: ", 18, 0);
3229 /* Get a keymap trigger */
3230 do_cmd_macro_aux_keymap(buf);
3232 /* Look up the keymap */
3233 act = keymap_act[mode][(byte)(buf[0])];
3240 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3242 msg_print("Found no keymap.");
3250 /* Obtain the action */
3251 strcpy(macro__buf, act);
3253 /* Analyze the current action */
3254 ascii_to_text(buf, macro__buf);
3256 /* Display the current action */
3261 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3263 msg_print("Found a keymap.");
3269 /* Create a keymap */
3274 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3276 prt("Command: Create a keymap", 16, 0);
3282 prt("²¡¤¹¥¡¼: ", 18, 0);
3284 prt("Keypress: ", 18, 0);
3288 /* Get a keymap trigger */
3289 do_cmd_macro_aux_keymap(buf);
3296 prt("¹ÔÆ°: ", 20, 0);
3298 prt("Action: ", 20, 0);
3302 /* Convert to text */
3303 ascii_to_text(tmp, macro__buf);
3305 /* Get an encoded action */
3306 if (askfor_aux(tmp, 80))
3308 /* Convert to ascii */
3309 text_to_ascii(macro__buf, tmp);
3311 /* Free old keymap */
3312 string_free(keymap_act[mode][(byte)(buf[0])]);
3314 /* Make new keymap */
3315 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3319 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3321 msg_print("Added a keymap.");
3327 /* Remove a keymap */
3332 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3334 prt("Command: Remove a keymap", 16, 0);
3340 prt("²¡¤¹¥¡¼: ", 18, 0);
3342 prt("Keypress: ", 18, 0);
3346 /* Get a keymap trigger */
3347 do_cmd_macro_aux_keymap(buf);
3349 /* Free old keymap */
3350 string_free(keymap_act[mode][(byte)(buf[0])]);
3352 /* Make new keymap */
3353 keymap_act[mode][(byte)(buf[0])] = NULL;
3357 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3359 msg_print("Removed a keymap.");
3364 /* Enter a new action */
3369 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3371 prt("Command: Enter a new action", 16, 0);
3375 /* Go to the correct location */
3378 /* Hack -- limit the value */
3381 /* Get an encoded action */
3382 if (!askfor_aux(buf, 80)) continue;
3384 /* Extract an action */
3385 text_to_ascii(macro__buf, buf);
3388 #endif /* ALLOW_MACROS */
3397 /* Flush messages */
3406 static void cmd_visuals_aux(int i, int *num, int max)
3413 sprintf(str, "%d", *num);
3415 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3418 tmp = strtol(str, NULL, 0);
3419 if (tmp >= 0 && tmp < max)
3423 else if (isupper(i))
3424 *num = (*num + max - 1) % max;
3426 *num = (*num + 1) % max;
3432 * Interact with "visuals"
3434 void do_cmd_visuals(void)
3445 /* File type is "TEXT" */
3446 FILE_TYPE(FILE_TYPE_TEXT);
3449 /* Save the screen */
3453 /* Interact until done */
3459 /* Ask for a choice */
3461 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3463 prt("Interact with Visuals", 2, 0);
3467 /* Give some choices */
3469 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3471 prt("(1) Load a user pref file", 4, 5);
3474 #ifdef ALLOW_VISUALS
3476 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3477 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3478 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3479 prt("(5) (̤»ÈÍÑ)", 8, 5);
3480 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3481 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3482 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3483 prt("(9) (̤»ÈÍÑ)", 12, 5);
3485 prt("(2) Dump monster attr/chars", 5, 5);
3486 prt("(3) Dump object attr/chars", 6, 5);
3487 prt("(4) Dump feature attr/chars", 7, 5);
3488 prt("(5) (unused)", 8, 5);
3489 prt("(6) Change monster attr/chars", 9, 5);
3490 prt("(7) Change object attr/chars", 10, 5);
3491 prt("(8) Change feature attr/chars", 11, 5);
3492 prt("(9) (unused)", 12, 5);
3497 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3499 prt("(0) Reset visuals", 13, 5);
3505 prt("¥³¥Þ¥ó¥É:", 18, 0);
3507 prt("Command: ", 15, 0);
3515 if (i == ESCAPE) break;
3517 /* Load a 'pref' file */
3522 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3524 prt("Command: Load a user pref file", 15, 0);
3530 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3532 prt("File: ", 17, 0);
3536 /* Default filename */
3537 sprintf(tmp, "%s.prf", player_name);
3540 if (!askfor_aux(tmp, 70)) continue;
3542 /* Process the given filename */
3543 (void)process_pref_file(tmp);
3546 #ifdef ALLOW_VISUALS
3548 /* Dump monster attr/chars */
3551 static cptr mark = "Monster attr/chars";
3556 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3558 prt("Command: Dump monster attr/chars", 15, 0);
3564 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3566 prt("File: ", 17, 0);
3570 /* Default filename */
3571 sprintf(tmp, "%s.prf", player_name);
3573 /* Get a filename */
3574 if (!askfor_aux(tmp, 70)) continue;
3576 /* Build the filename */
3577 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3579 /* Append to the file */
3580 fff = open_auto_dump(buf, mark, &line_num);
3585 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3587 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3592 for (i = 0; i < max_r_idx; i++)
3594 monster_race *r_ptr = &r_info[i];
3596 /* Skip non-entries */
3597 if (!r_ptr->name) continue;
3599 /* Dump a comment */
3600 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3603 /* Dump the monster attr/char info */
3604 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3605 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3610 close_auto_dump(fff, mark, line_num);
3614 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3616 msg_print("Dumped monster attr/chars.");
3621 /* Dump object attr/chars */
3624 static cptr mark = "Object attr/chars";
3629 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3631 prt("Command: Dump object attr/chars", 15, 0);
3637 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3639 prt("File: ", 17, 0);
3643 /* Default filename */
3644 sprintf(tmp, "%s.prf", player_name);
3646 /* Get a filename */
3647 if (!askfor_aux(tmp, 70)) continue;
3649 /* Build the filename */
3650 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3652 /* Append to the file */
3653 fff = open_auto_dump(buf, mark, &line_num);
3658 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3660 fprintf(fff, "\n# Object attr/char definitions\n\n");
3665 for (i = 0; i < max_k_idx; i++)
3667 object_kind *k_ptr = &k_info[i];
3669 /* Skip non-entries */
3670 if (!k_ptr->name) continue;
3672 /* Dump a comment */
3673 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3676 /* Dump the object attr/char info */
3677 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3678 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3683 close_auto_dump(fff, mark, line_num);
3687 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3689 msg_print("Dumped object attr/chars.");
3694 /* Dump feature attr/chars */
3697 static cptr mark = "Feature attr/chars";
3702 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3704 prt("Command: Dump feature attr/chars", 15, 0);
3710 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3712 prt("File: ", 17, 0);
3716 /* Default filename */
3717 sprintf(tmp, "%s.prf", player_name);
3719 /* Get a filename */
3720 if (!askfor_aux(tmp, 70)) continue;
3722 /* Build the filename */
3723 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3725 /* Append to the file */
3726 fff = open_auto_dump(buf, mark, &line_num);
3731 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3733 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3738 for (i = 0; i < max_f_idx; i++)
3740 feature_type *f_ptr = &f_info[i];
3742 /* Skip non-entries */
3743 if (!f_ptr->name) continue;
3745 /* Dump a comment */
3746 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3749 /* Dump the feature attr/char info */
3750 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3751 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3756 close_auto_dump(fff, mark, line_num);
3760 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3762 msg_print("Dumped feature attr/chars.");
3767 /* Modify monster attr/chars */
3774 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3776 prt("Command: Change monster attr/chars", 15, 0);
3780 /* Hack -- query until done */
3783 monster_race *r_ptr = &r_info[r];
3787 byte da = (r_ptr->d_attr);
3788 byte dc = (r_ptr->d_char);
3789 byte ca = (r_ptr->x_attr);
3790 byte cc = (r_ptr->x_char);
3792 /* Label the object */
3794 Term_putstr(5, 17, -1, TERM_WHITE,
3795 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3796 r, (r_name + r_ptr->name)));
3798 Term_putstr(5, 17, -1, TERM_WHITE,
3799 format("Monster = %d, Name = %-40.40s",
3800 r, (r_name + r_ptr->name)));
3804 /* Label the Default values */
3806 Term_putstr(10, 19, -1, TERM_WHITE,
3807 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3809 Term_putstr(10, 19, -1, TERM_WHITE,
3810 format("Default attr/char = %3u / %3u", da, dc));
3813 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3814 Term_putch(43, 19, da, dc);
3818 Term_putch(44, 19, 255, -1);
3820 Term_putch(44, 19, 0, ' ');
3823 /* Label the Current values */
3825 Term_putstr(10, 20, -1, TERM_WHITE,
3826 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3828 Term_putstr(10, 20, -1, TERM_WHITE,
3829 format("Current attr/char = %3u / %3u", ca, cc));
3832 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3833 Term_putch(43, 20, ca, cc);
3837 Term_putch(44, 20, 255, -1);
3839 Term_putch(44, 20, 0, ' ');
3844 Term_putstr(0, 22, -1, TERM_WHITE,
3845 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3847 Term_putstr(0, 22, -1, TERM_WHITE,
3848 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3855 if (i == ESCAPE) break;
3857 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3858 else if (isupper(i)) c = 'a' + i - 'A';
3864 cmd_visuals_aux(i, &r, max_r_idx);
3867 t = (int)r_ptr->x_attr;
3868 cmd_visuals_aux(i, &t, 256);
3869 r_ptr->x_attr = (byte)t;
3872 t = (int)r_ptr->x_char;
3873 cmd_visuals_aux(i, &t, 256);
3874 r_ptr->x_char = (byte)t;
3880 /* Modify object attr/chars */
3887 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3889 prt("Command: Change object attr/chars", 15, 0);
3893 /* Hack -- query until done */
3896 object_kind *k_ptr = &k_info[k];
3900 byte da = (byte)k_ptr->d_attr;
3901 byte dc = (byte)k_ptr->d_char;
3902 byte ca = (byte)k_ptr->x_attr;
3903 byte cc = (byte)k_ptr->x_char;
3905 /* Label the object */
3907 Term_putstr(5, 17, -1, TERM_WHITE,
3908 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3909 k, (k_name + k_ptr->name)));
3911 Term_putstr(5, 17, -1, TERM_WHITE,
3912 format("Object = %d, Name = %-40.40s",
3913 k, (k_name + k_ptr->name)));
3917 /* Label the Default values */
3919 Term_putstr(10, 19, -1, TERM_WHITE,
3920 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3922 Term_putstr(10, 19, -1, TERM_WHITE,
3923 format("Default attr/char = %3d / %3d", da, dc));
3926 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3927 Term_putch(43, 19, da, dc);
3931 Term_putch(44, 19, 255, -1);
3933 Term_putch(44, 19, 0, ' ');
3936 /* Label the Current values */
3938 Term_putstr(10, 20, -1, TERM_WHITE,
3939 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3941 Term_putstr(10, 20, -1, TERM_WHITE,
3942 format("Current attr/char = %3d / %3d", ca, cc));
3945 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3946 Term_putch(43, 20, ca, cc);
3950 Term_putch(44, 20, 255, -1);
3952 Term_putch(44, 20, 0, ' ');
3957 Term_putstr(0, 22, -1, TERM_WHITE,
3958 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3960 Term_putstr(0, 22, -1, TERM_WHITE,
3961 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3968 if (i == ESCAPE) break;
3970 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3971 else if (isupper(i)) c = 'a' + i - 'A';
3977 cmd_visuals_aux(i, &k, max_k_idx);
3980 t = (int)k_info[k].x_attr;
3981 cmd_visuals_aux(i, &t, 256);
3982 k_info[k].x_attr = (byte)t;
3985 t = (int)k_info[k].x_char;
3986 cmd_visuals_aux(i, &t, 256);
3987 k_info[k].x_char = (byte)t;
3993 /* Modify feature attr/chars */
4000 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
4002 prt("Command: Change feature attr/chars", 15, 0);
4006 /* Hack -- query until done */
4009 feature_type *f_ptr = &f_info[f];
4013 byte da = (byte)f_ptr->d_attr;
4014 byte dc = (byte)f_ptr->d_char;
4015 byte ca = (byte)f_ptr->x_attr;
4016 byte cc = (byte)f_ptr->x_char;
4018 /* Label the object */
4020 Term_putstr(5, 17, -1, TERM_WHITE,
4021 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
4022 f, (f_name + f_ptr->name)));
4024 Term_putstr(5, 17, -1, TERM_WHITE,
4025 format("Terrain = %d, Name = %-40.40s",
4026 f, (f_name + f_ptr->name)));
4030 /* Label the Default values */
4032 Term_putstr(10, 19, -1, TERM_WHITE,
4033 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4035 Term_putstr(10, 19, -1, TERM_WHITE,
4036 format("Default attr/char = %3d / %3d", da, dc));
4039 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
4040 Term_putch(43, 19, da, dc);
4044 Term_putch(44, 19, 255, -1);
4046 Term_putch(44, 19, 0, ' ');
4049 /* Label the Current values */
4051 Term_putstr(10, 20, -1, TERM_WHITE,
4052 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4054 Term_putstr(10, 20, -1, TERM_WHITE,
4055 format("Current attr/char = %3d / %3d", ca, cc));
4058 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
4059 Term_putch(43, 20, ca, cc);
4063 Term_putch(44, 20, 255, -1);
4065 Term_putch(44, 20, 0, ' ');
4070 Term_putstr(0, 22, -1, TERM_WHITE,
4071 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
4073 Term_putstr(0, 22, -1, TERM_WHITE,
4074 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4081 if (i == ESCAPE) break;
4083 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4084 else if (isupper(i)) c = 'a' + i - 'A';
4090 cmd_visuals_aux(i, &f, max_f_idx);
4093 t = (int)f_info[f].x_attr;
4094 cmd_visuals_aux(i, &t, 256);
4095 f_info[f].x_attr = (byte)t;
4098 t = (int)f_info[f].x_char;
4099 cmd_visuals_aux(i, &t, 256);
4100 f_info[f].x_char = (byte)t;
4116 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4118 msg_print("Visual attr/char tables reset.");
4123 /* Unknown option */
4129 /* Flush messages */
4134 /* Restore the screen */
4140 * Interact with "colors"
4142 void do_cmd_colors(void)
4153 /* File type is "TEXT" */
4154 FILE_TYPE(FILE_TYPE_TEXT);
4157 /* Save the screen */
4161 /* Interact until done */
4167 /* Ask for a choice */
4169 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4171 prt("Interact with Colors", 2, 0);
4175 /* Give some choices */
4177 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4179 prt("(1) Load a user pref file", 4, 5);
4184 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4185 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4187 prt("(2) Dump colors", 5, 5);
4188 prt("(3) Modify colors", 6, 5);
4195 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4197 prt("Command: ", 8, 0);
4205 if (i == ESCAPE) break;
4207 /* Load a 'pref' file */
4212 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4214 prt("Command: Load a user pref file", 8, 0);
4220 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4222 prt("File: ", 10, 0);
4227 sprintf(tmp, "%s.prf", player_name);
4230 if (!askfor_aux(tmp, 70)) continue;
4232 /* Process the given filename */
4233 (void)process_pref_file(tmp);
4235 /* Mega-Hack -- react to changes */
4236 Term_xtra(TERM_XTRA_REACT, 0);
4238 /* Mega-Hack -- redraw */
4247 static cptr mark = "Colors";
4252 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4254 prt("Command: Dump colors", 8, 0);
4260 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4262 prt("File: ", 10, 0);
4266 /* Default filename */
4267 sprintf(tmp, "%s.prf", player_name);
4269 /* Get a filename */
4270 if (!askfor_aux(tmp, 70)) continue;
4272 /* Build the filename */
4273 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4275 /* Append to the file */
4276 fff = open_auto_dump(buf, mark, &line_num);
4281 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4283 fprintf(fff, "\n# Color redefinitions\n\n");
4288 for (i = 0; i < 256; i++)
4290 int kv = angband_color_table[i][0];
4291 int rv = angband_color_table[i][1];
4292 int gv = angband_color_table[i][2];
4293 int bv = angband_color_table[i][3];
4298 cptr name = "unknown";
4302 /* Skip non-entries */
4303 if (!kv && !rv && !gv && !bv) continue;
4305 /* Extract the color name */
4306 if (i < 16) name = color_names[i];
4308 /* Dump a comment */
4310 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4312 fprintf(fff, "# Color '%s'\n", name);
4316 /* Dump the monster attr/char info */
4317 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4323 close_auto_dump(fff, mark, line_num);
4327 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4329 msg_print("Dumped color redefinitions.");
4341 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4343 prt("Command: Modify colors", 8, 0);
4347 /* Hack -- query until done */
4356 /* Exhibit the normal colors */
4357 for (j = 0; j < 16; j++)
4359 /* Exhibit this color */
4360 Term_putstr(j*4, 20, -1, a, "###");
4362 /* Exhibit all colors */
4363 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4366 /* Describe the color */
4368 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4370 name = ((a < 16) ? color_names[a] : "undefined");
4374 /* Describe the color */
4376 Term_putstr(5, 10, -1, TERM_WHITE,
4377 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4379 Term_putstr(5, 10, -1, TERM_WHITE,
4380 format("Color = %d, Name = %s", a, name));
4384 /* Label the Current values */
4385 Term_putstr(5, 12, -1, TERM_WHITE,
4386 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4387 angband_color_table[a][0],
4388 angband_color_table[a][1],
4389 angband_color_table[a][2],
4390 angband_color_table[a][3]));
4394 Term_putstr(0, 14, -1, TERM_WHITE,
4395 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4397 Term_putstr(0, 14, -1, TERM_WHITE,
4398 "Command (n/N/k/K/r/R/g/G/b/B): ");
4406 if (i == ESCAPE) break;
4409 if (i == 'n') a = (byte)(a + 1);
4410 if (i == 'N') a = (byte)(a - 1);
4411 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4412 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4413 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4414 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4415 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4416 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4417 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4418 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4420 /* Hack -- react to changes */
4421 Term_xtra(TERM_XTRA_REACT, 0);
4423 /* Hack -- redraw */
4430 /* Unknown option */
4436 /* Flush messages */
4441 /* Restore the screen */
4447 * Note something in the message recall
4449 void do_cmd_note(void)
4458 if (!get_string("¥á¥â: ", buf, 60)) return;
4460 if (!get_string("Note: ", buf, 60)) return;
4464 /* Ignore empty notes */
4465 if (!buf[0] || (buf[0] == ' ')) return;
4467 /* Add the note to the message recall */
4469 msg_format("¥á¥â: %s", buf);
4471 msg_format("Note: %s", buf);
4478 * Mention the current version
4480 void do_cmd_version(void)
4485 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4486 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4488 msg_format("You are playing Hengband %d.%d.%d.",
4489 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4496 * Array of feeling strings
4498 static cptr do_cmd_feeling_text[11] =
4501 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4503 "Looks like any other level.",
4507 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4509 "You feel there is something special about this level.",
4513 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4515 "You nearly faint as horrible visions of death fill your mind!",
4519 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4521 "This level looks very dangerous.",
4525 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4527 "You have a very bad feeling...",
4531 "°¤¤Í½´¶¤¬¤¹¤ë...",
4533 "You have a bad feeling...",
4539 "You feel nervous.",
4543 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4545 "You feel your luck is turning...",
4549 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4551 "You don't like the look of this place.",
4555 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4557 "This level looks reasonably safe.",
4561 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4563 "What a boring place..."
4568 static cptr do_cmd_feeling_text_combat[11] =
4571 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4573 "Looks like any other level.",
4577 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4579 "You feel there is something special about this level.",
4583 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4585 "You nearly faint as horrible visions of death fill your mind!",
4589 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4591 "This level looks very dangerous.",
4595 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4597 "You have a very bad feeling...",
4601 "°¤¤Í½´¶¤¬¤¹¤ë...",
4603 "You have a bad feeling...",
4609 "You feel nervous.",
4613 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4615 "You feel your luck is turning...",
4619 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4621 "You don't like the look of this place.",
4625 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4627 "This level looks reasonably safe.",
4631 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4633 "What a boring place..."
4638 static cptr do_cmd_feeling_text_lucky[11] =
4641 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4642 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4643 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4644 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4645 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4646 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4647 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4648 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4649 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4650 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4651 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4653 "Looks like any other level.",
4654 "You feel there is something special about this level.",
4655 "You have a superb feeling about this level.",
4656 "You have an excellent feeling...",
4657 "You have a very good feeling...",
4658 "You have a good feeling...",
4659 "You feel strangely lucky...",
4660 "You feel your luck is turning...",
4661 "You like the look of this place...",
4662 "This level can't be all bad...",
4663 "What a boring place..."
4669 * Note that "feeling" is set to zero unless some time has passed.
4670 * Note that this is done when the level is GENERATED, not entered.
4672 void do_cmd_feeling(void)
4674 /* Verify the feeling */
4675 if (feeling > 10) feeling = 10;
4677 /* No useful feeling in quests */
4678 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4681 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4683 msg_print("Looks like a typical quest level.");
4689 /* No useful feeling in town */
4690 else if (p_ptr->town_num && !dun_level)
4693 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4695 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4699 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4701 msg_print("Looks like a strange wilderness.");
4709 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4711 msg_print("Looks like a typical town.");
4718 /* No useful feeling in the wilderness */
4719 else if (!dun_level)
4722 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4724 msg_print("Looks like a typical wilderness.");
4730 /* Display the feeling */
4731 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4733 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4735 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4736 msg_print(do_cmd_feeling_text_combat[feeling]);
4738 msg_print(do_cmd_feeling_text[feeling]);
4743 msg_print(do_cmd_feeling_text[0]);
4749 #define BROWSER_ROWS 16
4751 * Description of each monster group.
4753 static cptr monster_group_text[] =
4756 "¥æ¥Ë¡¼¥¯", /* "Uniques" */
4785 /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */
4802 /* "¾åµé¥Ç¡¼¥â¥ó", */
4840 /* "Ancient Dragon/Wyrm", */
4849 "Multi-Headed Reptile",
4854 "Reptile/Amphibian",
4855 "Spider/Scorpion/Tick",
4857 /* "Major Demon", */
4870 * Symbols of monsters in each group. Note the "Uniques" group
4871 * is handled differently.
4873 static cptr monster_group_char[] =
4934 * hook function to sort monsters by level
4936 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
4938 u16b *who = (u16b*)(u);
4943 monster_race *r_ptr1 = &r_info[w1];
4944 monster_race *r_ptr2 = &r_info[w2];
4946 if (r_ptr2->level > r_ptr1->level) return TRUE;
4947 if (r_ptr1->level > r_ptr2->level) return FALSE;
4949 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
4950 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
4955 * Build a list of monster indexes in the given group. Return the number
4956 * of monsters in the group.
4958 * mode & 0x01 : check for non-empty group
4959 * mode & 0x02 : cheat?
4961 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
4966 /* Get a list of x_char in this group */
4967 cptr group_char = monster_group_char[grp_cur];
4969 /* XXX Hack -- Check if this is the "Uniques" group */
4970 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
4972 /* Check every race */
4973 for (i = 0; i < max_r_idx; i++)
4975 /* Access the race */
4976 monster_race *r_ptr = &r_info[i];
4978 /* Is this a unique? */
4979 bool unique = (bool)(r_ptr->flags1 & (RF1_UNIQUE)) ;
4981 /* Skip empty race */
4982 if (!r_ptr->name) continue ;
4984 /* Require known monsters */
4985 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights ) continue;
4987 if (grp_unique && !(unique)) continue;
4989 /* Check for race in the group */
4990 if (grp_unique || strchr(group_char, r_ptr->d_char))
4993 mon_idx[mon_cnt++] = i;
4995 /* XXX Hack -- Just checking for non-empty group */
4996 if (mode & 0x01) break;
5000 /* Terminate the list */
5001 mon_idx[mon_cnt] = 0;
5003 /* Select the sort method */
5004 ang_sort_comp = ang_sort_comp_monster_level;
5005 ang_sort_swap = ang_sort_swap_hook;
5007 /* Sort by monster level */
5008 ang_sort(mon_idx, &dummy_why, mon_cnt);
5010 /* Return the number of races */
5016 * Description of each monster group.
5018 static cptr object_group_text[] =
5021 "¥¥Î¥³", /* "Mushrooms" */
5022 "Ìô", /* "Potions" */
5023 "Ìý¤Ä¤Ü", /* "Flasks" */
5024 "´¬Êª", /* "Scrolls" */
5025 "»ØÎØ", /* "Rings" */
5026 "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */
5027 "ū", /* "Whistle" */
5028 "¸÷¸»", /* "Lanterns" */
5029 "ËâË¡ËÀ", /* "Wands" */
5030 "¾ó", /* "Staffs" */
5031 "¥í¥Ã¥É", /* "Rods" */
5032 "¥«¡¼¥É", /* "Cards" */
5033 "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë",
5041 "Åá·õÎà", /* "Swords" */
5042 "Æß´ï", /* "Blunt Weapons" */
5043 "ĹÊÁÉð´ï", /* "Polearms" */
5044 "ºÎ·¡Æ»¶ñ", /* "Diggers" */
5045 "Èô¤ÓÆ»¶ñ", /* "Bows" */
5049 "·ÚÁõ³»", /* "Soft Armor" */
5050 "½ÅÁõ³»", /* "Hard Armor" */
5051 "¥É¥é¥´¥ó³»", /* "Dragon Armor" */
5052 "½â", /* "Shields" */
5053 "¥¯¥í¡¼¥¯", /* "Cloaks" */
5054 "äƼê", /* "Gloves" */
5055 "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */
5056 "´§", /* "Crowns" */
5057 "¥Ö¡¼¥Ä", /* "Boots" */
5101 * TVALs of items in each group
5103 static byte object_group_tval[] =
5148 * Build a list of monster indexes in the given group. Return the number
5149 * of monsters in the group.
5151 static int collect_objects(int grp_cur, int object_idx[])
5153 int i, j, k, object_cnt = 0;
5155 /* Get a list of x_char in this group */
5156 byte group_tval = object_group_tval[grp_cur];
5158 /* Check every object */
5159 for (i = 0; i < max_k_idx; i++)
5161 /* Access the race */
5162 object_kind *k_ptr = &k_info[i];
5164 /* Skip empty objects */
5165 if (!k_ptr->name) continue;
5167 /* Skip non-flavoured objects */
5168 if (!k_ptr->flavor) continue;
5170 /* Skip items with no distribution (special artifacts) */
5171 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
5174 /* Require objects ever seen*/
5175 if (!k_ptr->aware && !p_ptr->wizard) continue;
5177 /* Check for race in the group */
5178 if (k_ptr->tval == group_tval)
5181 object_idx[object_cnt++] = i;
5185 /* Terminate the list */
5186 object_idx[object_cnt] = 0;
5188 /* Return the number of races */
5195 * Build a list of monster indexes in the given group. Return the number
5196 * of monsters in the group.
5198 static int collect_artifacts(int grp_cur, int object_idx[])
5200 int i, object_cnt = 0;
5202 /* Get a list of x_char in this group */
5203 byte group_tval = object_group_tval[grp_cur];
5205 /* Check every object */
5206 for (i = 0; i < max_a_idx; i++)
5208 /* Access the artifact */
5209 artifact_type *a_ptr = &a_info[i];
5211 /* Skip empty artifacts */
5212 if (!a_ptr->name) continue;
5214 /* Skip "uncreated" artifacts */
5215 if (!a_ptr->cur_num) continue;
5217 /* Check for race in the group */
5218 if (a_ptr->tval == group_tval)
5221 object_idx[object_cnt++] = i;
5225 /* Terminate the list */
5226 object_idx[object_cnt] = 0;
5228 /* Return the number of races */
5235 * Encode the screen colors
5237 static char hack[17] = "dwsorgbuDWvyRGBU";
5240 static errr photo_fgets(FILE *fff, char *buf, huge n)
5249 if (fgets(tmp, 1024, fff))
5251 /* Convert weirdness */
5252 for (s = tmp; *s; s++)
5254 /* Handle newline */
5265 else if (*s == '\t')
5267 /* Hack -- require room */
5268 if (i + 8 >= n) break;
5270 /* Append a space */
5273 /* Append some more spaces */
5274 while (!(i % 8)) buf[i++] = ' ';
5278 else if (iskanji(*s))
5285 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
5286 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
5293 /* Handle printables */
5314 * Hack -- load a screen dump from a file
5316 void do_cmd_load_screen(void)
5331 Term_get_size(&wid, &hgt);
5333 /* Hack -- drop permissions */
5336 /* Build the filename */
5337 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5339 /* Append to the file */
5340 fff = my_fopen(buf, "r");
5345 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5347 msg_format("Failed to open %s.", buf);
5354 /* Save the screen */
5357 /* Clear the screen */
5361 /* Load the screen */
5362 for (y = 0; okay && (y < hgt); y++)
5364 /* Get a line of data */
5365 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5368 for (x = 0; x < wid - 1; x++)
5370 /* Put the attr/char */
5371 Term_draw(x, y, TERM_WHITE, buf[x]);
5375 /* Get the blank line */
5376 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5379 /* Dump the screen */
5380 for (y = 0; okay && (y < hgt); y++)
5382 /* Get a line of data */
5383 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5386 for (x = 0; x < wid - 1; x++)
5388 /* Get the attr/char */
5389 (void)(Term_what(x, y, &a, &c));
5391 /* Look up the attr */
5392 for (i = 0; i < 16; i++)
5394 /* Use attr matches */
5395 if (hack[i] == buf[x]) a = i;
5398 /* Put the attr/char */
5399 Term_draw(x, y, a, c);
5404 /* Get the blank line */
5405 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5411 /* Hack -- grab permissions */
5417 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
5419 msg_print("Screen dump loaded.");
5426 /* Restore the screen */
5433 cptr inven_res_label =
5435 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
5437 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
5440 /* XTRA HACK RESLIST */
5441 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
5442 int *j, byte tval, char *where)
5444 char o_name[MAX_NLEN];
5445 u32b flgs[TR_FLAG_SIZE];
5447 if (!o_ptr->k_idx)return;
5448 if (o_ptr->tval != tval)return;
5451 * HACK:Ring of Lordly protection and Dragon shield/helm
5452 * have random resistances.
5454 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
5455 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
5456 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
5457 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
5458 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
5459 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
5460 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
5463 object_desc(o_name, o_ptr, TRUE, 0);
5465 while ( o_name[i] && i < 26 ){
5467 if (iskanji(o_name[i])) i++;
5471 if(i<28) while(i<28){o_name[i]=' ';i++;}
5474 fprintf(fff,"%s %s", where, o_name);
5476 if (!(o_ptr->ident & (IDENT_MENTAL)))
5479 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
5481 fprintf(fff, "-------unknown------------ -------unknown------\n");
5485 object_flags_known(o_ptr, flgs);
5488 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
5489 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
5490 else fprintf(fff,"¡¦");
5492 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
5493 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
5494 else fprintf(fff,"¡¦");
5496 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
5497 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
5498 else fprintf(fff,"¡¦");
5500 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
5501 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
5502 else fprintf(fff,"¡¦");
5504 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
5505 else fprintf(fff,"¡¦");
5507 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
5508 else fprintf(fff,"¡¦");
5510 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
5511 else fprintf(fff,"¡¦");
5513 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
5514 else fprintf(fff,"¡¦");
5516 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
5517 else fprintf(fff,"¡¦");
5519 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
5520 else fprintf(fff,"¡¦");
5522 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
5523 else fprintf(fff,"¡¦");
5525 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
5526 else fprintf(fff,"¡¦");
5528 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
5529 else fprintf(fff,"¡¦");
5533 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
5534 else fprintf(fff,"¡¦");
5536 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
5537 else fprintf(fff,"¡¦");
5539 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
5540 else fprintf(fff,"¡¦");
5542 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
5543 else fprintf(fff,"¡¦");
5545 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
5546 else fprintf(fff,"¡¦");
5548 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
5549 else fprintf(fff,"¡¦");
5551 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
5552 else fprintf(fff,"¡¦");
5554 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
5555 else fprintf(fff,"¡¦");
5558 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
5559 else fprintf(fff,"¡¦");
5561 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
5562 else fprintf(fff,"¡¦");
5564 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
5565 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
5566 else fprintf(fff,". ");
5568 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
5569 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
5570 else fprintf(fff,". ");
5572 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
5573 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
5574 else fprintf(fff,". ");
5576 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5577 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5578 else fprintf(fff,". ");
5580 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5581 else fprintf(fff,". ");
5583 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5584 else fprintf(fff,". ");
5586 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5587 else fprintf(fff,". ");
5589 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5590 else fprintf(fff,". ");
5592 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5593 else fprintf(fff,". ");
5595 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5596 else fprintf(fff,". ");
5598 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5599 else fprintf(fff,". ");
5601 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5602 else fprintf(fff,". ");
5604 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5605 else fprintf(fff,". ");
5609 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5610 else fprintf(fff,". ");
5612 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5613 else fprintf(fff,". ");
5615 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5616 else fprintf(fff,". ");
5618 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5619 else fprintf(fff,". ");
5621 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5622 else fprintf(fff,". ");
5624 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5625 else fprintf(fff,". ");
5627 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5628 else fprintf(fff,". ");
5630 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5631 else fprintf(fff,". ");
5634 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5635 else fprintf(fff,". ");
5637 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5638 else fprintf(fff,". ");
5646 fprintf(fff,"%s\n", inven_res_label);
5652 * Display *ID* ed weapons/armors's resistances
5654 static void do_cmd_knowledge_inven(void)
5659 char file_name[1024];
5670 /* Open a new file */
5671 fff = my_fopen_temp(file_name, 1024);
5674 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5676 msg_format("Failed to create temporally file %s.", file_name);
5681 fprintf(fff,"%s\n",inven_res_label);
5683 for (tval=TV_BOW; tval <= TV_RING; tval++){
5686 for (;j<9;j++) fprintf(fff, "\n");
5688 fprintf(fff,"%s\n",inven_res_label);
5692 strcpy(where, "Áõ");
5694 strcpy(where, "E ");
5696 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5698 o_ptr = &inventory[i];
5699 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5703 strcpy(where, "»ý");
5705 strcpy(where, "I ");
5707 for (i = 0; i < INVEN_PACK; i++)
5709 o_ptr = &inventory[i];
5710 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5714 /* Print all homes in the different towns */
5715 st_ptr = &town[1].store[STORE_HOME];
5717 strcpy(where, "²È");
5719 strcpy(where, "H ");
5722 /* Dump all available items */
5723 for (i = 0; i < st_ptr->stock_num; i++)
5725 o_ptr = &st_ptr->stock[i];
5726 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5730 /* Close the file */
5733 /* Display the file contents */
5735 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5737 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5740 /* Remove the file */
5745 void do_cmd_save_screen_html_aux(char *filename, int message)
5749 byte a = 0, old_a = 0;
5763 cptr html_head[] = {
5764 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5768 cptr html_foot[] = {
5770 "</body>\n</html>\n",
5776 Term_get_size(&wid, &hgt);
5778 /* File type is "TEXT" */
5779 FILE_TYPE(FILE_TYPE_TEXT);
5781 /* Append to the file */
5782 fff = my_fopen(filename, "w");
5788 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5790 msg_format("Failed to open file %s.", filename);
5798 /* Save the screen */
5802 /* Build the filename */
5803 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5804 tmpfff = my_fopen(buf, "r");
5806 for (i = 0; html_head[i]; i++)
5807 fprintf(fff, html_head[i]);
5811 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5813 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5817 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5819 fprintf(fff, "%s\n", buf);
5824 /* Dump the screen */
5825 for (y = 0; y < hgt; y++)
5832 for (x = 0; x < wid - 1; x++)
5836 /* Get the attr/char */
5837 (void)(Term_what(x, y, &a, &c));
5841 case '&': cc = "&"; break;
5842 case '<': cc = "<"; break;
5843 case '>': cc = ">"; break;
5845 case 0x1f: c = '.'; break;
5846 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5851 if ((y == 0 && x == 0) || a != old_a) {
5852 rv = angband_color_table[a][1];
5853 gv = angband_color_table[a][2];
5854 bv = angband_color_table[a][3];
5855 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5856 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5860 fprintf(fff, "%s", cc);
5862 fprintf(fff, "%c", c);
5865 fprintf(fff, "</font>");
5868 for (i = 0; html_foot[i]; i++)
5869 fprintf(fff, html_foot[i]);
5874 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5876 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5880 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5882 fprintf(fff, "%s\n", buf);
5897 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5899 msg_print("Screen dump saved.");
5904 /* Restore the screen */
5910 * Hack -- save a screen dump to a file
5912 static void do_cmd_save_screen_html(void)
5914 char buf[1024], tmp[256] = "screen.html";
5917 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5919 if (!get_string("File name: ", tmp, 80))
5923 /* Build the filename */
5924 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5928 /* Hack -- drop permissions */
5931 do_cmd_save_screen_html_aux(buf, 1);
5933 /* Hack -- grab permissions */
5939 * Redefinable "save_screen" action
5941 void (*screendump_aux)(void) = NULL;
5945 * Hack -- save a screen dump to a file
5947 void do_cmd_save_screen(void)
5949 bool old_use_graphics = use_graphics;
5950 bool html_dump = FALSE;
5955 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
5957 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
5962 if (c == 'Y' || c == 'y')
5964 else if (c == 'H' || c == 'h')
5976 Term_get_size(&wid, &hgt);
5978 if (old_use_graphics)
5980 use_graphics = FALSE;
5983 /* Redraw everything */
5984 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5986 /* Hack -- update */
5992 do_cmd_save_screen_html();
5996 /* Do we use a special screendump function ? */
5997 else if (screendump_aux)
5999 /* Dump the screen to a graphics file */
6000 (*screendump_aux)();
6002 else /* Dump the screen as text */
6014 /* Hack -- drop permissions */
6017 /* Build the filename */
6018 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
6020 /* File type is "TEXT" */
6021 FILE_TYPE(FILE_TYPE_TEXT);
6023 /* Append to the file */
6024 fff = my_fopen(buf, "w");
6029 /* Hack -- grab permissions */
6032 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
6034 msg_format("Failed to open file %s.", buf);
6041 /* Save the screen */
6045 /* Dump the screen */
6046 for (y = 0; y < hgt; y++)
6049 for (x = 0; x < wid - 1; x++)
6051 /* Get the attr/char */
6052 (void)(Term_what(x, y, &a, &c));
6062 fprintf(fff, "%s\n", buf);
6069 /* Dump the screen */
6070 for (y = 0; y < hgt; y++)
6073 for (x = 0; x < wid - 1; x++)
6075 /* Get the attr/char */
6076 (void)(Term_what(x, y, &a, &c));
6079 buf[x] = hack[a&0x0F];
6086 fprintf(fff, "%s\n", buf);
6096 /* Hack -- grab permissions */
6101 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6103 msg_print("Screen dump saved.");
6109 /* Restore the screen */
6113 if (old_use_graphics)
6115 use_graphics = TRUE;
6118 /* Redraw everything */
6119 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6121 /* Hack -- update */
6128 * Sorting hook -- Comp function -- see below
6130 * We use "u" to point to array of monster indexes,
6131 * and "v" to select the type of sorting to perform on "u".
6133 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
6135 u16b *who = (u16b*)(u);
6137 u16b *why = (u16b*)(v);
6145 /* Sort by total kills */
6148 /* Extract total kills */
6149 z1 = a_info[w1].tval;
6150 z2 = a_info[w2].tval;
6152 /* Compare total kills */
6153 if (z1 < z2) return (TRUE);
6154 if (z1 > z2) return (FALSE);
6158 /* Sort by monster level */
6161 /* Extract levels */
6162 z1 = a_info[w1].sval;
6163 z2 = a_info[w2].sval;
6165 /* Compare levels */
6166 if (z1 < z2) return (TRUE);
6167 if (z1 > z2) return (FALSE);
6171 /* Sort by monster experience */
6174 /* Extract experience */
6175 z1 = a_info[w1].level;
6176 z2 = a_info[w2].level;
6178 /* Compare experience */
6179 if (z1 < z2) return (TRUE);
6180 if (z1 > z2) return (FALSE);
6184 /* Compare indexes */
6190 * Sorting hook -- Swap function -- see below
6192 * We use "u" to point to array of monster indexes,
6193 * and "v" to select the type of sorting to perform.
6195 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
6197 u16b *who = (u16b*)(u);
6209 * Check the status of "artifacts"
6211 static void do_cmd_knowledge_artifacts(void)
6213 int i, k, z, x, y, n = 0;
6219 char file_name[1024];
6221 char base_name[MAX_NLEN];
6225 /* Open a new file */
6226 fff = my_fopen_temp(file_name, 1024);
6230 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6232 msg_format("Failed to create temporary file %s.", file_name);
6238 /* Allocate the "who" array */
6239 C_MAKE(who, max_a_idx, s16b);
6241 /* Allocate the "okay" array */
6242 C_MAKE(okay, max_a_idx, bool);
6244 /* Scan the artifacts */
6245 for (k = 0; k < max_a_idx; k++)
6247 artifact_type *a_ptr = &a_info[k];
6252 /* Skip "empty" artifacts */
6253 if (!a_ptr->name) continue;
6255 /* Skip "uncreated" artifacts */
6256 if (!a_ptr->cur_num) continue;
6262 /* Check the dungeon */
6263 for (y = 0; y < cur_hgt; y++)
6265 for (x = 0; x < cur_wid; x++)
6267 cave_type *c_ptr = &cave[y][x];
6269 s16b this_o_idx, next_o_idx = 0;
6271 /* Scan all objects in the grid */
6272 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
6276 /* Acquire object */
6277 o_ptr = &o_list[this_o_idx];
6279 /* Acquire next object */
6280 next_o_idx = o_ptr->next_o_idx;
6282 /* Ignore non-artifacts */
6283 if (!artifact_p(o_ptr)) continue;
6285 /* Ignore known items */
6286 if (object_known_p(o_ptr)) continue;
6288 /* Note the artifact */
6289 okay[o_ptr->name1] = FALSE;
6294 /* Check the inventory and equipment */
6295 for (i = 0; i < INVEN_TOTAL; i++)
6297 object_type *o_ptr = &inventory[i];
6299 /* Ignore non-objects */
6300 if (!o_ptr->k_idx) continue;
6302 /* Ignore non-artifacts */
6303 if (!artifact_p(o_ptr)) continue;
6305 /* Ignore known items */
6306 if (object_known_p(o_ptr)) continue;
6308 /* Note the artifact */
6309 okay[o_ptr->name1] = FALSE;
6312 for (k = 0; k < max_a_idx; k++)
6314 if (okay[k]) who[n++] = k;
6317 /* Select the sort method */
6318 ang_sort_comp = ang_sort_art_comp;
6319 ang_sort_swap = ang_sort_art_swap;
6321 /* Sort the array by dungeon depth of monsters */
6322 ang_sort(who, &why, n);
6324 /* Scan the artifacts */
6325 for (k = 0; k < n; k++)
6327 artifact_type *a_ptr = &a_info[who[k]];
6331 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
6333 strcpy(base_name, "Unknown Artifact");
6337 /* Obtain the base object type */
6338 z = lookup_kind(a_ptr->tval, a_ptr->sval);
6346 /* Get local object */
6349 /* Create fake object */
6350 object_prep(q_ptr, z);
6352 /* Make it an artifact */
6353 q_ptr->name1 = (byte)who[k];
6355 /* Describe the artifact */
6356 object_desc_store(base_name, q_ptr, FALSE, 0);
6359 /* Hack -- Build the artifact name */
6361 fprintf(fff, " %s\n", base_name);
6363 fprintf(fff, " The %s\n", base_name);
6368 /* Free the "who" array */
6369 C_KILL(who, max_a_idx, s16b);
6371 /* Free the "okay" array */
6372 C_KILL(okay, max_a_idx, bool);
6374 /* Close the file */
6377 /* Display the file contents */
6379 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
6381 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
6385 /* Remove the file */
6391 * Display known uniques
6393 static void do_cmd_knowledge_uniques(void)
6401 char file_name[1024];
6403 /* Open a new file */
6404 fff = my_fopen_temp(file_name, 1024);
6408 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6410 msg_format("Failed to create temporary file %s.", file_name);
6416 /* Allocate the "who" array */
6417 C_MAKE(who, max_r_idx, s16b);
6419 /* Scan the monsters */
6420 for (i = 1; i < max_r_idx; i++)
6422 monster_race *r_ptr = &r_info[i];
6424 /* Use that monster */
6425 if (r_ptr->name) who[n++] = i;
6428 /* Select the sort method */
6429 ang_sort_comp = ang_sort_comp_hook;
6430 ang_sort_swap = ang_sort_swap_hook;
6432 /* Sort the array by dungeon depth of monsters */
6433 ang_sort(who, &why, n);
6435 /* Scan the monster races */
6436 for (k = 0; k < n; k++)
6438 monster_race *r_ptr = &r_info[who[k]];
6440 /* Only print Uniques */
6441 if (r_ptr->flags1 & (RF1_UNIQUE))
6443 bool dead = (r_ptr->max_num == 0);
6447 /* Only display "known" uniques */
6448 if (dead || cheat_know || r_ptr->r_sights)
6450 /* Print a message */
6452 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
6453 (r_name + r_ptr->name));
6455 fprintf(fff, " %s is alive\n",
6456 (r_name + r_ptr->name));
6463 /* Free the "who" array */
6464 C_KILL(who, max_r_idx, s16b);
6466 /* Close the file */
6469 /* Display the file contents */
6471 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6473 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6477 /* Remove the file */
6484 * Display dead uniques
6486 static void do_cmd_knowledge_uniques_dead(void)
6494 char file_name[1024];
6496 /* Open a new file */
6497 fff = my_fopen_temp(file_name, 1024);
6501 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6503 msg_format("Failed to create temporary file %s.", file_name);
6509 /* Allocate the "who" array */
6510 C_MAKE(who, max_r_idx, s16b);
6512 /* Scan the monsters */
6513 for (i = 1; i < max_r_idx; i++)
6515 monster_race *r_ptr = &r_info[i];
6517 /* Use that monster */
6518 if (r_ptr->name) who[n++] = i;
6521 /* Select the sort method */
6522 ang_sort_comp = ang_sort_comp_hook;
6523 ang_sort_swap = ang_sort_swap_hook;
6525 /* Sort the array by dungeon depth of monsters */
6526 ang_sort(who, &why, n);
6528 /* Scan the monster races */
6529 for (k = 0; k < n; k++)
6531 monster_race *r_ptr = &r_info[who[k]];
6533 /* Only print Uniques */
6534 if (r_ptr->flags1 & (RF1_UNIQUE))
6536 bool dead = (r_ptr->max_num == 0);
6538 if (!dead) continue;
6540 /* Only display "known" uniques */
6541 if (dead || cheat_know || r_ptr->r_sights)
6543 /* Print a message */
6545 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
6546 (r_name + r_ptr->name));
6548 fprintf(fff, " %s is dead\n",
6549 (r_name + r_ptr->name));
6556 /* Free the "who" array */
6557 C_KILL(who, max_r_idx, s16b);
6559 /* Close the file */
6562 /* Display the file contents */
6564 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6566 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
6570 /* Remove the file */
6577 * Display weapon-exp
6579 static void do_cmd_knowledge_weapon_exp(void)
6581 int i,j, num, shougou;
6585 char file_name[1024];
6588 /* Open a new file */
6589 fff = my_fopen_temp(file_name, 1024);
6592 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6594 msg_format("Failed to create temporary file %s.", file_name);
6600 for(i = 0; i < 5; i++)
6602 for (num = 0; num < 64; num++)
6604 for (j = 0; j < max_k_idx; j++)
6606 object_kind *k_ptr = &k_info[j];
6608 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6610 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6612 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6613 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6614 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6615 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6618 fprintf(fff,"%-25s ",tmp);
6619 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6620 else fprintf(fff," ");
6621 fprintf(fff,"%s",shougou_moji[shougou]);
6622 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6630 /* Close the file */
6633 /* Display the file contents */
6635 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6637 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6641 /* Remove the file */
6649 static void do_cmd_knowledge_spell_exp(void)
6656 char file_name[1024];
6658 /* Open a new file */
6659 fff = my_fopen_temp(file_name, 1024);
6662 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6664 msg_format("Failed to create temporary file %s.", file_name);
6670 if(p_ptr->realm1 != REALM_NONE)
6673 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6675 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6677 for (i = 0; i < 32; i++)
6679 if (!is_magic(p_ptr->realm1))
6681 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6685 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6687 if(s_ptr->slevel == 99) continue;
6688 if(p_ptr->spell_exp[i]<900) shougou=0;
6689 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6690 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6691 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6693 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6694 if (p_ptr->realm1 == REALM_HISSATSU)
6695 fprintf(fff,"[--]");
6698 if (shougou == 4) fprintf(fff,"!");
6699 else fprintf(fff," ");
6700 fprintf(fff,"%s",shougou_moji[shougou]);
6702 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6707 if(p_ptr->realm2 != REALM_NONE)
6709 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6710 for (i = 0; i < 32; i++)
6712 if (!is_magic(p_ptr->realm1))
6714 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6718 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6720 if(s_ptr->slevel == 99) continue;
6722 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6723 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6724 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6726 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6727 if (shougou == 3) fprintf(fff,"!");
6728 else fprintf(fff," ");
6729 fprintf(fff,"%s",shougou_moji[shougou]);
6730 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6735 /* Close the file */
6738 /* Display the file contents */
6740 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6742 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6746 /* Remove the file */
6754 static void do_cmd_knowledge_skill_exp(void)
6760 char file_name[1024];
6762 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6764 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6767 /* Open a new file */
6768 fff = my_fopen_temp(file_name, 1024);
6771 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6773 msg_format("Failed to create temporary file %s.", file_name);
6779 for (i = 0; i < 3; i++)
6781 if(i == GINOU_RIDING)
6783 if(p_ptr->skill_exp[i]<500) shougou=0;
6784 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6785 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6786 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6791 if(p_ptr->skill_exp[i]<4000) shougou=0;
6792 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6793 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6794 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6797 fprintf(fff,"%-20s ",skill_name[i]);
6798 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6799 else fprintf(fff," ");
6800 fprintf(fff,"%s",shougou_moji[shougou]);
6801 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6805 /* Close the file */
6808 /* Display the file contents */
6810 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6812 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6816 /* Remove the file */
6822 * Pluralize a monster name
6824 void plural_aux(char *Name)
6826 int NameLen = strlen(Name);
6828 if (strstr(Name, "Disembodied hand"))
6830 strcpy(Name, "Disembodied hands that strangled people");
6832 else if (strstr(Name, "Colour out of space"))
6834 strcpy(Name, "Colours out of space");
6836 else if (strstr(Name, "stairway to hell"))
6838 strcpy(Name, "stairways to hell");
6840 else if (strstr(Name, "Dweller on the threshold"))
6842 strcpy(Name, "Dwellers on the threshold");
6844 else if (strstr(Name, " of "))
6846 cptr aider = strstr(Name, " of ");
6857 if (dummy[i-1] == 's')
6859 strcpy(&(dummy[i]), "es");
6864 strcpy(&(dummy[i]), "s");
6867 strcpy(&(dummy[i+1]), aider);
6868 strcpy(Name, dummy);
6870 else if (strstr(Name, "coins"))
6873 strcpy(dummy, "piles of ");
6874 strcat(dummy, Name);
6875 strcpy(Name, dummy);
6878 else if (strstr(Name, "Manes"))
6882 else if (streq(&(Name[NameLen - 2]), "ey"))
6884 strcpy(&(Name[NameLen - 2]), "eys");
6886 else if (Name[NameLen - 1] == 'y')
6888 strcpy(&(Name[NameLen - 1]), "ies");
6890 else if (streq(&(Name[NameLen - 4]), "ouse"))
6892 strcpy(&(Name[NameLen - 4]), "ice");
6894 else if (streq(&(Name[NameLen - 2]), "us"))
6896 strcpy(&(Name[NameLen - 2]), "i");
6898 else if (streq(&(Name[NameLen - 6]), "kelman"))
6900 strcpy(&(Name[NameLen - 6]), "kelmen");
6902 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6904 strcpy(&(Name[NameLen - 8]), "wordsmen");
6906 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6908 strcpy(&(Name[NameLen - 7]), "oodsmen");
6910 else if (streq(&(Name[NameLen - 7]), "eastman"))
6912 strcpy(&(Name[NameLen - 7]), "eastmen");
6914 else if (streq(&(Name[NameLen - 8]), "izardman"))
6916 strcpy(&(Name[NameLen - 8]), "izardmen");
6918 else if (streq(&(Name[NameLen - 5]), "geist"))
6920 strcpy(&(Name[NameLen - 5]), "geister");
6922 else if (streq(&(Name[NameLen - 2]), "ex"))
6924 strcpy(&(Name[NameLen - 2]), "ices");
6926 else if (streq(&(Name[NameLen - 2]), "lf"))
6928 strcpy(&(Name[NameLen - 2]), "lves");
6930 else if (suffix(Name, "ch") ||
6931 suffix(Name, "sh") ||
6932 suffix(Name, "nx") ||
6933 suffix(Name, "s") ||
6936 strcpy(&(Name[NameLen]), "es");
6940 strcpy(&(Name[NameLen]), "s");
6945 * Display current pets
6947 static void do_cmd_knowledge_pets(void)
6951 monster_type *m_ptr;
6953 int show_upkeep = 0;
6954 char file_name[1024];
6957 /* Open a new file */
6958 fff = my_fopen_temp(file_name, 1024);
6961 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6963 msg_format("Failed to create temporary file %s.", file_name);
6969 /* Process the monsters (backwards) */
6970 for (i = m_max - 1; i >= 1; i--)
6972 monster_race *r_ptr;
6973 /* Access the monster */
6976 /* Ignore "dead" monsters */
6977 if (!m_ptr->r_idx) continue;
6978 r_ptr = &r_info[m_ptr->r_idx];
6980 /* Calculate "upkeep" for pets */
6985 monster_desc(pet_name, m_ptr, 0x88);
6986 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i, 0x00));
6987 if (p_ptr->riding == i)
6989 fprintf(fff, " ¾èÇÏÃæ");
6991 fprintf(fff, " Riding");
6997 show_upkeep = calculate_upkeep();
6999 fprintf(fff, "----------------------------------------------\n");
7001 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
7002 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
7004 fprintf(fff, " Total: %d pet%s.\n",
7005 t_friends, (t_friends == 1 ? "" : "s"));
7006 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
7011 /* Close the file */
7014 /* Display the file contents */
7016 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
7018 show_file(TRUE, file_name, "Current Pets", 0, 0);
7022 /* Remove the file */
7030 * Note that the player ghosts are ignored. XXX XXX XXX
7032 static void do_cmd_knowledge_kill_count(void)
7040 char file_name[1024];
7045 /* Open a new file */
7046 fff = my_fopen_temp(file_name, 1024);
7050 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7052 msg_format("Failed to create temporary file %s.", file_name);
7058 /* Allocate the "who" array */
7059 C_MAKE(who, max_r_idx, s16b);
7062 /* Monsters slain */
7065 for (kk = 1; kk < max_r_idx; kk++)
7067 monster_race *r_ptr = &r_info[kk];
7069 if (r_ptr->flags1 & (RF1_UNIQUE))
7071 bool dead = (r_ptr->max_num == 0);
7080 s16b This = r_ptr->r_pkills;
7091 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
7093 fprintf(fff,"You have defeated no enemies yet.\n\n");
7096 else if (Total == 1)
7098 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
7100 fprintf(fff,"You have defeated one enemy.\n\n");
7105 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
7107 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
7114 /* Scan the monsters */
7115 for (i = 1; i < max_r_idx; i++)
7117 monster_race *r_ptr = &r_info[i];
7119 /* Use that monster */
7120 if (r_ptr->name) who[n++] = i;
7123 /* Select the sort method */
7124 ang_sort_comp = ang_sort_comp_hook;
7125 ang_sort_swap = ang_sort_swap_hook;
7127 /* Sort the array by dungeon depth of monsters */
7128 ang_sort(who, &why, n);
7130 /* Scan the monster races */
7131 for (k = 0; k < n; k++)
7133 monster_race *r_ptr = &r_info[who[k]];
7135 if (r_ptr->flags1 & (RF1_UNIQUE))
7137 bool dead = (r_ptr->max_num == 0);
7141 /* Print a message */
7142 fprintf(fff, " %s\n",
7143 (r_name + r_ptr->name));
7149 s16b This = r_ptr->r_pkills;
7154 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
7155 if(strchr("pt",r_ptr->d_char))
7156 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
7158 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
7162 if (strstr(r_name + r_ptr->name, "coins"))
7164 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
7168 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
7174 strcpy(ToPlural, (r_name + r_ptr->name));
7175 plural_aux(ToPlural);
7176 fprintf(fff, " %d %s\n", This, ToPlural);
7186 fprintf(fff,"----------------------------------------------\n");
7188 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
7190 fprintf(fff," Total: %lu creature%s killed.\n",
7191 Total, (Total == 1 ? "" : "s"));
7195 /* Free the "who" array */
7196 C_KILL(who, max_r_idx, s16b);
7198 /* Close the file */
7201 /* Display the file contents */
7203 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
7205 show_file(TRUE, file_name, "Kill Count", 0, 0);
7209 /* Remove the file */
7216 * Display the object groups.
7218 static void display_group_list(int col, int row, int wid, int per_page,
7219 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
7223 /* Display lines until done */
7224 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
7226 /* Get the group index */
7227 int grp = grp_idx[grp_top + i];
7229 /* Choose a color */
7230 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
7232 /* Erase the entire line */
7233 Term_erase(col, row + i, wid);
7235 /* Display the group label */
7236 c_put_str(attr, group_text[grp], row + i, col);
7243 * Move the cursor in a browser window
7245 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
7246 int *list_cur, int list_cnt)
7251 int list = *list_cur;
7253 /* Extract direction */
7256 /* Hack -- scroll up full screen */
7261 /* Hack -- scroll down full screen */
7266 d = get_keymap_dir(ch);
7271 /* Diagonals - hack */
7272 if ((ddx[d] > 0) && ddy[d])
7274 /* Browse group list */
7279 /* Move up or down */
7280 grp += ddy[d] * (BROWSER_ROWS - 1);
7283 if (grp >= grp_cnt) grp = grp_cnt - 1;
7284 if (grp < 0) grp = 0;
7285 if (grp != old_grp) list = 0;
7288 /* Browse sub-list list */
7291 /* Move up or down */
7292 list += ddy[d] * BROWSER_ROWS;
7295 if (list >= list_cnt) list = list_cnt - 1;
7296 if (list < 0) list = 0;
7308 if (col < 0) col = 0;
7309 if (col > 1) col = 1;
7316 /* Browse group list */
7321 /* Move up or down */
7325 if (grp >= grp_cnt) grp = grp_cnt - 1;
7326 if (grp < 0) grp = 0;
7327 if (grp != old_grp) list = 0;
7330 /* Browse sub-list list */
7333 /* Move up or down */
7337 if (list >= list_cnt) list = list_cnt - 1;
7338 if (list < 0) list = 0;
7348 * Display the monsters in a group.
7350 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
7351 int mon_cur, int mon_top)
7355 /* Display lines until done */
7356 for (i = 0; i < per_page && mon_idx[i]; i++)
7360 /* Get the race index */
7361 int r_idx = mon_idx[mon_top + i] ;
7363 /* Access the race */
7364 monster_race *r_ptr = &r_info[r_idx];
7366 /* Is this a unique? */
7367 bool unique = (bool)(r_ptr->flags1 & (RF1_UNIQUE)) ;
7369 /* Choose a color */
7370 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
7372 /* Display the name */
7373 c_prt(attr, (r_name + r_ptr->name), row + i, col);
7377 c_prt(attr, format ("%d", r_idx), row + i, 60);
7380 /* Display symbol */
7381 Term_putch(70, row + i, r_ptr->x_attr, r_ptr->x_char);
7384 if (!unique) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
7386 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 73);
7388 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "dead" : "alive"), row + i, 73);
7393 /* Clear remaining lines */
7394 for (; i < per_page; i++)
7396 Term_erase(col, row + i, 255);
7401 * Display known monsters.
7403 static void do_cmd_knowledge_monsters(void)
7406 int grp_cur, grp_top;
7407 int mon_cur, mon_top;
7408 int grp_cnt, grp_idx[100];
7416 /* Allocate the "mon_idx" array */
7417 C_MAKE(mon_idx, max_r_idx, s16b);
7422 /* Check every group */
7423 for (i = 0; monster_group_text[i] != NULL; i++)
7425 /* Measure the label */
7426 len = strlen(monster_group_text[i]);
7428 /* Save the maximum length */
7429 if (len > max) max = len;
7431 /* See if any monsters are known */
7432 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, 0x01))
7434 /* Build a list of groups with known monsters */
7435 grp_idx[grp_cnt++] = i;
7439 /* Terminate the list */
7440 grp_idx[grp_cnt] = -1;
7442 grp_cur = grp_top = 0;
7443 mon_cur = mon_top = 0;
7457 prt("Ãμ± - ¥â¥ó¥¹¥¿¡¼", 2, 0);
7458 prt("¥°¥ë¡¼¥×", 4, 0);
7459 prt("̾Á°", 4, max + 3);
7460 if (p_ptr->wizard) prt("Idx", 4, 60);
7461 prt("ʸ»ú »¦³²¿ô", 4, 67);
7463 prt("Knowledge - Monsters", 2, 0);
7465 prt("Name", 4, max + 3);
7466 if (p_ptr->wizard) prt("Idx", 4, 60);
7467 prt("Sym Kills", 4, 67);
7470 for (i = 0; i < 78; i++)
7472 Term_putch(i, 5, TERM_WHITE, '=');
7475 for (i = 0; i < BROWSER_ROWS; i++)
7477 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7483 /* Scroll group list */
7484 if (grp_cur < grp_top) grp_top = grp_cur;
7485 if (grp_cur >= grp_top + BROWSER_ROWS) grp_top = grp_cur - BROWSER_ROWS + 1;
7487 /* Display a list of monster groups */
7488 display_group_list(0, 6, max, BROWSER_ROWS, grp_idx, monster_group_text, grp_cur, grp_top);
7490 /* Get a list of monsters in the current group */
7491 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, 0x00);
7493 /* Scroll monster list */
7494 while (mon_cur < mon_top)
7495 mon_top = MAX(0, mon_top - BROWSER_ROWS/2);
7496 while (mon_cur >= mon_top + BROWSER_ROWS)
7497 mon_top = MIN(mon_cnt - BROWSER_ROWS, mon_top + BROWSER_ROWS/2);
7499 /* Display a list of monsters in the current group */
7500 display_monster_list(max + 3, 6, BROWSER_ROWS, mon_idx, mon_cur, mon_top);
7504 prt("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë, ESC", 23, 0);
7506 prt("<dir>, 'r' to recall, ESC", 23, 0);
7509 /* Mega Hack -- track this monster race */
7510 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
7512 /* Hack -- handle stuff */
7517 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7521 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
7537 /* Recall on screen */
7538 if (mon_idx[mon_cur])
7540 screen_roff(mon_idx[mon_cur], 0);
7551 /* Move the cursor */
7552 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
7559 /* XXX XXX Free the "mon_idx" array */
7560 C_KILL(mon_idx, max_r_idx, s16b);
7566 * Display the objects in a group.
7568 static void display_object_list(int col, int row, int per_page, int object_idx[],
7569 int object_cur, int object_top)
7573 /* Display lines until done */
7574 for (i = 0; i < per_page && object_idx[i]; i++)
7576 /* Get the object index */
7577 int k_idx = object_idx[object_top + i];
7579 /* Access the object */
7580 object_kind *k_ptr = &k_info[k_idx];
7582 /* Choose a color */
7583 byte attr = ((k_ptr->aware) ? TERM_WHITE : TERM_SLATE);
7584 byte cursor = ((k_ptr->aware) ? TERM_L_BLUE : TERM_BLUE);
7585 attr = ((i + object_top == object_cur) ? cursor : attr);
7587 /* Display the name */
7588 c_prt(attr, k_name + k_ptr->name, row + i, col);
7590 if (p_ptr->wizard) c_prt(attr, format ("%d", k_idx), row + i, 70);
7594 byte a = misc_to_attr[k_ptr->flavor];
7595 byte c = misc_to_char[k_ptr->flavor];
7597 /* Display symbol */
7598 Term_putch(76, row + i, a, c);
7602 /* Clear remaining lines */
7603 for (; i < per_page; i++)
7605 Term_erase(col, row + i, 255);
7610 * Describe fake object
7612 static void desc_obj_fake(int k_idx)
7615 object_type object_type_body;
7617 /* Get local object */
7618 o_ptr = &object_type_body;
7620 /* Wipe the object */
7623 /* Create the artifact */
7624 object_prep(o_ptr, k_idx);
7626 /* It's fully know */
7627 o_ptr->ident |= IDENT_KNOWN;
7629 /* Track the object */
7630 /* object_actual_track(o_ptr); */
7632 /* Hack - mark as fake */
7633 /* term_obj_real = FALSE; */
7635 /* Hack -- Handle stuff */
7638 if (!screen_object(o_ptr, FALSE))
7641 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
7643 msg_print("You see nothing special.");
7651 * Display known objects
7653 static void do_cmd_knowledge_objects(void)
7656 int grp_cur, grp_top;
7657 int object_old, object_cur, object_top;
7658 int grp_cnt, grp_idx[100];
7666 /* Allocate the "object_idx" array */
7667 C_MAKE(object_idx, max_k_idx, int);
7672 /* Check every group */
7673 for (i = 0; object_group_text[i] != NULL; i++)
7675 /* Measure the label */
7676 len = strlen(object_group_text[i]);
7678 /* Save the maximum length */
7679 if (len > max) max = len;
7681 /* See if any monsters are known */
7682 if (collect_objects(i, object_idx))
7684 /* Build a list of groups with known monsters */
7685 grp_idx[grp_cnt++] = i;
7689 /* Terminate the list */
7690 grp_idx[grp_cnt] = -1;
7692 grp_cur = grp_top = 0;
7693 object_cur = object_top = 0;
7708 prt("Ãμ± - ¥¢¥¤¥Æ¥à", 2, 0);
7709 prt("¥°¥ë¡¼¥×", 4, 0);
7710 prt("̾Á°", 4, max + 3);
7711 if (p_ptr->wizard) prt("Idx", 4, 70);
7714 prt("Knowledge - objects", 2, 0);
7716 prt("Name", 4, max + 3);
7717 if (p_ptr->wizard) prt("Idx", 4, 70);
7721 for (i = 0; i < 78; i++)
7723 Term_putch(i, 5, TERM_WHITE, '=');
7726 for (i = 0; i < BROWSER_ROWS; i++)
7728 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7734 /* Scroll group list */
7735 if (grp_cur < grp_top) grp_top = grp_cur;
7736 if (grp_cur >= grp_top + BROWSER_ROWS) grp_top = grp_cur - BROWSER_ROWS + 1;
7738 /* Display a list of object groups */
7739 display_group_list(0, 6, max, BROWSER_ROWS, grp_idx, object_group_text, grp_cur, grp_top);
7741 /* Get a list of objects in the current group */
7742 object_cnt = collect_objects(grp_idx[grp_cur], object_idx);
7744 /* Scroll monster list */
7745 while (object_cur < object_top)
7746 object_top = MAX(0, object_top - BROWSER_ROWS/2);
7747 while (object_cur >= object_top + BROWSER_ROWS)
7748 object_top = MIN(object_cnt - BROWSER_ROWS, object_top + BROWSER_ROWS/2);
7750 /* Display a list of objects in the current group */
7751 display_object_list(max + 3, 6, BROWSER_ROWS, object_idx, object_cur, object_top);
7755 prt("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë, ESC", 23, 0);
7757 prt("<dir>, 'r' to recall, ESC", 23, 0);
7760 /* Mega Hack -- track this object */
7761 if (object_cnt) object_kind_track(object_idx[object_cur]);
7763 /* The "current" object changed */
7764 if (object_old != object_idx[object_cur])
7766 /* Hack -- handle stuff */
7769 /* Remember the "current" object */
7770 object_old = object_idx[object_cur];
7775 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7779 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
7795 /* Recall on screen */
7797 desc_obj_fake(object_idx[object_cur]);
7805 /* Move the cursor */
7806 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
7812 /* XXX XXX Free the "object_idx" array */
7813 C_KILL(object_idx, max_k_idx, int);
7819 * List virtues & status
7822 static void do_cmd_knowledge_kubi(void)
7827 char file_name[1024];
7830 /* Open a new file */
7831 fff = my_fopen_temp(file_name, 1024);
7834 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7836 msg_format("Failed to create temporary file %s.", file_name);
7845 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
7847 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
7849 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
7851 fprintf(fff, "List of wanted monsters\n");
7853 for (i = 0; i < MAX_KUBI; i++)
7855 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
7856 if (kubi_r_idx[i] > 10000)
7858 fprintf(fff, "ºÑ\n");
7860 fprintf(fff, "done\n");
7863 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
7867 /* Close the file */
7870 /* Display the file contents */
7872 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
7874 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
7878 /* Remove the file */
7883 * List virtues & status
7886 static void do_cmd_knowledge_virtues(void)
7890 char file_name[1024];
7893 /* Open a new file */
7894 fff = my_fopen_temp(file_name, 1024);
7897 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7899 msg_format("Failed to create temporary file %s.", file_name);
7908 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
7910 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
7915 /* Close the file */
7918 /* Display the file contents */
7920 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
7922 show_file(TRUE, file_name, "Virtues", 0, 0);
7926 /* Remove the file */
7934 static void do_cmd_knowledge_dungeon(void)
7938 char file_name[1024];
7942 /* Open a new file */
7943 fff = my_fopen_temp(file_name, 1024);
7946 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7948 msg_format("Failed to create temporary file %s.", file_name);
7956 for (i = 1; i < max_d_idx; i++)
7960 if (!d_info[i].maxdepth) continue;
7961 if (!max_dlv[i]) continue;
7962 if (d_info[i].final_guardian)
7964 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
7966 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
7968 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
7970 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
7975 /* Close the file */
7978 /* Display the file contents */
7980 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
7982 show_file(TRUE, file_name, "Dungeon", 0, 0);
7986 /* Remove the file */
7991 * List virtues & status
7994 static void do_cmd_knowledge_stat(void)
7998 char file_name[1024];
8001 /* Open a new file */
8002 fff = my_fopen_temp(file_name, 1024);
8005 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8007 msg_format("Failed to create temporary file %s.", file_name);
8015 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
8016 (2 * p_ptr->hitdie +
8017 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
8020 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
8021 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
8022 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
8024 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
8025 else fprintf(fff, "Your current Life Rating is ???.\n\n");
8026 fprintf(fff, "Limits of maximum stats\n\n");
8028 for (v_nr = 0; v_nr < 6; v_nr++)
8030 if ((p_ptr->knowledge & KNOW_STAT) || p_ptr->stat_max[v_nr] == p_ptr->stat_max_max[v_nr]) fprintf(fff, "%s 18/%d\n", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18);
8031 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
8037 /* Close the file */
8040 /* Display the file contents */
8042 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
8044 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
8048 /* Remove the file */
8053 * Print quest status of all active quests
8055 static void do_cmd_knowledge_quests(void)
8058 char file_name[1024];
8060 char rand_tmp_str[120] = "\0";
8062 monster_race *r_ptr;
8064 int rand_level = 100;
8067 /* Open a new file */
8068 fff = my_fopen_temp(file_name, 1024);
8071 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8073 msg_format("Failed to create temporary file %s.", file_name);
8080 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
8082 fprintf(fff, "< Current Quest >\n");
8085 for (i = 1; i < max_quests; i++)
8087 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
8092 /* Clear the text */
8093 for (j = 0; j < 10; j++)
8095 quest_text[j][0] = '\0';
8098 quest_text_line = 0;
8100 /* Set the quest number temporary */
8101 old_quest = p_ptr->inside_quest;
8102 p_ptr->inside_quest = i;
8104 /* Get the quest text */
8105 init_flags = INIT_SHOW_TEXT;
8107 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8109 /* Reset the old quest number */
8110 p_ptr->inside_quest = old_quest;
8112 /* No info from "silent" quests */
8113 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8117 if (quest[i].type != QUEST_TYPE_RANDOM)
8119 char note[80] = "\0";
8121 if (quest[i].status == QUEST_STATUS_TAKEN)
8123 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
8125 r_ptr = &r_info[quest[i].r_idx];
8126 strcpy(name, r_name + r_ptr->name);
8127 if (quest[i].max_num > 1)
8130 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8133 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
8138 sprintf(note," - %s¤òÅݤ¹¡£",name);
8140 sprintf(note," - kill %s.",name);
8143 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
8146 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
8148 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
8151 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
8153 strcpy(name, a_name + a_info[quest[i].k_idx].name);
8155 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
8157 sprintf(note," - Find out %s.", name);
8160 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
8162 sprintf(note," - õº÷¤¹¤ë¡£");
8164 sprintf(note," - Search.");
8166 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
8168 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
8170 sprintf(note," - Kill all monsters.");
8174 /* Print the quest info */
8176 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
8178 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
8181 quest[i].name, quest[i].level, note);
8183 fprintf(fff, tmp_str);
8185 if (quest[i].status == QUEST_STATUS_COMPLETED)
8188 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
8190 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
8194 fprintf(fff, tmp_str);
8200 while (quest_text[j][0] && j < 10)
8202 fprintf(fff, " %s\n", quest_text[j]);
8207 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
8208 (quest[i].level < rand_level))
8211 rand_level = quest[i].level;
8213 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
8215 /* Print the quest info */
8216 r_ptr = &r_info[quest[i].r_idx];
8217 strcpy(name, r_name + r_ptr->name);
8219 if (quest[i].max_num > 1)
8222 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
8223 quest[i].name, quest[i].level,
8224 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8228 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
8229 quest[i].name, quest[i].level,
8230 quest[i].max_num, name, quest[i].cur_num);
8237 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
8239 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
8242 quest[i].name, quest[i].level, name);
8249 /* Print the current random quest */
8250 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
8253 if (!total) fprintf(fff, "¤Ê¤·\n");
8255 if (!total) fprintf(fff, "Nothing.\n");
8259 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8261 fprintf(fff, "\n< Completed Quest >\n");
8264 for (i = 1; i < max_quests; i++)
8266 if (quest[i].status == QUEST_STATUS_FINISHED)
8268 if (i < MIN_RANDOM_QUEST)
8272 /* Set the quest number temporary */
8273 old_quest = p_ptr->inside_quest;
8274 p_ptr->inside_quest = i;
8277 init_flags = INIT_ASSIGN;
8279 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8281 /* Reset the old quest number */
8282 p_ptr->inside_quest = old_quest;
8284 /* No info from "silent" quests */
8285 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8290 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8292 /* Print the quest info */
8294 if (quest[i].complev == 0)
8298 "%s (%d³¬) - ÉÔÀᄀ\n",
8300 "%s (Dungeon level: %d) - (Cancelled)\n",
8302 r_name+r_info[quest[i].r_idx].name,
8309 "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8311 "%s (Dungeon level: %d) - level %d\n",
8313 r_name+r_info[quest[i].r_idx].name,
8320 /* Print the quest info */
8322 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8324 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8327 quest[i].name, quest[i].level, quest[i].complev);
8330 fprintf(fff, tmp_str);
8334 if (!total) fprintf(fff, "¤Ê¤·\n");
8336 if (!total) fprintf(fff, "Nothing.\n");
8340 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8342 fprintf(fff, "\n< Failed Quest >\n");
8345 for (i = 1; i < max_quests; i++)
8347 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
8349 if (i < MIN_RANDOM_QUEST)
8353 /* Set the quest number temporary */
8354 old_quest = p_ptr->inside_quest;
8355 p_ptr->inside_quest = i;
8357 /* Get the quest text */
8358 init_flags = INIT_ASSIGN;
8360 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8362 /* Reset the old quest number */
8363 p_ptr->inside_quest = old_quest;
8365 /* No info from "silent" quests */
8366 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8371 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8373 /* Print the quest info */
8375 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8377 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
8380 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
8384 /* Print the quest info */
8386 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8388 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8391 quest[i].name, quest[i].level, quest[i].complev);
8393 fprintf(fff, tmp_str);
8397 if (!total) fprintf(fff, "¤Ê¤·\n");
8399 if (!total) fprintf(fff, "Nothing.\n");
8402 if (p_ptr->wizard) {
8404 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
8406 fprintf(fff, "\n< Remaining Random Quest >\n");
8409 for (i = 1; i < max_quests; i++)
8411 /* No info from "silent" quests */
8412 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8414 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
8418 /* Print the quest info */
8420 sprintf(tmp_str, "%s (%d³¬, %s)\n",
8422 sprintf(tmp_str, "%s (%d, %s)\n",
8425 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8426 fprintf(fff, tmp_str);
8430 if (!total) fprintf(fff, "¤Ê¤·\n");
8432 if (!total) fprintf(fff, "Nothing.\n");
8436 /* Close the file */
8439 /* Display the file contents */
8441 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
8443 show_file(TRUE, file_name, "Quest status", 0, 0);
8447 /* Remove the file */
8457 static void do_cmd_knowledge_home(void)
8462 char file_name[1024];
8464 char o_name[MAX_NLEN];
8467 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
8469 /* Open a new file */
8470 fff = my_fopen_temp(file_name, 1024);
8473 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8475 msg_format("Failed to create temporary file %s.", file_name);
8483 /* Print all homes in the different towns */
8484 st_ptr = &town[1].store[STORE_HOME];
8486 /* Home -- if anything there */
8487 if (st_ptr->stock_num)
8489 /* Header with name of the town */
8491 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
8493 fprintf(fff, " [Home Inventory]\n");
8497 /* Dump all available items */
8498 for (i = 0; i < st_ptr->stock_num; i++)
8501 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
8502 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
8503 if (strlen(o_name) <= 80-3)
8505 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8511 for (n = 0, t = o_name; n < 80-3; n++, t++)
8512 if(iskanji(*t)) {t++; n++;}
8513 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
8515 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
8516 fprintf(fff, " %.77s\n", o_name+n);
8519 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
8520 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8525 /* Add an empty line */
8526 fprintf(fff, "\n\n");
8530 /* Close the file */
8533 /* Display the file contents */
8535 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
8537 show_file(TRUE, file_name, "Home Inventory", 0, 0);
8541 /* Remove the file */
8547 * Check the status of "autopick"
8549 static void do_cmd_knowledge_autopick(void)
8553 char file_name[1024];
8555 /* Open a new file */
8556 fff = my_fopen_temp(file_name, 1024);
8561 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8563 msg_format("Failed to create temporary file %s.", file_name);
8572 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
8574 fprintf(fff, "No preference for auto picker/destroyer.");
8580 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
8582 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
8586 for (k = 0; k < max_autopick; k++)
8589 byte act = autopick_list[k].action;
8590 if (act & DONT_AUTOPICK)
8598 else if (act & DO_AUTODESTROY)
8606 else if (act & DO_AUTOPICK)
8614 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
8623 if (act & DO_DISPLAY)
8624 fprintf(fff, "%11s", format("[%s]", tmp));
8626 fprintf(fff, "%11s", format("(%s)", tmp));
8628 tmp = autopick_line_from_entry(&autopick_list[k]);
8629 fprintf(fff, " %s", tmp);
8633 /* Close the file */
8635 /* Display the file contents */
8637 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
8639 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
8642 /* Remove the file */
8648 * Interact with "knowledge"
8650 void do_cmd_knowledge(void)
8653 /* File type is "TEXT" */
8654 FILE_TYPE(FILE_TYPE_TEXT);
8655 /* Save the screen */
8657 /* Interact until done */
8662 /* Ask for a choice */
8664 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
8665 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
8667 prt(format("page %d/2", (p+1)), 2, 65);
8668 prt("Display current knowledge", 3, 0);
8671 /* Give some choices */
8674 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
8675 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
8676 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
8677 prt("(4) ´ûÃΤΥâ¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
8678 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
8679 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
8680 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
8681 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
8682 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
8684 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
8685 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
8686 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
8687 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
8688 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
8689 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
8690 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
8691 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
8692 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
8696 prt("(1) Display known artifacts", 6, 5);
8697 prt("(2) Display known objects", 7, 5);
8698 prt("(3) Display remaining uniques", 8, 5);
8699 prt("(4) Display known monster", 9, 5);
8700 prt("(5) Display kill count", 10, 5);
8701 prt("(6) Display wanted monsters", 11, 5);
8702 prt("(7) Display current pets", 12, 5);
8703 prt("(8) Display home inventory", 13, 5);
8704 prt("(9) Display *identified* equip.", 14, 5);
8706 prt("(a) Display about yourself", 6, 5);
8707 prt("(b) Display mutations", 7, 5);
8708 prt("(c) Display weapon proficiency", 8, 5);
8709 prt("(d) Display spell proficiency", 9, 5);
8710 prt("(e) Display misc. proficiency", 10, 5);
8711 prt("(f) Display virtues", 11, 5);
8712 prt("(g) Display dungeons", 12, 5);
8713 prt("(h) Display current quests", 13, 5);
8714 prt("(i) Display auto pick/destroy", 14, 5);
8719 prt("-³¤¯-", 16, 8);
8720 prt("ESC) È´¤±¤ë", 21, 1);
8721 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
8722 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
8723 prt("¥³¥Þ¥ó¥É:", 20, 0);
8725 prt("-more-", 16, 8);
8726 prt("ESC) Exit menu", 21, 1);
8727 prt("SPACE) Next page", 21, 30);
8728 /*prt("-) Previous page", 21, 60);*/
8729 prt("Command: ", 20, 0);
8735 if (i == ESCAPE) break;
8738 case ' ': /* Page change */
8742 case '1': /* Artifacts */
8743 do_cmd_knowledge_artifacts();
8745 case '2': /* Objects */
8746 do_cmd_knowledge_objects();
8748 case '3': /* Uniques */
8749 do_cmd_knowledge_uniques();
8751 case '4': /* Monsters */
8752 do_cmd_knowledge_monsters();
8754 case '5': /* Kill count */
8755 do_cmd_knowledge_kill_count();
8757 case '6': /* wanted */
8758 do_cmd_knowledge_kubi();
8760 case '7': /* Pets */
8761 do_cmd_knowledge_pets();
8763 case '8': /* Home */
8764 do_cmd_knowledge_home();
8766 case '9': /* Resist list */
8767 do_cmd_knowledge_inven();
8770 case 'a': /* Max stat */
8771 do_cmd_knowledge_stat();
8773 case 'b': /* Mutations */
8774 do_cmd_knowledge_mutations();
8776 case 'c': /* weapon-exp */
8777 do_cmd_knowledge_weapon_exp();
8779 case 'd': /* spell-exp */
8780 do_cmd_knowledge_spell_exp();
8782 case 'e': /* skill-exp */
8783 do_cmd_knowledge_skill_exp();
8785 case 'f': /* Virtues */
8786 do_cmd_knowledge_virtues();
8788 case 'g': /* Dungeon */
8789 do_cmd_knowledge_dungeon();
8791 case 'h': /* Quests */
8792 do_cmd_knowledge_quests();
8794 case 'i': /* Autopick */
8795 do_cmd_knowledge_autopick();
8797 default: /* Unknown option */
8800 /* Flush messages */
8803 /* Restore the screen */
8809 * Check on the status of an active quest
8811 void do_cmd_checkquest(void)
8813 /* File type is "TEXT" */
8814 FILE_TYPE(FILE_TYPE_TEXT);
8816 /* Save the screen */
8820 do_cmd_knowledge_quests();
8822 /* Restore the screen */
8828 * Display the time and date
8830 void do_cmd_time(void)
8832 int day, hour, min, full, start, end, num;
8839 extract_day_hour_min(&day, &hour, &min);
8841 full = hour * 100 + min;
8849 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
8851 strcpy(desc, "It is a strange time.");
8857 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
8859 msg_format("This is day %d. The time is %d:%02d %s.",
8862 day, (hour % 12 == 0) ? 12 : (hour % 12),
8863 min, (hour < 12) ? "AM" : "PM");
8866 if (!randint0(10) || p_ptr->image)
8869 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
8871 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
8878 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
8880 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
8885 /* Open this file */
8886 fff = my_fopen(buf, "rt");
8891 /* Find this time */
8892 while (!my_fgets(fff, buf, sizeof(buf)))
8894 /* Ignore comments */
8895 if (!buf[0] || (buf[0] == '#')) continue;
8897 /* Ignore invalid lines */
8898 if (buf[1] != ':') continue;
8900 /* Process 'Start' */
8903 /* Extract the starting time */
8904 start = atoi(buf + 2);
8906 /* Assume valid for an hour */
8916 /* Extract the ending time */
8917 end = atoi(buf + 2);
8923 /* Ignore incorrect range */
8924 if ((start > full) || (full > end)) continue;
8926 /* Process 'Description' */
8931 /* Apply the randomizer */
8932 if (!randint0(num)) strcpy(desc, buf + 2);
8942 /* Close the file */