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 */
882 void do_cmd_nikki(void)
886 /* File type is "TEXT" */
887 FILE_TYPE(FILE_TYPE_TEXT);
889 /* Save the screen */
892 /* Interact until done */
898 /* Ask for a choice */
900 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
902 prt("[ Play Record ]", 2, 0);
906 /* Give some choices */
908 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
909 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
910 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
911 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
913 prt("(1) Display your record", 4, 5);
914 prt("(2) Add record", 5, 5);
915 prt("(3) Record item you last get/identify", 6, 5);
916 prt("(4) Delete your record", 7, 5);
922 prt("¥³¥Þ¥ó¥É:", 18, 0);
924 prt("Command: ", 18, 0);
932 if (i == ESCAPE) break;
946 do_cmd_erase_nikki();
948 default: /* Unknown option */
956 /* Restore the screen */
961 * Hack -- redraw the screen
963 * This command performs various low level updates, clears all the "extra"
964 * windows, does a total redraw of the main window, and requests all of the
965 * interesting updates and redraws that I can think of.
967 * This command is also used to "instantiate" the results of the user
968 * selecting various things, such as graphics mode, so it must call
969 * the "TERM_XTRA_REACT" hook before redrawing the windows.
971 void do_cmd_redraw(void)
978 /* Hack -- react to changes */
979 Term_xtra(TERM_XTRA_REACT, 0);
982 /* Combine and Reorder the pack (later) */
983 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
987 p_ptr->update |= (PU_TORCH);
990 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
992 /* Forget lite/view */
993 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
995 /* Update lite/view */
996 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
998 /* Update monsters */
999 p_ptr->update |= (PU_MONSTERS);
1001 /* Redraw everything */
1002 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1005 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1008 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1012 /* Hack -- update */
1015 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1018 /* Redraw every window */
1019 for (j = 0; j < 8; j++)
1022 if (!angband_term[j]) continue;
1025 Term_activate(angband_term[j]);
1040 * Hack -- change name
1042 void do_cmd_change_name(void)
1051 /* Save the screen */
1059 /* Display the player */
1060 display_player(mode);
1065 display_player(mode);
1070 Term_putstr(2, 23, -1, TERM_WHITE,
1071 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1073 Term_putstr(2, 23, -1, TERM_WHITE,
1074 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1082 if (c == ESCAPE) break;
1089 /* Process the player name */
1090 process_player_name(FALSE);
1096 sprintf(tmp, "%s.txt", player_base);
1098 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1100 if (get_string("File name: ", tmp, 80))
1104 if (tmp[0] && (tmp[0] != ' '))
1106 file_character(tmp, TRUE);
1123 /* Flush messages */
1127 /* Restore the screen */
1130 /* Redraw everything */
1131 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1138 * Recall the most recent message
1140 void do_cmd_message_one(void)
1142 /* Recall one message XXX XXX XXX */
1143 prt(format("> %s", message_str(0)), 0, 0);
1148 * Show previous messages to the user -BEN-
1150 * The screen format uses line 0 and 23 for headers and prompts,
1151 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1153 * This command shows you which commands you are viewing, and allows
1154 * you to "search" for strings in the recall.
1156 * Note that messages may be longer than 80 characters, but they are
1157 * displayed using "infinite" length, with a special sub-command to
1158 * "slide" the virtual display to the left or right.
1160 * Attempt to only hilite the matching portions of the string.
1162 void do_cmd_messages(int num_now)
1173 Term_get_size(&wid, &hgt);
1182 /* Total messages */
1185 /* Start on first message */
1188 /* Start at leftmost edge */
1191 /* Save the screen */
1194 /* Process requests until done */
1200 /* Dump up to 20 lines of messages */
1201 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1203 cptr msg = message_str(i+j);
1205 /* Apply horizontal scroll */
1206 msg = (strlen(msg) >= q) ? (msg + q) : "";
1208 /* Dump the messages, bottom to top */
1209 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1211 /* Hilite "shower" */
1216 /* Display matches */
1217 while ((str = strstr(str, shower)) != NULL)
1219 int len = strlen(shower);
1221 /* Display the match */
1222 Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
1230 /* Display header XXX XXX XXX */
1233 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1234 i, i+j-1, n, q), 0, 0);
1236 prt(format("Message Recall (%d-%d of %d), Offset %d",
1237 i, i+j-1, n, q), 0, 0);
1241 /* Display prompt (not very informative) */
1243 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1245 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1252 /* Exit on Escape */
1253 if (k == ESCAPE) break;
1255 /* Hack -- Save the old index */
1258 /* Horizontal scroll */
1262 q = (q >= 40) ? (q - 40) : 0;
1268 /* Horizontal scroll */
1278 /* Hack -- handle show */
1283 prt("¶¯Ä´: ", hgt - 1, 0);
1285 prt("Show: ", hgt - 1, 0);
1289 /* Get a "shower" string, or continue */
1290 if (!askfor_aux(shower, 80)) continue;
1296 /* Hack -- handle find */
1303 prt("¸¡º÷: ", hgt - 1, 0);
1305 prt("Find: ", hgt - 1, 0);
1309 /* Get a "finder" string, or continue */
1310 if (!askfor_aux(finder, 80)) continue;
1313 strcpy(shower, finder);
1316 for (z = i + 1; z < n; z++)
1318 cptr msg = message_str(z);
1321 if (strstr(msg, finder))
1332 /* Recall 1 older message */
1333 if ((k == '8') || (k == '\n') || (k == '\r'))
1335 /* Go newer if legal */
1336 if (i + 1 < n) i += 1;
1339 /* Recall 10 older messages */
1342 /* Go older if legal */
1343 if (i + 10 < n) i += 10;
1346 /* Recall 20 older messages */
1347 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1349 /* Go older if legal */
1350 if (i + 20 < n) i += 20;
1353 /* Recall 20 newer messages */
1354 if ((k == 'n') || (k == KTRL('N')))
1356 /* Go newer (if able) */
1357 i = (i >= 20) ? (i - 20) : 0;
1360 /* Recall 10 newer messages */
1363 /* Go newer (if able) */
1364 i = (i >= 20) ? (i - 20) : 0;
1367 /* Recall 1 newer messages */
1370 /* Go newer (if able) */
1371 i = (i >= 1) ? (i - 1) : 0;
1374 /* Hack -- Error of some kind */
1378 /* Restore the screen */
1385 * Number of cheating options
1392 static option_type cheat_info[CHEAT_MAX] =
1394 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1396 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1398 "cheat_peek", "Peek into object creation"
1402 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1404 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1406 "cheat_hear", "Peek into monster creation"
1410 { &cheat_room, FALSE, 255, 0x04, 0x00,
1412 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1414 "cheat_room", "Peek into dungeon creation"
1418 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1420 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë"
1422 "cheat_xtra", "Peek into something else"
1426 { &cheat_know, FALSE, 255, 0x10, 0x00,
1428 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë"
1430 "cheat_know", "Know complete monster info"
1434 { &cheat_live, FALSE, 255, 0x20, 0x00,
1436 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë"
1438 "cheat_live", "Allow player to avoid death"
1442 { &cheat_save, FALSE, 255, 0x40, 0x00,
1444 "cheat_save", "»à¤ó¤À»þ¥»¡¼¥Ö¤¹¤ë¤«³Îǧ¤¹¤ë"
1446 "cheat_save", "Ask for saving death"
1452 * Interact with some options for cheating
1454 static void do_cmd_options_cheat(cptr info)
1458 int i, k = 0, n = CHEAT_MAX;
1466 /* Interact with the player */
1471 /* Prompt XXX XXX XXX */
1473 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1475 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1481 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1482 prt(" << Ãí°Õ >>", 11, 0);
1483 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1484 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1485 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1487 /* Display the options */
1488 for (i = 0; i < n; i++)
1490 byte a = TERM_WHITE;
1492 /* Color current option */
1493 if (i == k) a = TERM_L_BLUE;
1495 /* Display the option text */
1496 sprintf(buf, "%-48s: %s (%s)",
1497 cheat_info[i].o_desc,
1499 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1501 (*cheat_info[i].o_var ? "yes" : "no "),
1504 cheat_info[i].o_text);
1505 c_prt(a, buf, i + 2, 0);
1508 /* Hilite current option */
1509 move_cursor(k + 2, 50);
1515 * HACK - Try to translate the key into a direction
1516 * to allow using the roguelike keys for navigation.
1518 dir = get_keymap_dir(ch);
1519 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1533 k = (n + k - 1) % n;
1552 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1554 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1556 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1557 (*cheat_info[k].o_var) = TRUE;
1566 (*cheat_info[k].o_var) = FALSE;
1574 strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text);
1576 strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text);
1578 /* Peruse the help file */
1579 (void)show_file(TRUE, buf, NULL, 0, 0);
1595 static option_type autosave_info[2] =
1597 { &autosave_l, FALSE, 255, 0x01, 0x00,
1599 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1601 "autosave_l", "Autosave when entering new levels" },
1605 { &autosave_t, FALSE, 255, 0x02, 0x00,
1607 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1609 "autosave_t", "Timed autosave" },
1615 static s16b toggle_frequency(s16b current)
1617 if (current == 0) return 50;
1618 if (current == 50) return 100;
1619 if (current == 100) return 250;
1620 if (current == 250) return 500;
1621 if (current == 500) return 1000;
1622 if (current == 1000) return 2500;
1623 if (current == 2500) return 5000;
1624 if (current == 5000) return 10000;
1625 if (current == 10000) return 25000;
1632 * Interact with some options for cheating
1634 static void do_cmd_options_autosave(cptr info)
1638 int i, k = 0, n = 2;
1646 /* Interact with the player */
1649 /* Prompt XXX XXX XXX */
1651 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1653 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1658 /* Display the options */
1659 for (i = 0; i < n; i++)
1661 byte a = TERM_WHITE;
1663 /* Color current option */
1664 if (i == k) a = TERM_L_BLUE;
1666 /* Display the option text */
1667 sprintf(buf, "%-48s: %s (%s)",
1668 autosave_info[i].o_desc,
1670 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1672 (*autosave_info[i].o_var ? "yes" : "no "),
1675 autosave_info[i].o_text);
1676 c_prt(a, buf, i + 2, 0);
1680 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1682 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1687 /* Hilite current option */
1688 move_cursor(k + 2, 50);
1704 k = (n + k - 1) % n;
1722 (*autosave_info[k].o_var) = TRUE;
1731 (*autosave_info[k].o_var) = FALSE;
1739 autosave_freq = toggle_frequency(autosave_freq);
1741 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1742 autosave_freq), 5, 0);
1744 prt(format("Timed autosave frequency: every %d turns",
1745 autosave_freq), 5, 0);
1753 (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0);
1755 (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0);
1773 #define PAGE_AUTODESTROY 7
1776 * Interact with some options
1778 void do_cmd_options_aux(int page, cptr info)
1781 int i, k = 0, n = 0, l;
1786 /* Lookup the options */
1787 for (i = 0; i < 24; i++) opt[i] = 0;
1789 /* Scan the options */
1790 for (i = 0; option_info[i].o_desc; i++)
1792 /* Notice options on this "page" */
1793 if (option_info[i].o_page == page) opt[n++] = i;
1800 /* Interact with the player */
1805 /* Prompt XXX XXX XXX */
1807 sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, y/n:Êѹ¹, ESC:½ªÎ», ?:¥Ø¥ë¥×) ", info);
1809 sprintf(buf, "%s (RET:next, y/n:change, ESC:accept, ?:help) ", info);
1815 /* HACK -- description for easy-auto-destroy options */
1817 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
1819 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
1822 /* Display the options */
1823 for (i = 0; i < n; i++)
1825 byte a = TERM_WHITE;
1827 /* Color current option */
1828 if (i == k) a = TERM_L_BLUE;
1830 /* Display the option text */
1831 sprintf(buf, "%-48s: %s (%.19s)",
1832 option_info[opt[i]].o_desc,
1834 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1836 (*option_info[opt[i]].o_var ? "yes" : "no "),
1839 option_info[opt[i]].o_text);
1840 if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1841 else c_prt(a, buf, i + 2, 0);
1844 if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3;
1847 /* Hilite current option */
1848 move_cursor(k + 2 + l, 50);
1854 * HACK - Try to translate the key into a direction
1855 * to allow using the roguelike keys for navigation.
1857 dir = get_keymap_dir(ch);
1858 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1872 k = (n + k - 1) % n;
1889 (*option_info[opt[k]].o_var) = TRUE;
1898 (*option_info[opt[k]].o_var) = FALSE;
1906 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1913 strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text);
1915 strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text);
1917 /* Peruse the help file */
1918 (void)show_file(TRUE, buf, NULL, 0, 0);
1935 * Modify the "window" options
1937 static void do_cmd_options_win(void)
1951 /* Memorize old flags */
1952 for (j = 0; j < 8; j++)
1954 /* Acquire current flags */
1955 old_flag[j] = window_flag[j];
1965 /* Prompt XXX XXX XXX */
1967 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1969 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1973 /* Display the windows */
1974 for (j = 0; j < 8; j++)
1976 byte a = TERM_WHITE;
1978 cptr s = angband_term_name[j];
1981 if (j == x) a = TERM_L_BLUE;
1983 /* Window name, staggered, centered */
1984 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1987 /* Display the options */
1988 for (i = 0; i < 16; i++)
1990 byte a = TERM_WHITE;
1992 cptr str = window_flag_desc[i];
1995 if (i == y) a = TERM_L_BLUE;
1999 if (!str) str = "(̤»ÈÍÑ)";
2001 if (!str) str = "(Unused option)";
2006 Term_putstr(0, i + 5, -1, a, str);
2008 /* Display the windows */
2009 for (j = 0; j < 8; j++)
2011 byte a = TERM_WHITE;
2016 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2019 if (window_flag[j] & (1L << i)) c = 'X';
2022 Term_putch(35 + j * 5, i + 5, a, c);
2027 Term_gotoxy(35 + x * 5, y + 5);
2045 for (j = 0; j < 8; j++)
2047 window_flag[j] &= ~(1L << y);
2051 for (i = 0; i < 16; i++)
2053 window_flag[x] &= ~(1L << i);
2066 window_flag[x] |= (1L << y);
2074 window_flag[x] &= ~(1L << y);
2081 (void)show_file(TRUE, "joption.txt#Window", NULL, 0, 0);
2083 (void)show_file(TRUE, "option.txt#Window", NULL, 0, 0);
2093 d = get_keymap_dir(ch);
2095 x = (x + ddx[d] + 8) % 8;
2096 y = (y + ddy[d] + 16) % 16;
2103 /* Notice changes */
2104 for (j = 0; j < 8; j++)
2109 if (!angband_term[j]) continue;
2111 /* Ignore non-changes */
2112 if (window_flag[j] == old_flag[j]) continue;
2115 Term_activate(angband_term[j]);
2132 * Set or unset various options.
2134 * The user must use the "Ctrl-R" command to "adapt" to changes
2135 * in any options which control "visual" aspects of the game.
2137 void do_cmd_options(void)
2142 /* Save the screen */
2151 /* Why are we here */
2153 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2155 prt("Options", 2, 0);
2159 /* Give some choices */
2161 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2162 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2163 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2164 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2165 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2166 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2167 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2168 /* Special choices */
2169 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2170 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2171 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2173 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2175 prt("(1) Input Options", 4, 5);
2176 prt("(2) Output Options", 5, 5);
2177 prt("(3) Game-Play Options", 6, 5);
2178 prt("(4) Disturbance Options", 7, 5);
2179 prt("(5) Efficiency Options", 8, 5);
2180 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2181 prt("(R) Play-record Options", 10, 5);
2183 /* Special choices */
2184 prt("(D) Base Delay Factor", 12, 5);
2185 prt("(H) Hitpoint Warning", 13, 5);
2186 prt("(A) Autosave Options", 14, 5);
2190 prt("(W) Window Flags", 15, 5);
2193 if (p_ptr->noscore || allow_debug_opts)
2197 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2199 prt("(C) Cheating Options", 16, 5);
2206 prt("¥³¥Þ¥ó¥É:", 18, 0);
2208 prt("Command: ", 18, 0);
2216 if (k == ESCAPE) break;
2221 /* General Options */
2224 /* Process the general options */
2226 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2228 do_cmd_options_aux(1, "Input Options");
2234 /* General Options */
2237 /* Process the general options */
2239 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2241 do_cmd_options_aux(2, "Output Options");
2247 /* Inventory Options */
2252 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2254 do_cmd_options_aux(3, "Game-Play Options");
2260 /* Disturbance Options */
2265 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2267 do_cmd_options_aux(4, "Disturbance Options");
2273 /* Efficiency Options */
2278 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2280 do_cmd_options_aux(5, "Efficiency Options");
2286 /* Object auto-destruction Options */
2291 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2293 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2298 /* Play-record Options */
2304 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2306 do_cmd_options_aux(10, "Play-record Option");
2311 /* Cheating Options */
2314 if (!p_ptr->noscore && !allow_debug_opts)
2316 /* Cheat options are not permitted */
2323 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2325 do_cmd_options_cheat("Cheaters never win");
2335 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2337 do_cmd_options_autosave("Autosave");
2348 do_cmd_options_win();
2349 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2350 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2351 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2352 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2356 /* Hack -- Delay Speed */
2362 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2364 prt("Command: Base Delay Factor", 18, 0);
2368 /* Get a new value */
2371 int msec = delay_factor * delay_factor * delay_factor;
2373 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2374 delay_factor, msec), 22, 0);
2376 prt(format("Current base delay factor: %d (%d msec)",
2377 delay_factor, msec), 22, 0);
2381 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2383 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2387 if (k == ESCAPE) break;
2391 (void)show_file(TRUE, "joption.txt#BaseDelay", NULL, 0, 0);
2393 (void)show_file(TRUE, "option.txt#BaseDelay", NULL, 0, 0);
2397 else if (isdigit(k)) delay_factor = D2I(k);
2404 /* Hack -- hitpoint warning factor */
2410 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2412 prt("Command: Hitpoint Warning", 18, 0);
2416 /* Get a new value */
2420 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2421 hitpoint_warn), 22, 0);
2423 prt(format("Current hitpoint warning: %d0%%",
2424 hitpoint_warn), 22, 0);
2428 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2430 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2434 if (k == ESCAPE) break;
2438 (void)show_file(TRUE, "joption.txt#Hitpoint", NULL, 0, 0);
2440 (void)show_file(TRUE, "option.txt#Hitpoint", NULL, 0, 0);
2444 else if (isdigit(k)) hitpoint_warn = D2I(k);
2453 (void)show_file(TRUE, "joption.txt", NULL, 0, 0);
2455 (void)show_file(TRUE, "option.txt", NULL, 0, 0);
2460 /* Unknown option */
2469 /* Flush messages */
2474 /* Restore the screen */
2477 /* Hack - Redraw equippy chars */
2478 p_ptr->redraw |= (PR_EQUIPPY);
2484 * Ask for a "user pref line" and process it
2486 * XXX XXX XXX Allow absolute file names?
2488 void do_cmd_pref(void)
2495 /* Ask for a "user pref command" */
2497 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2499 if (!get_string("Pref: ", buf, 80)) return;
2503 /* Process that pref command */
2504 (void)process_pref_file_command(buf);
2507 void do_cmd_pickpref(void)
2513 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2515 if(!get_check("Reload auto-pick preference file? ")) return;
2518 /* Free old entries */
2521 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2523 sprintf(buf, "picktype-%s.prf", player_name);
2525 sprintf(buf, "pickpref-%s.prf", player_name);
2527 err = process_pickpref_file(buf);
2532 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2534 msg_format("loaded '%s'.", buf);
2538 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2540 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2544 err = process_pickpref_file("picktype.prf");
2546 err = process_pickpref_file("pickpref.prf");
2552 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2554 msg_print("loaded 'pickpref.prf'.");
2561 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2563 if(err) msg_print("Failed to reload autopick preference.");
2570 * Hack -- append all current macros to the given file
2572 static errr macro_dump(cptr fname)
2574 static cptr mark = "Macro Dump";
2582 /* Build the filename */
2583 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2585 /* File type is "TEXT" */
2586 FILE_TYPE(FILE_TYPE_TEXT);
2588 /* Append to the file */
2589 fff = open_auto_dump(buf, mark, &line_num);
2590 if (!fff) return (-1);
2594 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2596 fprintf(fff, "\n# Automatic macro dump\n\n");
2601 for (i = 0; i < macro__num; i++)
2603 /* Extract the action */
2604 ascii_to_text(buf, macro__act[i]);
2606 /* Dump the macro */
2607 fprintf(fff, "A:%s\n", buf);
2609 /* Extract the action */
2610 ascii_to_text(buf, macro__pat[i]);
2612 /* Dump normal macros */
2613 fprintf(fff, "P:%s\n", buf);
2618 /* count number of lines */
2623 close_auto_dump(fff, mark, line_num);
2631 * Hack -- ask for a "trigger" (see below)
2633 * Note the complex use of the "inkey()" function from "util.c".
2635 * Note that both "flush()" calls are extremely important.
2637 static void do_cmd_macro_aux(char *buf)
2647 /* Do not process macros */
2653 /* Read the pattern */
2659 /* Do not process macros */
2662 /* Do not wait for keys */
2665 /* Attempt to read a key */
2676 /* Convert the trigger */
2677 ascii_to_text(tmp, buf);
2679 /* Hack -- display the trigger */
2680 Term_addstr(-1, TERM_WHITE, tmp);
2687 * Hack -- ask for a keymap "trigger" (see below)
2689 * Note that both "flush()" calls are extremely important. This may
2690 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2692 static void do_cmd_macro_aux_keymap(char *buf)
2706 /* Convert to ascii */
2707 ascii_to_text(tmp, buf);
2709 /* Hack -- display the trigger */
2710 Term_addstr(-1, TERM_WHITE, tmp);
2719 * Hack -- append all keymaps to the given file
2721 static errr keymap_dump(cptr fname)
2723 static cptr mark = "Keymap Dump";
2735 if (rogue_like_commands)
2737 mode = KEYMAP_MODE_ROGUE;
2743 mode = KEYMAP_MODE_ORIG;
2747 /* Build the filename */
2748 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2750 /* File type is "TEXT" */
2751 FILE_TYPE(FILE_TYPE_TEXT);
2753 /* Append to the file */
2754 fff = open_auto_dump(buf, mark, &line_num);
2755 if (!fff) return -1;
2759 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2761 fprintf(fff, "\n# Automatic keymap dump\n\n");
2766 for (i = 0; i < 256; i++)
2770 /* Loop up the keymap */
2771 act = keymap_act[mode][i];
2773 /* Skip empty keymaps */
2776 /* Encode the key */
2779 ascii_to_text(key, buf);
2781 /* Encode the action */
2782 ascii_to_text(buf, act);
2784 /* Dump the macro */
2785 fprintf(fff, "A:%s\n", buf);
2786 fprintf(fff, "C:%d:%s\n", mode, key);
2791 close_auto_dump(fff, mark, line_num);
2800 * Interact with "macros"
2802 * Note that the macro "action" must be defined before the trigger.
2804 * Could use some helpful instructions on this page. XXX XXX XXX
2806 void do_cmd_macros(void)
2818 if (rogue_like_commands)
2820 mode = KEYMAP_MODE_ROGUE;
2826 mode = KEYMAP_MODE_ORIG;
2829 /* File type is "TEXT" */
2830 FILE_TYPE(FILE_TYPE_TEXT);
2837 /* Process requests until done */
2845 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2847 prt("Interact with Macros", 2, 0);
2852 /* Describe that action */
2854 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2856 prt("Current action (if any) shown below:", 20, 0);
2860 /* Analyze the current action */
2861 ascii_to_text(buf, macro__buf);
2863 /* Display the current action */
2869 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2871 prt("(1) Load a user pref file", 4, 5);
2876 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2877 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2878 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2879 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2880 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2881 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2882 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2883 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2884 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2886 prt("(2) Append macros to a file", 5, 5);
2887 prt("(3) Query a macro", 6, 5);
2888 prt("(4) Create a macro", 7, 5);
2889 prt("(5) Remove a macro", 8, 5);
2890 prt("(6) Append keymaps to a file", 9, 5);
2891 prt("(7) Query a keymap", 10, 5);
2892 prt("(8) Create a keymap", 11, 5);
2893 prt("(9) Remove a keymap", 12, 5);
2894 prt("(0) Enter a new action", 13, 5);
2897 #endif /* ALLOW_MACROS */
2901 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2903 prt("Command: ", 16, 0);
2911 if (i == ESCAPE) break;
2913 /* Load a 'macro' file */
2920 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2922 prt("Command: Load a user pref file", 16, 0);
2928 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2930 prt("File: ", 18, 0);
2934 /* Default filename */
2935 sprintf(tmp, "%s.prf", player_name);
2937 /* Ask for a file */
2938 if (!askfor_aux(tmp, 80)) continue;
2940 /* Process the given filename */
2941 err = process_pref_file(tmp);
2945 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2947 msg_format("Loaded default '%s'.", tmp);
2954 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2956 msg_format("Failed to load '%s'!");
2962 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2964 msg_format("Loaded '%s'.", tmp);
2976 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2978 prt("Command: Append macros to a file", 16, 0);
2984 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2986 prt("File: ", 18, 0);
2990 /* Default filename */
2991 sprintf(tmp, "%s.prf", player_name);
2993 /* Ask for a file */
2994 if (!askfor_aux(tmp, 80)) continue;
2996 /* Dump the macros */
2997 (void)macro_dump(tmp);
3001 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3003 msg_print("Appended macros.");
3015 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
3017 prt("Command: Query a macro", 16, 0);
3023 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3025 prt("Trigger: ", 18, 0);
3029 /* Get a macro trigger */
3030 do_cmd_macro_aux(buf);
3032 /* Acquire action */
3033 k = macro_find_exact(buf);
3040 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3042 msg_print("Found no macro.");
3050 /* Obtain the action */
3051 strcpy(macro__buf, macro__act[k]);
3053 /* Analyze the current action */
3054 ascii_to_text(buf, macro__buf);
3056 /* Display the current action */
3061 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3063 msg_print("Found a macro.");
3069 /* Create a macro */
3074 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3076 prt("Command: Create a macro", 16, 0);
3082 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3084 prt("Trigger: ", 18, 0);
3088 /* Get a macro trigger */
3089 do_cmd_macro_aux(buf);
3096 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3098 prt("Action: ", 20, 0);
3102 /* Convert to text */
3103 ascii_to_text(tmp, macro__buf);
3105 /* Get an encoded action */
3106 if (askfor_aux(tmp, 80))
3108 /* Convert to ascii */
3109 text_to_ascii(macro__buf, tmp);
3111 /* Link the macro */
3112 macro_add(buf, macro__buf);
3116 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3118 msg_print("Added a macro.");
3124 /* Remove a macro */
3129 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3131 prt("Command: Remove a macro", 16, 0);
3137 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3139 prt("Trigger: ", 18, 0);
3143 /* Get a macro trigger */
3144 do_cmd_macro_aux(buf);
3146 /* Link the macro */
3147 macro_add(buf, buf);
3151 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3153 msg_print("Removed a macro.");
3163 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3165 prt("Command: Append keymaps to a file", 16, 0);
3171 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3173 prt("File: ", 18, 0);
3177 /* Default filename */
3178 sprintf(tmp, "%s.prf", player_name);
3180 /* Ask for a file */
3181 if (!askfor_aux(tmp, 80)) continue;
3183 /* Dump the macros */
3184 (void)keymap_dump(tmp);
3188 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3190 msg_print("Appended keymaps.");
3195 /* Query a keymap */
3202 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3204 prt("Command: Query a keymap", 16, 0);
3210 prt("²¡¤¹¥¡¼: ", 18, 0);
3212 prt("Keypress: ", 18, 0);
3216 /* Get a keymap trigger */
3217 do_cmd_macro_aux_keymap(buf);
3219 /* Look up the keymap */
3220 act = keymap_act[mode][(byte)(buf[0])];
3227 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3229 msg_print("Found no keymap.");
3237 /* Obtain the action */
3238 strcpy(macro__buf, act);
3240 /* Analyze the current action */
3241 ascii_to_text(buf, macro__buf);
3243 /* Display the current action */
3248 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3250 msg_print("Found a keymap.");
3256 /* Create a keymap */
3261 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3263 prt("Command: Create a keymap", 16, 0);
3269 prt("²¡¤¹¥¡¼: ", 18, 0);
3271 prt("Keypress: ", 18, 0);
3275 /* Get a keymap trigger */
3276 do_cmd_macro_aux_keymap(buf);
3283 prt("¹ÔÆ°: ", 20, 0);
3285 prt("Action: ", 20, 0);
3289 /* Convert to text */
3290 ascii_to_text(tmp, macro__buf);
3292 /* Get an encoded action */
3293 if (askfor_aux(tmp, 80))
3295 /* Convert to ascii */
3296 text_to_ascii(macro__buf, tmp);
3298 /* Free old keymap */
3299 string_free(keymap_act[mode][(byte)(buf[0])]);
3301 /* Make new keymap */
3302 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3306 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3308 msg_print("Added a keymap.");
3314 /* Remove a keymap */
3319 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3321 prt("Command: Remove a keymap", 16, 0);
3327 prt("²¡¤¹¥¡¼: ", 18, 0);
3329 prt("Keypress: ", 18, 0);
3333 /* Get a keymap trigger */
3334 do_cmd_macro_aux_keymap(buf);
3336 /* Free old keymap */
3337 string_free(keymap_act[mode][(byte)(buf[0])]);
3339 /* Make new keymap */
3340 keymap_act[mode][(byte)(buf[0])] = NULL;
3344 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3346 msg_print("Removed a keymap.");
3351 /* Enter a new action */
3356 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3358 prt("Command: Enter a new action", 16, 0);
3362 /* Go to the correct location */
3365 /* Hack -- limit the value */
3368 /* Get an encoded action */
3369 if (!askfor_aux(buf, 80)) continue;
3371 /* Extract an action */
3372 text_to_ascii(macro__buf, buf);
3375 #endif /* ALLOW_MACROS */
3384 /* Flush messages */
3393 static void cmd_visuals_aux(int i, int *num, int max)
3400 sprintf(str, "%d", *num);
3402 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3405 tmp = strtol(str, NULL, 0);
3406 if (tmp >= 0 && tmp < max)
3410 else if (isupper(i))
3411 *num = (*num + max - 1) % max;
3413 *num = (*num + 1) % max;
3419 * Interact with "visuals"
3421 void do_cmd_visuals(void)
3432 /* File type is "TEXT" */
3433 FILE_TYPE(FILE_TYPE_TEXT);
3436 /* Save the screen */
3440 /* Interact until done */
3446 /* Ask for a choice */
3448 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3450 prt("Interact with Visuals", 2, 0);
3454 /* Give some choices */
3456 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3458 prt("(1) Load a user pref file", 4, 5);
3461 #ifdef ALLOW_VISUALS
3463 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3464 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3465 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3466 prt("(5) (̤»ÈÍÑ)", 8, 5);
3467 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3468 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3469 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3470 prt("(9) (̤»ÈÍÑ)", 12, 5);
3472 prt("(2) Dump monster attr/chars", 5, 5);
3473 prt("(3) Dump object attr/chars", 6, 5);
3474 prt("(4) Dump feature attr/chars", 7, 5);
3475 prt("(5) (unused)", 8, 5);
3476 prt("(6) Change monster attr/chars", 9, 5);
3477 prt("(7) Change object attr/chars", 10, 5);
3478 prt("(8) Change feature attr/chars", 11, 5);
3479 prt("(9) (unused)", 12, 5);
3484 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3486 prt("(0) Reset visuals", 13, 5);
3492 prt("¥³¥Þ¥ó¥É:", 18, 0);
3494 prt("Command: ", 15, 0);
3502 if (i == ESCAPE) break;
3504 /* Load a 'pref' file */
3509 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3511 prt("Command: Load a user pref file", 15, 0);
3517 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3519 prt("File: ", 17, 0);
3523 /* Default filename */
3524 sprintf(tmp, "%s.prf", player_name);
3527 if (!askfor_aux(tmp, 70)) continue;
3529 /* Process the given filename */
3530 (void)process_pref_file(tmp);
3533 #ifdef ALLOW_VISUALS
3535 /* Dump monster attr/chars */
3538 static cptr mark = "Monster attr/chars";
3543 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3545 prt("Command: Dump monster attr/chars", 15, 0);
3551 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3553 prt("File: ", 17, 0);
3557 /* Default filename */
3558 sprintf(tmp, "%s.prf", player_name);
3560 /* Get a filename */
3561 if (!askfor_aux(tmp, 70)) continue;
3563 /* Build the filename */
3564 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3566 /* Append to the file */
3567 fff = open_auto_dump(buf, mark, &line_num);
3572 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3574 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3579 for (i = 1; i < max_r_idx; i++)
3581 monster_race *r_ptr = &r_info[i];
3583 /* Skip non-entries */
3584 if (!r_ptr->name) continue;
3586 /* Dump a comment */
3587 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3590 /* Dump the monster attr/char info */
3591 fprintf(fff, "R:%d:0x%02X/0x%02X\n\n", i,
3592 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3597 close_auto_dump(fff, mark, line_num);
3601 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3603 msg_print("Dumped monster attr/chars.");
3608 /* Dump object attr/chars */
3611 static cptr mark = "Object attr/chars";
3616 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3618 prt("Command: Dump object attr/chars", 15, 0);
3624 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3626 prt("File: ", 17, 0);
3630 /* Default filename */
3631 sprintf(tmp, "%s.prf", player_name);
3633 /* Get a filename */
3634 if (!askfor_aux(tmp, 70)) continue;
3636 /* Build the filename */
3637 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3639 /* Append to the file */
3640 fff = open_auto_dump(buf, mark, &line_num);
3645 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3647 fprintf(fff, "\n# Object attr/char definitions\n\n");
3652 for (i = 1; i < max_k_idx; i++)
3655 object_kind *k_ptr = &k_info[i];
3657 /* Skip non-entries */
3658 if (!k_ptr->name) continue;
3660 /* Skip entries with flavor */
3661 if (k_ptr->flavor) continue;
3664 strip_name(o_name, i);
3666 /* Dump a comment */
3667 fprintf(fff, "# %s\n", o_name);
3670 /* Dump the object attr/char info */
3671 fprintf(fff, "K:%d:0x%02X/0x%02X\n\n", i,
3672 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3677 close_auto_dump(fff, mark, line_num);
3681 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3683 msg_print("Dumped object attr/chars.");
3688 /* Dump feature attr/chars */
3691 static cptr mark = "Feature attr/chars";
3696 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3698 prt("Command: Dump feature attr/chars", 15, 0);
3704 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3706 prt("File: ", 17, 0);
3710 /* Default filename */
3711 sprintf(tmp, "%s.prf", player_name);
3713 /* Get a filename */
3714 if (!askfor_aux(tmp, 70)) continue;
3716 /* Build the filename */
3717 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3719 /* Append to the file */
3720 fff = open_auto_dump(buf, mark, &line_num);
3725 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3727 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3732 for (i = 1; i < max_f_idx; i++)
3734 feature_type *f_ptr = &f_info[i];
3736 /* Skip non-entries */
3737 if (!f_ptr->name) continue;
3739 /* Skip mimiccing features */
3740 if (f_ptr->mimic != i) continue;
3742 /* Dump a comment */
3743 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3746 /* Dump the feature attr/char info */
3747 fprintf(fff, "F:%d:0x%02X/0x%02X\n\n", i,
3748 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3753 close_auto_dump(fff, mark, line_num);
3757 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3759 msg_print("Dumped feature attr/chars.");
3764 /* Modify monster attr/chars */
3771 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3773 prt("Command: Change monster attr/chars", 15, 0);
3777 /* Hack -- query until done */
3780 monster_race *r_ptr = &r_info[r];
3784 byte da = (r_ptr->d_attr);
3785 byte dc = (r_ptr->d_char);
3786 byte ca = (r_ptr->x_attr);
3787 byte cc = (r_ptr->x_char);
3789 /* Label the object */
3791 Term_putstr(5, 17, -1, TERM_WHITE,
3792 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3793 r, (r_name + r_ptr->name)));
3795 Term_putstr(5, 17, -1, TERM_WHITE,
3796 format("Monster = %d, Name = %-40.40s",
3797 r, (r_name + r_ptr->name)));
3801 /* Label the Default values */
3803 Term_putstr(10, 19, -1, TERM_WHITE,
3804 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3806 Term_putstr(10, 19, -1, TERM_WHITE,
3807 format("Default attr/char = %3u / %3u", da, dc));
3810 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3811 Term_putch(43, 19, da, dc);
3815 Term_putch(44, 19, 255, -1);
3817 Term_putch(44, 19, 0, ' ');
3820 /* Label the Current values */
3822 Term_putstr(10, 20, -1, TERM_WHITE,
3823 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3825 Term_putstr(10, 20, -1, TERM_WHITE,
3826 format("Current attr/char = %3u / %3u", ca, cc));
3829 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3830 Term_putch(43, 20, ca, cc);
3834 Term_putch(44, 20, 255, -1);
3836 Term_putch(44, 20, 0, ' ');
3841 Term_putstr(0, 22, -1, TERM_WHITE,
3842 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3844 Term_putstr(0, 22, -1, TERM_WHITE,
3845 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3852 if (i == ESCAPE) break;
3854 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3855 else if (isupper(i)) c = 'a' + i - 'A';
3861 cmd_visuals_aux(i, &r, max_r_idx);
3864 t = (int)r_ptr->x_attr;
3865 cmd_visuals_aux(i, &t, 256);
3866 r_ptr->x_attr = (byte)t;
3869 t = (int)r_ptr->x_char;
3870 cmd_visuals_aux(i, &t, 256);
3871 r_ptr->x_char = (byte)t;
3877 /* Modify object attr/chars */
3884 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3886 prt("Command: Change object attr/chars", 15, 0);
3890 /* Hack -- query until done */
3893 object_kind *k_ptr = &k_info[k];
3897 byte da = (byte)k_ptr->d_attr;
3898 byte dc = (byte)k_ptr->d_char;
3899 byte ca = (byte)k_ptr->x_attr;
3900 byte cc = (byte)k_ptr->x_char;
3902 /* Label the object */
3904 Term_putstr(5, 17, -1, TERM_WHITE,
3905 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3906 k, (k_name + k_ptr->name)));
3908 Term_putstr(5, 17, -1, TERM_WHITE,
3909 format("Object = %d, Name = %-40.40s",
3910 k, (k_name + k_ptr->name)));
3914 /* Label the Default values */
3916 Term_putstr(10, 19, -1, TERM_WHITE,
3917 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3919 Term_putstr(10, 19, -1, TERM_WHITE,
3920 format("Default attr/char = %3d / %3d", da, dc));
3923 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3924 Term_putch(43, 19, da, dc);
3928 Term_putch(44, 19, 255, -1);
3930 Term_putch(44, 19, 0, ' ');
3933 /* Label the Current values */
3935 Term_putstr(10, 20, -1, TERM_WHITE,
3936 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3938 Term_putstr(10, 20, -1, TERM_WHITE,
3939 format("Current attr/char = %3d / %3d", ca, cc));
3942 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3943 Term_putch(43, 20, ca, cc);
3947 Term_putch(44, 20, 255, -1);
3949 Term_putch(44, 20, 0, ' ');
3954 Term_putstr(0, 22, -1, TERM_WHITE,
3955 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3957 Term_putstr(0, 22, -1, TERM_WHITE,
3958 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3965 if (i == ESCAPE) break;
3967 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3968 else if (isupper(i)) c = 'a' + i - 'A';
3974 cmd_visuals_aux(i, &k, max_k_idx);
3977 t = (int)k_info[k].x_attr;
3978 cmd_visuals_aux(i, &t, 256);
3979 k_info[k].x_attr = (byte)t;
3982 t = (int)k_info[k].x_char;
3983 cmd_visuals_aux(i, &t, 256);
3984 k_info[k].x_char = (byte)t;
3990 /* Modify feature attr/chars */
3997 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3999 prt("Command: Change feature attr/chars", 15, 0);
4003 /* Hack -- query until done */
4006 feature_type *f_ptr = &f_info[f];
4010 byte da = (byte)f_ptr->d_attr;
4011 byte dc = (byte)f_ptr->d_char;
4012 byte ca = (byte)f_ptr->x_attr;
4013 byte cc = (byte)f_ptr->x_char;
4015 /* Label the object */
4017 Term_putstr(5, 17, -1, TERM_WHITE,
4018 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
4019 f, (f_name + f_ptr->name)));
4021 Term_putstr(5, 17, -1, TERM_WHITE,
4022 format("Terrain = %d, Name = %-40.40s",
4023 f, (f_name + f_ptr->name)));
4027 /* Label the Default values */
4029 Term_putstr(10, 19, -1, TERM_WHITE,
4030 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4032 Term_putstr(10, 19, -1, TERM_WHITE,
4033 format("Default attr/char = %3d / %3d", da, dc));
4036 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
4037 Term_putch(43, 19, da, dc);
4041 Term_putch(44, 19, 255, -1);
4043 Term_putch(44, 19, 0, ' ');
4046 /* Label the Current values */
4048 Term_putstr(10, 20, -1, TERM_WHITE,
4049 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4051 Term_putstr(10, 20, -1, TERM_WHITE,
4052 format("Current attr/char = %3d / %3d", ca, cc));
4055 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
4056 Term_putch(43, 20, ca, cc);
4060 Term_putch(44, 20, 255, -1);
4062 Term_putch(44, 20, 0, ' ');
4067 Term_putstr(0, 22, -1, TERM_WHITE,
4068 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
4070 Term_putstr(0, 22, -1, TERM_WHITE,
4071 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4078 if (i == ESCAPE) break;
4080 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4081 else if (isupper(i)) c = 'a' + i - 'A';
4087 cmd_visuals_aux(i, &f, max_f_idx);
4090 t = (int)f_info[f].x_attr;
4091 cmd_visuals_aux(i, &t, 256);
4092 f_info[f].x_attr = (byte)t;
4095 t = (int)f_info[f].x_char;
4096 cmd_visuals_aux(i, &t, 256);
4097 f_info[f].x_char = (byte)t;
4113 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4115 msg_print("Visual attr/char tables reset.");
4120 /* Unknown option */
4126 /* Flush messages */
4131 /* Restore the screen */
4137 * Interact with "colors"
4139 void do_cmd_colors(void)
4150 /* File type is "TEXT" */
4151 FILE_TYPE(FILE_TYPE_TEXT);
4154 /* Save the screen */
4158 /* Interact until done */
4164 /* Ask for a choice */
4166 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4168 prt("Interact with Colors", 2, 0);
4172 /* Give some choices */
4174 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4176 prt("(1) Load a user pref file", 4, 5);
4181 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4182 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4184 prt("(2) Dump colors", 5, 5);
4185 prt("(3) Modify colors", 6, 5);
4192 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4194 prt("Command: ", 8, 0);
4202 if (i == ESCAPE) break;
4204 /* Load a 'pref' file */
4209 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4211 prt("Command: Load a user pref file", 8, 0);
4217 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4219 prt("File: ", 10, 0);
4224 sprintf(tmp, "%s.prf", player_name);
4227 if (!askfor_aux(tmp, 70)) continue;
4229 /* Process the given filename */
4230 (void)process_pref_file(tmp);
4232 /* Mega-Hack -- react to changes */
4233 Term_xtra(TERM_XTRA_REACT, 0);
4235 /* Mega-Hack -- redraw */
4244 static cptr mark = "Colors";
4249 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4251 prt("Command: Dump colors", 8, 0);
4257 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4259 prt("File: ", 10, 0);
4263 /* Default filename */
4264 sprintf(tmp, "%s.prf", player_name);
4266 /* Get a filename */
4267 if (!askfor_aux(tmp, 70)) continue;
4269 /* Build the filename */
4270 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4272 /* Append to the file */
4273 fff = open_auto_dump(buf, mark, &line_num);
4278 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4280 fprintf(fff, "\n# Color redefinitions\n\n");
4285 for (i = 0; i < 256; i++)
4287 int kv = angband_color_table[i][0];
4288 int rv = angband_color_table[i][1];
4289 int gv = angband_color_table[i][2];
4290 int bv = angband_color_table[i][3];
4295 cptr name = "unknown";
4299 /* Skip non-entries */
4300 if (!kv && !rv && !gv && !bv) continue;
4302 /* Extract the color name */
4303 if (i < 16) name = color_names[i];
4305 /* Dump a comment */
4307 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4309 fprintf(fff, "# Color '%s'\n", name);
4313 /* Dump the monster attr/char info */
4314 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4320 close_auto_dump(fff, mark, line_num);
4324 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4326 msg_print("Dumped color redefinitions.");
4338 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4340 prt("Command: Modify colors", 8, 0);
4344 /* Hack -- query until done */
4353 /* Exhibit the normal colors */
4354 for (j = 0; j < 16; j++)
4356 /* Exhibit this color */
4357 Term_putstr(j*4, 20, -1, a, "###");
4359 /* Exhibit all colors */
4360 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4363 /* Describe the color */
4365 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4367 name = ((a < 16) ? color_names[a] : "undefined");
4371 /* Describe the color */
4373 Term_putstr(5, 10, -1, TERM_WHITE,
4374 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4376 Term_putstr(5, 10, -1, TERM_WHITE,
4377 format("Color = %d, Name = %s", a, name));
4381 /* Label the Current values */
4382 Term_putstr(5, 12, -1, TERM_WHITE,
4383 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4384 angband_color_table[a][0],
4385 angband_color_table[a][1],
4386 angband_color_table[a][2],
4387 angband_color_table[a][3]));
4391 Term_putstr(0, 14, -1, TERM_WHITE,
4392 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4394 Term_putstr(0, 14, -1, TERM_WHITE,
4395 "Command (n/N/k/K/r/R/g/G/b/B): ");
4403 if (i == ESCAPE) break;
4406 if (i == 'n') a = (byte)(a + 1);
4407 if (i == 'N') a = (byte)(a - 1);
4408 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4409 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4410 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4411 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4412 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4413 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4414 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4415 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4417 /* Hack -- react to changes */
4418 Term_xtra(TERM_XTRA_REACT, 0);
4420 /* Hack -- redraw */
4427 /* Unknown option */
4433 /* Flush messages */
4438 /* Restore the screen */
4444 * Note something in the message recall
4446 void do_cmd_note(void)
4455 if (!get_string("¥á¥â: ", buf, 60)) return;
4457 if (!get_string("Note: ", buf, 60)) return;
4461 /* Ignore empty notes */
4462 if (!buf[0] || (buf[0] == ' ')) return;
4464 /* Add the note to the message recall */
4466 msg_format("¥á¥â: %s", buf);
4468 msg_format("Note: %s", buf);
4475 * Mention the current version
4477 void do_cmd_version(void)
4482 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4483 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4485 msg_format("You are playing Hengband %d.%d.%d.",
4486 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4493 * Array of feeling strings
4495 static cptr do_cmd_feeling_text[11] =
4498 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4500 "Looks like any other level.",
4504 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4506 "You feel there is something special about this level.",
4510 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4512 "You nearly faint as horrible visions of death fill your mind!",
4516 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4518 "This level looks very dangerous.",
4522 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4524 "You have a very bad feeling...",
4528 "°¤¤Í½´¶¤¬¤¹¤ë...",
4530 "You have a bad feeling...",
4536 "You feel nervous.",
4540 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4542 "You feel your luck is turning...",
4546 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4548 "You don't like the look of this place.",
4552 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4554 "This level looks reasonably safe.",
4558 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4560 "What a boring place..."
4565 static cptr do_cmd_feeling_text_combat[11] =
4568 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4570 "Looks like any other level.",
4574 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4576 "You feel there is something special about this level.",
4580 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4582 "You nearly faint as horrible visions of death fill your mind!",
4586 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4588 "This level looks very dangerous.",
4592 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4594 "You have a very bad feeling...",
4598 "°¤¤Í½´¶¤¬¤¹¤ë...",
4600 "You have a bad feeling...",
4606 "You feel nervous.",
4610 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4612 "You feel your luck is turning...",
4616 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4618 "You don't like the look of this place.",
4622 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4624 "This level looks reasonably safe.",
4628 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4630 "What a boring place..."
4635 static cptr do_cmd_feeling_text_lucky[11] =
4638 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4639 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4640 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4641 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4642 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4643 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4644 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4645 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4646 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4647 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4648 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4650 "Looks like any other level.",
4651 "You feel there is something special about this level.",
4652 "You have a superb feeling about this level.",
4653 "You have an excellent feeling...",
4654 "You have a very good feeling...",
4655 "You have a good feeling...",
4656 "You feel strangely lucky...",
4657 "You feel your luck is turning...",
4658 "You like the look of this place...",
4659 "This level can't be all bad...",
4660 "What a boring place..."
4666 * Note that "feeling" is set to zero unless some time has passed.
4667 * Note that this is done when the level is GENERATED, not entered.
4669 void do_cmd_feeling(void)
4671 /* Verify the feeling */
4672 if (feeling > 10) feeling = 10;
4674 /* No useful feeling in quests */
4675 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4678 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4680 msg_print("Looks like a typical quest level.");
4686 /* No useful feeling in town */
4687 else if (p_ptr->town_num && !dun_level)
4690 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4692 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4696 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4698 msg_print("Looks like a strange wilderness.");
4706 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4708 msg_print("Looks like a typical town.");
4715 /* No useful feeling in the wilderness */
4716 else if (!dun_level)
4719 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4721 msg_print("Looks like a typical wilderness.");
4727 /* Display the feeling */
4728 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4730 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4732 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4733 msg_print(do_cmd_feeling_text_combat[feeling]);
4735 msg_print(do_cmd_feeling_text[feeling]);
4740 msg_print(do_cmd_feeling_text[0]);
4747 * Description of each monster group.
4749 static cptr monster_group_text[] =
4752 "¥æ¥Ë¡¼¥¯", /* "Uniques" */
4781 /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */
4798 /* "¾åµé¥Ç¡¼¥â¥ó", */
4836 /* "Ancient Dragon/Wyrm", */
4845 "Multi-Headed Reptile",
4850 "Reptile/Amphibian",
4851 "Spider/Scorpion/Tick",
4853 /* "Major Demon", */
4867 * Symbols of monsters in each group. Note the "Uniques" group
4868 * is handled differently.
4870 static cptr monster_group_char[] =
4931 * hook function to sort monsters by level
4933 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
4935 u16b *who = (u16b*)(u);
4940 monster_race *r_ptr1 = &r_info[w1];
4941 monster_race *r_ptr2 = &r_info[w2];
4943 if (r_ptr2->level > r_ptr1->level) return TRUE;
4944 if (r_ptr1->level > r_ptr2->level) return FALSE;
4946 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
4947 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
4952 * Build a list of monster indexes in the given group. Return the number
4953 * of monsters in the group.
4955 * mode & 0x01 : check for non-empty group
4956 * mode & 0x02 : cheat?
4958 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
4963 /* Get a list of x_char in this group */
4964 cptr group_char = monster_group_char[grp_cur];
4966 /* XXX Hack -- Check if this is the "Uniques" group */
4967 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
4969 /* Check every race */
4970 for (i = 0; i < max_r_idx; i++)
4972 /* Access the race */
4973 monster_race *r_ptr = &r_info[i];
4975 /* Skip empty race */
4976 if (!r_ptr->name) continue ;
4978 /* Require known monsters */
4979 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights ) continue;
4981 if (grp_unique && !(r_ptr->flags1 & RF1_UNIQUE)) continue;
4983 /* Check for race in the group */
4984 if (grp_unique || strchr(group_char, r_ptr->d_char))
4987 mon_idx[mon_cnt++] = i;
4989 /* XXX Hack -- Just checking for non-empty group */
4990 if (mode & 0x01) break;
4994 /* Terminate the list */
4995 mon_idx[mon_cnt] = 0;
4997 /* Select the sort method */
4998 ang_sort_comp = ang_sort_comp_monster_level;
4999 ang_sort_swap = ang_sort_swap_hook;
5001 /* Sort by monster level */
5002 ang_sort(mon_idx, &dummy_why, mon_cnt);
5004 /* Return the number of races */
5010 * Description of each monster group.
5012 static cptr object_group_text[] =
5015 "¥¥Î¥³", /* "Mushrooms" */
5016 "Ìô", /* "Potions" */
5017 "Ìý¤Ä¤Ü", /* "Flasks" */
5018 "´¬Êª", /* "Scrolls" */
5019 "»ØÎØ", /* "Rings" */
5020 "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */
5021 "ū", /* "Whistle" */
5022 "¸÷¸»", /* "Lanterns" */
5023 "ËâË¡ËÀ", /* "Wands" */
5024 "¾ó", /* "Staffs" */
5025 "¥í¥Ã¥É", /* "Rods" */
5026 "¥«¡¼¥É", /* "Cards" */
5027 "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë",
5036 "Åá·õÎà", /* "Swords" */
5037 "Æß´ï", /* "Blunt Weapons" */
5038 "ĹÊÁÉð´ï", /* "Polearms" */
5039 "ºÎ·¡Æ»¶ñ", /* "Diggers" */
5040 "Èô¤ÓÆ»¶ñ", /* "Bows" */
5044 "·ÚÁõ³»", /* "Soft Armor" */
5045 "½ÅÁõ³»", /* "Hard Armor" */
5046 "¥É¥é¥´¥ó³»", /* "Dragon Armor" */
5047 "½â", /* "Shields" */
5048 "¥¯¥í¡¼¥¯", /* "Cloaks" */
5049 "äƼê", /* "Gloves" */
5050 "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */
5051 "´§", /* "Crowns" */
5052 "¥Ö¡¼¥Ä", /* "Boots" */
5100 * TVALs of items in each group
5102 static byte object_group_tval[] =
5142 TV_LIFE_BOOK, /* Hack -- all spellbooks */
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 && !p_ptr->wizard) 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 (TV_LIFE_BOOK == group_tval)
5180 /* Hack -- All spell books */
5181 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HISSATSU_BOOK)
5184 object_idx[object_cnt++] = i;
5187 else if (k_ptr->tval == group_tval)
5190 object_idx[object_cnt++] = i;
5194 /* Terminate the list */
5195 object_idx[object_cnt] = 0;
5197 /* Return the number of races */
5203 * Description of each feature group.
5205 static cptr feature_group_text[] =
5213 * Build a list of feature indexes in the given group. Return the number
5214 * of features in the group.
5216 static int collect_features(int grp_cur, int *feat_idx)
5218 int i, feat_cnt = 0;
5220 /* Check every feature */
5221 for (i = 1; i < max_f_idx; i++)
5223 /* Access the index */
5224 feature_type *f_ptr = &f_info[i];
5226 /* Skip empty index */
5227 if (!f_ptr->name) continue;
5229 /* Skip mimiccing features */
5230 if (f_ptr->mimic != i) continue;
5233 feat_idx[feat_cnt++] = i;
5236 /* Terminate the list */
5237 feat_idx[feat_cnt] = 0;
5239 /* Return the number of races */
5246 * Build a list of monster indexes in the given group. Return the number
5247 * of monsters in the group.
5249 static int collect_artifacts(int grp_cur, int object_idx[])
5251 int i, object_cnt = 0;
5253 /* Get a list of x_char in this group */
5254 byte group_tval = object_group_tval[grp_cur];
5256 /* Check every object */
5257 for (i = 0; i < max_a_idx; i++)
5259 /* Access the artifact */
5260 artifact_type *a_ptr = &a_info[i];
5262 /* Skip empty artifacts */
5263 if (!a_ptr->name) continue;
5265 /* Skip "uncreated" artifacts */
5266 if (!a_ptr->cur_num) continue;
5268 /* Check for race in the group */
5269 if (a_ptr->tval == group_tval)
5272 object_idx[object_cnt++] = i;
5276 /* Terminate the list */
5277 object_idx[object_cnt] = 0;
5279 /* Return the number of races */
5286 * Encode the screen colors
5288 static char hack[17] = "dwsorgbuDWvyRGBU";
5291 static errr photo_fgets(FILE *fff, char *buf, huge n)
5300 if (fgets(tmp, 1024, fff))
5302 /* Convert weirdness */
5303 for (s = tmp; *s; s++)
5305 /* Handle newline */
5316 else if (*s == '\t')
5318 /* Hack -- require room */
5319 if (i + 8 >= n) break;
5321 /* Append a space */
5324 /* Append some more spaces */
5325 while (!(i % 8)) buf[i++] = ' ';
5329 else if (iskanji(*s))
5336 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
5337 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
5344 /* Handle printables */
5365 * Hack -- load a screen dump from a file
5367 void do_cmd_load_screen(void)
5382 Term_get_size(&wid, &hgt);
5384 /* Hack -- drop permissions */
5387 /* Build the filename */
5388 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5390 /* Append to the file */
5391 fff = my_fopen(buf, "r");
5396 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5398 msg_format("Failed to open %s.", buf);
5405 /* Save the screen */
5408 /* Clear the screen */
5412 /* Load the screen */
5413 for (y = 0; okay && (y < hgt); y++)
5415 /* Get a line of data */
5416 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5419 for (x = 0; x < wid - 1; x++)
5421 /* Put the attr/char */
5422 Term_draw(x, y, TERM_WHITE, buf[x]);
5426 /* Get the blank line */
5427 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5430 /* Dump the screen */
5431 for (y = 0; okay && (y < hgt); y++)
5433 /* Get a line of data */
5434 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5437 for (x = 0; x < wid - 1; x++)
5439 /* Get the attr/char */
5440 (void)(Term_what(x, y, &a, &c));
5442 /* Look up the attr */
5443 for (i = 0; i < 16; i++)
5445 /* Use attr matches */
5446 if (hack[i] == buf[x]) a = i;
5449 /* Put the attr/char */
5450 Term_draw(x, y, a, c);
5455 /* Get the blank line */
5456 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5462 /* Hack -- grab permissions */
5468 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
5470 msg_print("Screen dump loaded.");
5477 /* Restore the screen */
5484 cptr inven_res_label =
5486 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
5488 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
5491 /* XTRA HACK RESLIST */
5492 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
5493 int *j, byte tval, char *where)
5495 char o_name[MAX_NLEN];
5496 u32b flgs[TR_FLAG_SIZE];
5498 if (!o_ptr->k_idx)return;
5499 if (o_ptr->tval != tval)return;
5502 * HACK:Ring of Lordly protection and Dragon shield/helm
5503 * have random resistances.
5505 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
5506 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
5507 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
5508 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
5509 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
5510 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
5511 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
5514 object_desc(o_name, o_ptr, TRUE, 0);
5516 while ( o_name[i] && i < 26 ){
5518 if (iskanji(o_name[i])) i++;
5522 if(i<28) while(i<28){o_name[i]=' ';i++;}
5525 fprintf(fff,"%s %s", where, o_name);
5527 if (!(o_ptr->ident & (IDENT_MENTAL)))
5530 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
5532 fprintf(fff, "-------unknown------------ -------unknown------\n");
5536 object_flags_known(o_ptr, flgs);
5539 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
5540 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
5541 else fprintf(fff,"¡¦");
5543 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
5544 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
5545 else fprintf(fff,"¡¦");
5547 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
5548 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
5549 else fprintf(fff,"¡¦");
5551 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
5552 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
5553 else fprintf(fff,"¡¦");
5555 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
5556 else fprintf(fff,"¡¦");
5558 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
5559 else fprintf(fff,"¡¦");
5561 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
5562 else fprintf(fff,"¡¦");
5564 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
5565 else fprintf(fff,"¡¦");
5567 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
5568 else fprintf(fff,"¡¦");
5570 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
5571 else fprintf(fff,"¡¦");
5573 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
5574 else fprintf(fff,"¡¦");
5576 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
5577 else fprintf(fff,"¡¦");
5579 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
5580 else fprintf(fff,"¡¦");
5584 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
5585 else fprintf(fff,"¡¦");
5587 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
5588 else fprintf(fff,"¡¦");
5590 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
5591 else fprintf(fff,"¡¦");
5593 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
5594 else fprintf(fff,"¡¦");
5596 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
5597 else fprintf(fff,"¡¦");
5599 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
5600 else fprintf(fff,"¡¦");
5602 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
5603 else fprintf(fff,"¡¦");
5605 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
5606 else fprintf(fff,"¡¦");
5609 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
5610 else fprintf(fff,"¡¦");
5612 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
5613 else fprintf(fff,"¡¦");
5615 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
5616 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
5617 else fprintf(fff,". ");
5619 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
5620 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
5621 else fprintf(fff,". ");
5623 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
5624 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
5625 else fprintf(fff,". ");
5627 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5628 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5629 else fprintf(fff,". ");
5631 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5632 else fprintf(fff,". ");
5634 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5635 else fprintf(fff,". ");
5637 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5638 else fprintf(fff,". ");
5640 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5641 else fprintf(fff,". ");
5643 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5644 else fprintf(fff,". ");
5646 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5647 else fprintf(fff,". ");
5649 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5650 else fprintf(fff,". ");
5652 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5653 else fprintf(fff,". ");
5655 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5656 else fprintf(fff,". ");
5660 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5661 else fprintf(fff,". ");
5663 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5664 else fprintf(fff,". ");
5666 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5667 else fprintf(fff,". ");
5669 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5670 else fprintf(fff,". ");
5672 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5673 else fprintf(fff,". ");
5675 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5676 else fprintf(fff,". ");
5678 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5679 else fprintf(fff,". ");
5681 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5682 else fprintf(fff,". ");
5685 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5686 else fprintf(fff,". ");
5688 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5689 else fprintf(fff,". ");
5697 fprintf(fff,"%s\n", inven_res_label);
5703 * Display *ID* ed weapons/armors's resistances
5705 static void do_cmd_knowledge_inven(void)
5710 char file_name[1024];
5721 /* Open a new file */
5722 fff = my_fopen_temp(file_name, 1024);
5725 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5727 msg_format("Failed to create temporally file %s.", file_name);
5732 fprintf(fff,"%s\n",inven_res_label);
5734 for (tval=TV_BOW; tval <= TV_RING; tval++){
5737 for (;j<9;j++) fprintf(fff, "\n");
5739 fprintf(fff,"%s\n",inven_res_label);
5743 strcpy(where, "Áõ");
5745 strcpy(where, "E ");
5747 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5749 o_ptr = &inventory[i];
5750 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5754 strcpy(where, "»ý");
5756 strcpy(where, "I ");
5758 for (i = 0; i < INVEN_PACK; i++)
5760 o_ptr = &inventory[i];
5761 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5765 /* Print all homes in the different towns */
5766 st_ptr = &town[1].store[STORE_HOME];
5768 strcpy(where, "²È");
5770 strcpy(where, "H ");
5773 /* Dump all available items */
5774 for (i = 0; i < st_ptr->stock_num; i++)
5776 o_ptr = &st_ptr->stock[i];
5777 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5781 /* Close the file */
5784 /* Display the file contents */
5786 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5788 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5791 /* Remove the file */
5796 void do_cmd_save_screen_html_aux(char *filename, int message)
5800 byte a = 0, old_a = 0;
5814 cptr html_head[] = {
5815 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5819 cptr html_foot[] = {
5821 "</body>\n</html>\n",
5827 Term_get_size(&wid, &hgt);
5829 /* File type is "TEXT" */
5830 FILE_TYPE(FILE_TYPE_TEXT);
5832 /* Append to the file */
5833 fff = my_fopen(filename, "w");
5839 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5841 msg_format("Failed to open file %s.", filename);
5849 /* Save the screen */
5853 /* Build the filename */
5854 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5855 tmpfff = my_fopen(buf, "r");
5857 for (i = 0; html_head[i]; i++)
5858 fprintf(fff, html_head[i]);
5862 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5864 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5868 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5870 fprintf(fff, "%s\n", buf);
5875 /* Dump the screen */
5876 for (y = 0; y < hgt; y++)
5883 for (x = 0; x < wid - 1; x++)
5887 /* Get the attr/char */
5888 (void)(Term_what(x, y, &a, &c));
5892 case '&': cc = "&"; break;
5893 case '<': cc = "<"; break;
5894 case '>': cc = ">"; break;
5896 case 0x1f: c = '.'; break;
5897 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5902 if ((y == 0 && x == 0) || a != old_a) {
5903 rv = angband_color_table[a][1];
5904 gv = angband_color_table[a][2];
5905 bv = angband_color_table[a][3];
5906 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5907 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5911 fprintf(fff, "%s", cc);
5913 fprintf(fff, "%c", c);
5916 fprintf(fff, "</font>");
5919 for (i = 0; html_foot[i]; i++)
5920 fprintf(fff, html_foot[i]);
5925 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5927 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5931 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5933 fprintf(fff, "%s\n", buf);
5948 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5950 msg_print("Screen dump saved.");
5955 /* Restore the screen */
5961 * Hack -- save a screen dump to a file
5963 static void do_cmd_save_screen_html(void)
5965 char buf[1024], tmp[256] = "screen.html";
5968 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5970 if (!get_string("File name: ", tmp, 80))
5974 /* Build the filename */
5975 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5979 /* Hack -- drop permissions */
5982 do_cmd_save_screen_html_aux(buf, 1);
5984 /* Hack -- grab permissions */
5990 * Redefinable "save_screen" action
5992 void (*screendump_aux)(void) = NULL;
5996 * Hack -- save a screen dump to a file
5998 void do_cmd_save_screen(void)
6000 bool old_use_graphics = use_graphics;
6001 bool html_dump = FALSE;
6006 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
6008 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
6013 if (c == 'Y' || c == 'y')
6015 else if (c == 'H' || c == 'h')
6027 Term_get_size(&wid, &hgt);
6029 if (old_use_graphics)
6031 use_graphics = FALSE;
6034 /* Redraw everything */
6035 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6037 /* Hack -- update */
6043 do_cmd_save_screen_html();
6047 /* Do we use a special screendump function ? */
6048 else if (screendump_aux)
6050 /* Dump the screen to a graphics file */
6051 (*screendump_aux)();
6053 else /* Dump the screen as text */
6065 /* Hack -- drop permissions */
6068 /* Build the filename */
6069 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
6071 /* File type is "TEXT" */
6072 FILE_TYPE(FILE_TYPE_TEXT);
6074 /* Append to the file */
6075 fff = my_fopen(buf, "w");
6080 /* Hack -- grab permissions */
6083 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
6085 msg_format("Failed to open file %s.", buf);
6092 /* Save the screen */
6096 /* Dump the screen */
6097 for (y = 0; y < hgt; y++)
6100 for (x = 0; x < wid - 1; x++)
6102 /* Get the attr/char */
6103 (void)(Term_what(x, y, &a, &c));
6113 fprintf(fff, "%s\n", buf);
6120 /* Dump the screen */
6121 for (y = 0; y < hgt; y++)
6124 for (x = 0; x < wid - 1; x++)
6126 /* Get the attr/char */
6127 (void)(Term_what(x, y, &a, &c));
6130 buf[x] = hack[a&0x0F];
6137 fprintf(fff, "%s\n", buf);
6147 /* Hack -- grab permissions */
6152 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6154 msg_print("Screen dump saved.");
6160 /* Restore the screen */
6164 if (old_use_graphics)
6166 use_graphics = TRUE;
6169 /* Redraw everything */
6170 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6172 /* Hack -- update */
6179 * Sorting hook -- Comp function -- see below
6181 * We use "u" to point to array of monster indexes,
6182 * and "v" to select the type of sorting to perform on "u".
6184 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
6186 u16b *who = (u16b*)(u);
6188 u16b *why = (u16b*)(v);
6196 /* Sort by total kills */
6199 /* Extract total kills */
6200 z1 = a_info[w1].tval;
6201 z2 = a_info[w2].tval;
6203 /* Compare total kills */
6204 if (z1 < z2) return (TRUE);
6205 if (z1 > z2) return (FALSE);
6209 /* Sort by monster level */
6212 /* Extract levels */
6213 z1 = a_info[w1].sval;
6214 z2 = a_info[w2].sval;
6216 /* Compare levels */
6217 if (z1 < z2) return (TRUE);
6218 if (z1 > z2) return (FALSE);
6222 /* Sort by monster experience */
6225 /* Extract experience */
6226 z1 = a_info[w1].level;
6227 z2 = a_info[w2].level;
6229 /* Compare experience */
6230 if (z1 < z2) return (TRUE);
6231 if (z1 > z2) return (FALSE);
6235 /* Compare indexes */
6241 * Sorting hook -- Swap function -- see below
6243 * We use "u" to point to array of monster indexes,
6244 * and "v" to select the type of sorting to perform.
6246 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
6248 u16b *who = (u16b*)(u);
6260 * Check the status of "artifacts"
6262 static void do_cmd_knowledge_artifacts(void)
6264 int i, k, z, x, y, n = 0;
6270 char file_name[1024];
6272 char base_name[MAX_NLEN];
6276 /* Open a new file */
6277 fff = my_fopen_temp(file_name, 1024);
6281 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6283 msg_format("Failed to create temporary file %s.", file_name);
6289 /* Allocate the "who" array */
6290 C_MAKE(who, max_a_idx, s16b);
6292 /* Allocate the "okay" array */
6293 C_MAKE(okay, max_a_idx, bool);
6295 /* Scan the artifacts */
6296 for (k = 0; k < max_a_idx; k++)
6298 artifact_type *a_ptr = &a_info[k];
6303 /* Skip "empty" artifacts */
6304 if (!a_ptr->name) continue;
6306 /* Skip "uncreated" artifacts */
6307 if (!a_ptr->cur_num) continue;
6313 /* Check the dungeon */
6314 for (y = 0; y < cur_hgt; y++)
6316 for (x = 0; x < cur_wid; x++)
6318 cave_type *c_ptr = &cave[y][x];
6320 s16b this_o_idx, next_o_idx = 0;
6322 /* Scan all objects in the grid */
6323 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
6327 /* Acquire object */
6328 o_ptr = &o_list[this_o_idx];
6330 /* Acquire next object */
6331 next_o_idx = o_ptr->next_o_idx;
6333 /* Ignore non-artifacts */
6334 if (!artifact_p(o_ptr)) continue;
6336 /* Ignore known items */
6337 if (object_known_p(o_ptr)) continue;
6339 /* Note the artifact */
6340 okay[o_ptr->name1] = FALSE;
6345 /* Check the inventory and equipment */
6346 for (i = 0; i < INVEN_TOTAL; i++)
6348 object_type *o_ptr = &inventory[i];
6350 /* Ignore non-objects */
6351 if (!o_ptr->k_idx) continue;
6353 /* Ignore non-artifacts */
6354 if (!artifact_p(o_ptr)) continue;
6356 /* Ignore known items */
6357 if (object_known_p(o_ptr)) continue;
6359 /* Note the artifact */
6360 okay[o_ptr->name1] = FALSE;
6363 for (k = 0; k < max_a_idx; k++)
6365 if (okay[k]) who[n++] = k;
6368 /* Select the sort method */
6369 ang_sort_comp = ang_sort_art_comp;
6370 ang_sort_swap = ang_sort_art_swap;
6372 /* Sort the array by dungeon depth of monsters */
6373 ang_sort(who, &why, n);
6375 /* Scan the artifacts */
6376 for (k = 0; k < n; k++)
6378 artifact_type *a_ptr = &a_info[who[k]];
6382 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
6384 strcpy(base_name, "Unknown Artifact");
6388 /* Obtain the base object type */
6389 z = lookup_kind(a_ptr->tval, a_ptr->sval);
6397 /* Get local object */
6400 /* Create fake object */
6401 object_prep(q_ptr, z);
6403 /* Make it an artifact */
6404 q_ptr->name1 = (byte)who[k];
6406 /* Describe the artifact */
6407 object_desc_store(base_name, q_ptr, FALSE, 0);
6410 /* Hack -- Build the artifact name */
6412 fprintf(fff, " %s\n", base_name);
6414 fprintf(fff, " The %s\n", base_name);
6419 /* Free the "who" array */
6420 C_KILL(who, max_a_idx, s16b);
6422 /* Free the "okay" array */
6423 C_KILL(okay, max_a_idx, bool);
6425 /* Close the file */
6428 /* Display the file contents */
6430 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
6432 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
6436 /* Remove the file */
6442 * Display known uniques
6444 static void do_cmd_knowledge_uniques(void)
6452 char file_name[1024];
6454 /* Open a new file */
6455 fff = my_fopen_temp(file_name, 1024);
6459 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6461 msg_format("Failed to create temporary file %s.", file_name);
6467 /* Allocate the "who" array */
6468 C_MAKE(who, max_r_idx, s16b);
6470 /* Scan the monsters */
6471 for (i = 1; i < max_r_idx; i++)
6473 monster_race *r_ptr = &r_info[i];
6475 /* Use that monster */
6476 if (r_ptr->name) who[n++] = i;
6479 /* Select the sort method */
6480 ang_sort_comp = ang_sort_comp_hook;
6481 ang_sort_swap = ang_sort_swap_hook;
6483 /* Sort the array by dungeon depth of monsters */
6484 ang_sort(who, &why, n);
6486 /* Scan the monster races */
6487 for (k = 0; k < n; k++)
6489 monster_race *r_ptr = &r_info[who[k]];
6491 /* Only print Uniques */
6492 if (r_ptr->flags1 & (RF1_UNIQUE))
6494 bool dead = (r_ptr->max_num == 0);
6498 /* Only display "known" uniques */
6499 if (dead || cheat_know || r_ptr->r_sights)
6501 /* Print a message */
6503 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
6504 (r_name + r_ptr->name));
6506 fprintf(fff, " %s is alive\n",
6507 (r_name + r_ptr->name));
6514 /* Free the "who" array */
6515 C_KILL(who, max_r_idx, s16b);
6517 /* Close the file */
6520 /* Display the file contents */
6522 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6524 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6528 /* Remove the file */
6534 * Display weapon-exp
6536 static void do_cmd_knowledge_weapon_exp(void)
6538 int i,j, num, shougou;
6542 char file_name[1024];
6545 /* Open a new file */
6546 fff = my_fopen_temp(file_name, 1024);
6549 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6551 msg_format("Failed to create temporary file %s.", file_name);
6557 for(i = 0; i < 5; i++)
6559 for (num = 0; num < 64; num++)
6561 for (j = 0; j < max_k_idx; j++)
6563 object_kind *k_ptr = &k_info[j];
6565 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6567 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6569 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6570 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6571 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6572 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6575 fprintf(fff,"%-25s ",tmp);
6576 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6577 else fprintf(fff," ");
6578 fprintf(fff,"%s",shougou_moji[shougou]);
6579 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6587 /* Close the file */
6590 /* Display the file contents */
6592 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6594 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6598 /* Remove the file */
6606 static void do_cmd_knowledge_spell_exp(void)
6613 char file_name[1024];
6615 /* Open a new file */
6616 fff = my_fopen_temp(file_name, 1024);
6619 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6621 msg_format("Failed to create temporary file %s.", file_name);
6627 if(p_ptr->realm1 != REALM_NONE)
6630 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6632 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6634 for (i = 0; i < 32; i++)
6636 if (!is_magic(p_ptr->realm1))
6638 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6642 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6644 if(s_ptr->slevel == 99) continue;
6645 if(p_ptr->spell_exp[i]<900) shougou=0;
6646 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6647 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6648 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6650 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6651 if (p_ptr->realm1 == REALM_HISSATSU)
6652 fprintf(fff,"[--]");
6655 if (shougou == 4) fprintf(fff,"!");
6656 else fprintf(fff," ");
6657 fprintf(fff,"%s",shougou_moji[shougou]);
6659 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6664 if(p_ptr->realm2 != REALM_NONE)
6666 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6667 for (i = 0; i < 32; i++)
6669 if (!is_magic(p_ptr->realm1))
6671 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6675 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6677 if(s_ptr->slevel == 99) continue;
6679 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6680 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6681 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6683 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6684 if (shougou == 3) fprintf(fff,"!");
6685 else fprintf(fff," ");
6686 fprintf(fff,"%s",shougou_moji[shougou]);
6687 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6692 /* Close the file */
6695 /* Display the file contents */
6697 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6699 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6703 /* Remove the file */
6711 static void do_cmd_knowledge_skill_exp(void)
6717 char file_name[1024];
6719 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6721 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6724 /* Open a new file */
6725 fff = my_fopen_temp(file_name, 1024);
6728 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6730 msg_format("Failed to create temporary file %s.", file_name);
6736 for (i = 0; i < 3; i++)
6738 if(i == GINOU_RIDING)
6740 if(p_ptr->skill_exp[i]<500) shougou=0;
6741 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6742 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6743 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6748 if(p_ptr->skill_exp[i]<4000) shougou=0;
6749 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6750 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6751 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6754 fprintf(fff,"%-20s ",skill_name[i]);
6755 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6756 else fprintf(fff," ");
6757 fprintf(fff,"%s",shougou_moji[shougou]);
6758 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6762 /* Close the file */
6765 /* Display the file contents */
6767 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6769 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6773 /* Remove the file */
6779 * Pluralize a monster name
6781 void plural_aux(char *Name)
6783 int NameLen = strlen(Name);
6785 if (strstr(Name, "Disembodied hand"))
6787 strcpy(Name, "Disembodied hands that strangled people");
6789 else if (strstr(Name, "Colour out of space"))
6791 strcpy(Name, "Colours out of space");
6793 else if (strstr(Name, "stairway to hell"))
6795 strcpy(Name, "stairways to hell");
6797 else if (strstr(Name, "Dweller on the threshold"))
6799 strcpy(Name, "Dwellers on the threshold");
6801 else if (strstr(Name, " of "))
6803 cptr aider = strstr(Name, " of ");
6814 if (dummy[i-1] == 's')
6816 strcpy(&(dummy[i]), "es");
6821 strcpy(&(dummy[i]), "s");
6824 strcpy(&(dummy[i+1]), aider);
6825 strcpy(Name, dummy);
6827 else if (strstr(Name, "coins"))
6830 strcpy(dummy, "piles of ");
6831 strcat(dummy, Name);
6832 strcpy(Name, dummy);
6835 else if (strstr(Name, "Manes"))
6839 else if (streq(&(Name[NameLen - 2]), "ey"))
6841 strcpy(&(Name[NameLen - 2]), "eys");
6843 else if (Name[NameLen - 1] == 'y')
6845 strcpy(&(Name[NameLen - 1]), "ies");
6847 else if (streq(&(Name[NameLen - 4]), "ouse"))
6849 strcpy(&(Name[NameLen - 4]), "ice");
6851 else if (streq(&(Name[NameLen - 2]), "us"))
6853 strcpy(&(Name[NameLen - 2]), "i");
6855 else if (streq(&(Name[NameLen - 6]), "kelman"))
6857 strcpy(&(Name[NameLen - 6]), "kelmen");
6859 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6861 strcpy(&(Name[NameLen - 8]), "wordsmen");
6863 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6865 strcpy(&(Name[NameLen - 7]), "oodsmen");
6867 else if (streq(&(Name[NameLen - 7]), "eastman"))
6869 strcpy(&(Name[NameLen - 7]), "eastmen");
6871 else if (streq(&(Name[NameLen - 8]), "izardman"))
6873 strcpy(&(Name[NameLen - 8]), "izardmen");
6875 else if (streq(&(Name[NameLen - 5]), "geist"))
6877 strcpy(&(Name[NameLen - 5]), "geister");
6879 else if (streq(&(Name[NameLen - 2]), "ex"))
6881 strcpy(&(Name[NameLen - 2]), "ices");
6883 else if (streq(&(Name[NameLen - 2]), "lf"))
6885 strcpy(&(Name[NameLen - 2]), "lves");
6887 else if (suffix(Name, "ch") ||
6888 suffix(Name, "sh") ||
6889 suffix(Name, "nx") ||
6890 suffix(Name, "s") ||
6893 strcpy(&(Name[NameLen]), "es");
6897 strcpy(&(Name[NameLen]), "s");
6902 * Display current pets
6904 static void do_cmd_knowledge_pets(void)
6908 monster_type *m_ptr;
6910 int show_upkeep = 0;
6911 char file_name[1024];
6914 /* Open a new file */
6915 fff = my_fopen_temp(file_name, 1024);
6918 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6920 msg_format("Failed to create temporary file %s.", file_name);
6926 /* Process the monsters (backwards) */
6927 for (i = m_max - 1; i >= 1; i--)
6929 monster_race *r_ptr;
6930 /* Access the monster */
6933 /* Ignore "dead" monsters */
6934 if (!m_ptr->r_idx) continue;
6935 r_ptr = &r_info[m_ptr->r_idx];
6937 /* Calculate "upkeep" for pets */
6942 monster_desc(pet_name, m_ptr, 0x88);
6943 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i, 0x00));
6944 if (p_ptr->riding == i)
6946 fprintf(fff, " ¾èÇÏÃæ");
6948 fprintf(fff, " Riding");
6954 show_upkeep = calculate_upkeep();
6956 fprintf(fff, "----------------------------------------------\n");
6958 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6959 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6961 fprintf(fff, " Total: %d pet%s.\n",
6962 t_friends, (t_friends == 1 ? "" : "s"));
6963 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6968 /* Close the file */
6971 /* Display the file contents */
6973 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6975 show_file(TRUE, file_name, "Current Pets", 0, 0);
6979 /* Remove the file */
6987 * Note that the player ghosts are ignored. XXX XXX XXX
6989 static void do_cmd_knowledge_kill_count(void)
6997 char file_name[1024];
7002 /* Open a new file */
7003 fff = my_fopen_temp(file_name, 1024);
7007 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7009 msg_format("Failed to create temporary file %s.", file_name);
7015 /* Allocate the "who" array */
7016 C_MAKE(who, max_r_idx, s16b);
7019 /* Monsters slain */
7022 for (kk = 1; kk < max_r_idx; kk++)
7024 monster_race *r_ptr = &r_info[kk];
7026 if (r_ptr->flags1 & (RF1_UNIQUE))
7028 bool dead = (r_ptr->max_num == 0);
7037 s16b This = r_ptr->r_pkills;
7048 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
7050 fprintf(fff,"You have defeated no enemies yet.\n\n");
7053 else if (Total == 1)
7055 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
7057 fprintf(fff,"You have defeated one enemy.\n\n");
7062 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
7064 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
7071 /* Scan the monsters */
7072 for (i = 1; i < max_r_idx; i++)
7074 monster_race *r_ptr = &r_info[i];
7076 /* Use that monster */
7077 if (r_ptr->name) who[n++] = i;
7080 /* Select the sort method */
7081 ang_sort_comp = ang_sort_comp_hook;
7082 ang_sort_swap = ang_sort_swap_hook;
7084 /* Sort the array by dungeon depth of monsters */
7085 ang_sort(who, &why, n);
7087 /* Scan the monster races */
7088 for (k = 0; k < n; k++)
7090 monster_race *r_ptr = &r_info[who[k]];
7092 if (r_ptr->flags1 & (RF1_UNIQUE))
7094 bool dead = (r_ptr->max_num == 0);
7098 /* Print a message */
7099 fprintf(fff, " %s\n",
7100 (r_name + r_ptr->name));
7106 s16b This = r_ptr->r_pkills;
7111 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
7112 if(strchr("pt",r_ptr->d_char))
7113 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
7115 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
7119 if (strstr(r_name + r_ptr->name, "coins"))
7121 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
7125 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
7131 strcpy(ToPlural, (r_name + r_ptr->name));
7132 plural_aux(ToPlural);
7133 fprintf(fff, " %d %s\n", This, ToPlural);
7143 fprintf(fff,"----------------------------------------------\n");
7145 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
7147 fprintf(fff," Total: %lu creature%s killed.\n",
7148 Total, (Total == 1 ? "" : "s"));
7152 /* Free the "who" array */
7153 C_KILL(who, max_r_idx, s16b);
7155 /* Close the file */
7158 /* Display the file contents */
7160 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
7162 show_file(TRUE, file_name, "Kill Count", 0, 0);
7166 /* Remove the file */
7172 * Display the object groups.
7174 static void display_group_list(int col, int row, int wid, int per_page,
7175 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
7179 /* Display lines until done */
7180 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
7182 /* Get the group index */
7183 int grp = grp_idx[grp_top + i];
7185 /* Choose a color */
7186 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
7188 /* Erase the entire line */
7189 Term_erase(col, row + i, wid);
7191 /* Display the group label */
7192 c_put_str(attr, group_text[grp], row + i, col);
7198 * Move the cursor in a browser window
7200 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
7201 int *list_cur, int list_cnt)
7206 int list = *list_cur;
7208 /* Extract direction */
7211 /* Hack -- scroll up full screen */
7216 /* Hack -- scroll down full screen */
7221 d = get_keymap_dir(ch);
7226 /* Diagonals - hack */
7227 if ((ddx[d] > 0) && ddy[d])
7233 Term_get_size(&wid, &hgt);
7235 browser_rows = hgt - 8;
7237 /* Browse group list */
7242 /* Move up or down */
7243 grp += ddy[d] * (browser_rows - 1);
7246 if (grp >= grp_cnt) grp = grp_cnt - 1;
7247 if (grp < 0) grp = 0;
7248 if (grp != old_grp) list = 0;
7251 /* Browse sub-list list */
7254 /* Move up or down */
7255 list += ddy[d] * browser_rows;
7258 if (list >= list_cnt) list = list_cnt - 1;
7259 if (list < 0) list = 0;
7271 if (col < 0) col = 0;
7272 if (col > 1) col = 1;
7279 /* Browse group list */
7284 /* Move up or down */
7288 if (grp >= grp_cnt) grp = grp_cnt - 1;
7289 if (grp < 0) grp = 0;
7290 if (grp != old_grp) list = 0;
7293 /* Browse sub-list list */
7296 /* Move up or down */
7300 if (list >= list_cnt) list = list_cnt - 1;
7301 if (list < 0) list = 0;
7312 static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
7316 /* Clear the display lines */
7317 for (i = 0; i < height; i++)
7319 Term_erase(col, row + i, width);
7322 /* Bigtile mode uses double width */
7323 if (use_bigtile) width /= 2;
7325 /* Display lines until done */
7326 for (i = 0; i < height; i++)
7328 /* Display columns until done */
7329 for (j = 0; j < width; j++)
7331 byte a = attr_top + i;
7332 byte c = char_left + j;
7336 /* Bigtile mode uses double width */
7337 if (use_bigtile) x += j;
7339 /* Don't display broken kanji */
7340 if (!(a & 0x80) && (c & 0x80)) continue;
7343 /* Display the mark */
7344 Term_putch(x, y, a, c);
7346 /* Write dammy byte */
7349 if ((a & 0x80) && (c & 0x80))
7350 Term_putch(x + 1, y, 255, -1);
7352 Term_putch(x + 1, y, 0, ' ');
7360 * Clipboard variables for copy&paste in visual mode
7362 static byte attr_idx = 0;
7363 static byte char_idx = 0;
7366 * Do visual mode command -- Change symbols
7368 static bool visual_mode_command(char ch, bool *visual_list_ptr,
7369 int height, int width,
7370 byte *attr_top_ptr, byte *char_left_ptr,
7371 byte *cur_attr_ptr, byte *cur_char_ptr)
7373 static byte attr_old = 0, char_old = 0;
7378 if (*visual_list_ptr)
7381 *cur_attr_ptr = attr_old;
7382 *cur_char_ptr = char_old;
7383 *visual_list_ptr = FALSE;
7392 if (*visual_list_ptr)
7395 *visual_list_ptr = FALSE;
7403 if (!*visual_list_ptr)
7405 *visual_list_ptr = TRUE;
7407 *attr_top_ptr = MAX(0, *cur_attr_ptr - 5);
7408 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7410 attr_old = *cur_attr_ptr;
7411 char_old = *cur_char_ptr;
7419 /* Set the visual */
7420 attr_idx = *cur_attr_ptr;
7421 char_idx = *cur_char_ptr;
7430 *cur_attr_ptr = attr_idx;
7431 *attr_top_ptr = MAX(0, *cur_attr_ptr - 5);
7437 *cur_char_ptr = char_idx;
7438 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7444 if (*visual_list_ptr)
7447 int d = get_keymap_dir(ch);
7449 if (use_bigtile) eff_width = width / 2;
7450 else eff_width = width;
7452 /* Restrict direction */
7453 if ((*cur_attr_ptr == 0) && (ddy[d] < 0)) d = 0;
7454 if ((*cur_char_ptr == 0) && (ddx[d] < 0)) d = 0;
7455 if ((*cur_attr_ptr == 255) && (ddy[d] > 0)) d = 0;
7456 if ((*cur_char_ptr == 255) && (ddx[d] > 0)) d = 0;
7458 /* Set the visual */
7459 *cur_attr_ptr += ddy[d];
7460 *cur_char_ptr += ddx[d];
7462 /* Move the frame */
7463 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)*cur_char_ptr - 10)) (*char_left_ptr)--;
7464 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(255, (int)*cur_char_ptr + 10)) (*char_left_ptr)++;
7465 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)*cur_attr_ptr - 4)) (*attr_top_ptr)--;
7466 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(255, *cur_attr_ptr + 4)) (*attr_top_ptr)++;
7473 /* Visual mode command is not used */
7479 * Display the monsters in a group.
7481 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
7482 int mon_cur, int mon_top)
7486 /* Display lines until done */
7487 for (i = 0; i < per_page && mon_idx[mon_top + i]; i++)
7491 /* Get the race index */
7492 int r_idx = mon_idx[mon_top + i] ;
7494 /* Access the race */
7495 monster_race *r_ptr = &r_info[r_idx];
7498 /* Choose a color */
7499 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
7501 /* Display the name */
7502 c_prt(attr, (r_name + r_ptr->name), row + i, col);
7504 /* Hack -- visual_list mode */
7507 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, 60);
7509 else if (p_ptr->wizard)
7511 c_prt(attr, format("%d", r_idx), row + i, 60);
7514 /* Display symbol */
7515 Term_putch(70, row + i, r_ptr->x_attr, r_ptr->x_char);
7519 if (r_ptr->x_attr & 0x80)
7520 Term_putch(70 + 1, row + i, 255, -1);
7522 Term_putch(70 + 1, row + i, 0, ' ');
7527 if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
7529 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 73);
7531 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "dead" : "alive"), row + i, 73);
7536 /* Clear remaining lines */
7537 for (; i < per_page; i++)
7539 Term_erase(col, row + i, 255);
7545 * Display known monsters.
7547 static void do_cmd_knowledge_monsters(void)
7550 int grp_cur, grp_top, old_grp_cur;
7551 int mon_cur, mon_top;
7552 int grp_cnt, grp_idx[100];
7560 bool visual_list = FALSE;
7561 byte attr_top = 0, char_left = 0;
7567 Term_get_size(&wid, &hgt);
7569 browser_rows = hgt - 8;
7571 /* Allocate the "mon_idx" array */
7572 C_MAKE(mon_idx, max_r_idx, s16b);
7577 /* Check every group */
7578 for (i = 0; monster_group_text[i] != NULL; i++)
7580 /* Measure the label */
7581 len = strlen(monster_group_text[i]);
7583 /* Save the maximum length */
7584 if (len > max) max = len;
7586 /* See if any monsters are known */
7587 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, 0x01))
7589 /* Build a list of groups with known monsters */
7590 grp_idx[grp_cnt++] = i;
7594 /* Terminate the list */
7595 grp_idx[grp_cnt] = -1;
7598 grp_cur = grp_top = 0;
7599 mon_cur = mon_top = 0;
7608 monster_race *r_ptr;
7615 prt("Ãμ± - ¥â¥ó¥¹¥¿¡¼", 2, 0);
7616 prt("¥°¥ë¡¼¥×", 4, 0);
7617 prt("̾Á°", 4, max + 3);
7618 if (p_ptr->wizard) prt("Idx", 4, 60);
7619 prt("ʸ»ú »¦³²¿ô", 4, 67);
7621 prt("Knowledge - Monsters", 2, 0);
7623 prt("Name", 4, max + 3);
7624 if (p_ptr->wizard) prt("Idx", 4, 60);
7625 prt("Sym Kills", 4, 67);
7628 for (i = 0; i < 78; i++)
7630 Term_putch(i, 5, TERM_WHITE, '=');
7633 for (i = 0; i < browser_rows; i++)
7635 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7641 /* Scroll group list */
7642 if (grp_cur < grp_top) grp_top = grp_cur;
7643 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7645 /* Display a list of monster groups */
7646 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
7648 if (old_grp_cur != grp_cur)
7650 old_grp_cur = grp_cur;
7652 /* Get a list of monsters in the current group */
7653 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, 0x00);
7656 /* Scroll monster list */
7657 while (mon_cur < mon_top)
7658 mon_top = MAX(0, mon_top - browser_rows/2);
7659 while (mon_cur >= mon_top + browser_rows)
7660 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
7664 /* Display a list of monsters in the current group */
7665 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top);
7671 /* Display a monster name */
7672 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top);
7674 /* Display visual list below first monster */
7675 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
7680 prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
7682 prt(format("<dir>, 'r' to recall%s%s, ESC", visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
7685 /* Get the current monster */
7686 r_ptr = &r_info[mon_idx[mon_cur]];
7688 /* Mega Hack -- track this monster race */
7689 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
7691 /* Hack -- handle stuff */
7698 y = 7 + (r_ptr->x_attr - attr_top);
7699 if (use_bigtile) x = max + 3 + 2 * (r_ptr->x_char - char_left);
7700 else x = max + 3 + (r_ptr->x_char - char_left);
7702 /* Place the cursor */
7707 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7711 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
7716 /* Do visual mode command if needed */
7717 if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &r_ptr->x_attr, &r_ptr->x_char)) continue;
7730 /* Recall on screen */
7731 if (mon_idx[mon_cur])
7733 screen_roff(mon_idx[mon_cur], 0);
7744 /* Move the cursor */
7745 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
7752 /* Free the "mon_idx" array */
7753 C_KILL(mon_idx, max_r_idx, s16b);
7758 * Display the objects in a group.
7760 static void display_object_list(int col, int row, int per_page, int object_idx[],
7761 int object_cur, int object_top)
7765 /* Display lines until done */
7766 for (i = 0; i < per_page && object_idx[object_top + i]; i++)
7771 /* Get the object index */
7772 int k_idx = object_idx[object_top + i];
7774 /* Access the object */
7775 object_kind *k_ptr = &k_info[k_idx];
7777 /* Choose a color */
7778 byte attr = (k_ptr->aware ? TERM_WHITE : TERM_SLATE);
7779 byte cursor = (k_ptr->aware ? TERM_L_BLUE : TERM_BLUE);
7781 attr = ((i + object_top == object_cur) ? cursor : attr);
7784 strip_name(o_name, k_idx);
7786 /* Display the name */
7787 c_prt(attr, o_name, row + i, col);
7789 /* Hack -- visual_list mode */
7792 c_prt(attr, format("%02x/%02x", k_ptr->x_attr, k_ptr->x_char), row + i, 60);
7794 else if (p_ptr->wizard)
7796 c_prt(attr, format ("%d", k_idx), row + i, 70);
7799 a = k_ptr->flavor ? misc_to_attr[k_ptr->flavor] : k_ptr->x_attr;
7800 c = k_ptr->flavor ? misc_to_char[k_ptr->flavor] : k_ptr->x_char;
7802 /* Symbol is unknown */
7803 if (!k_ptr->aware && !p_ptr->wizard)
7809 /* Display symbol */
7810 Term_putch(76, row + i, a, c);
7815 Term_putch(76 + 1, row + i, 255, -1);
7817 Term_putch(76 + 1, row + i, 0, ' ');
7821 /* Clear remaining lines */
7822 for (; i < per_page; i++)
7824 Term_erase(col, row + i, 255);
7829 * Describe fake object
7831 static void desc_obj_fake(int k_idx)
7834 object_type object_type_body;
7836 /* Get local object */
7837 o_ptr = &object_type_body;
7839 /* Wipe the object */
7842 /* Create the artifact */
7843 object_prep(o_ptr, k_idx);
7845 /* It's fully know */
7846 o_ptr->ident |= IDENT_KNOWN;
7848 /* Track the object */
7849 /* object_actual_track(o_ptr); */
7851 /* Hack - mark as fake */
7852 /* term_obj_real = FALSE; */
7854 /* Hack -- Handle stuff */
7857 if (!screen_object(o_ptr, FALSE))
7860 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
7862 msg_print("You see nothing special.");
7871 * Display known objects
7873 static void do_cmd_knowledge_objects(void)
7876 int grp_cur, grp_top, old_grp_cur;
7877 int object_old, object_cur, object_top;
7878 int grp_cnt, grp_idx[100];
7886 bool visual_list = FALSE;
7887 byte attr_top = 0, char_left = 0;
7893 Term_get_size(&wid, &hgt);
7895 browser_rows = hgt - 8;
7897 /* Allocate the "object_idx" array */
7898 C_MAKE(object_idx, max_k_idx, int);
7903 /* Check every group */
7904 for (i = 0; object_group_text[i] != NULL; i++)
7906 /* Measure the label */
7907 len = strlen(object_group_text[i]);
7909 /* Save the maximum length */
7910 if (len > max) max = len;
7912 /* See if any monsters are known */
7913 if (collect_objects(i, object_idx))
7915 /* Build a list of groups with known monsters */
7916 grp_idx[grp_cnt++] = i;
7920 /* Terminate the list */
7921 grp_idx[grp_cnt] = -1;
7924 grp_cur = grp_top = 0;
7925 object_cur = object_top = 0;
7942 prt("Ãμ± - ¥¢¥¤¥Æ¥à", 2, 0);
7943 prt("¥°¥ë¡¼¥×", 4, 0);
7944 prt("̾Á°", 4, max + 3);
7945 if (p_ptr->wizard) prt("Idx", 4, 70);
7948 prt("Knowledge - objects", 2, 0);
7950 prt("Name", 4, max + 3);
7951 if (p_ptr->wizard) prt("Idx", 4, 70);
7955 for (i = 0; i < 78; i++)
7957 Term_putch(i, 5, TERM_WHITE, '=');
7960 for (i = 0; i < browser_rows; i++)
7962 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7968 /* Scroll group list */
7969 if (grp_cur < grp_top) grp_top = grp_cur;
7970 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7972 /* Display a list of object groups */
7973 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
7975 if (old_grp_cur != grp_cur)
7977 old_grp_cur = grp_cur;
7979 /* Get a list of objects in the current group */
7980 object_cnt = collect_objects(grp_idx[grp_cur], object_idx);
7983 /* Scroll object list */
7984 while (object_cur < object_top)
7985 object_top = MAX(0, object_top - browser_rows/2);
7986 while (object_cur >= object_top + browser_rows)
7987 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
7991 /* Display a list of objects in the current group */
7992 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top);
7996 object_top = object_cur;
7998 /* Display a list of objects in the current group */
7999 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top);
8001 /* Display visual list below first object */
8002 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8007 prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
8009 prt(format("<dir>, 'r' to recall%s%s, ESC", visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
8012 /* Get the current object */
8013 k_ptr = &k_info[object_idx[object_cur]];
8015 /* Mega Hack -- track this object */
8016 if (object_cnt) object_kind_track(object_idx[object_cur]);
8018 /* The "current" object changed */
8019 if (object_old != object_idx[object_cur])
8021 /* Hack -- handle stuff */
8024 /* Remember the "current" object */
8025 object_old = object_idx[object_cur];
8032 y = 7 + (k_ptr->x_attr - attr_top);
8033 if (use_bigtile) x = max + 3 + 2 * (k_ptr->x_char - char_left);
8034 else x = max + 3 + (k_ptr->x_char - char_left);
8036 /* Place the cursor */
8041 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8045 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
8050 /* Do visual mode command if needed */
8051 /* Symbol of objects with flavor cannot be changed */
8052 if (!k_ptr->flavor && visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &k_ptr->x_attr, &k_ptr->x_char)) continue;
8065 /* Recall on screen */
8067 desc_obj_fake(object_idx[object_cur]);
8075 /* Move the cursor */
8076 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
8082 /* Free the "object_idx" array */
8083 C_KILL(object_idx, max_k_idx, int);
8089 * Display the features in a group.
8091 static void display_feature_list(int col, int row, int per_page, int *feat_idx,
8092 int feat_cur, int feat_top)
8096 /* Display lines until done */
8097 for (i = 0; i < per_page && feat_idx[feat_top + i]; i++)
8102 int f_idx = feat_idx[feat_top + i];
8104 /* Access the index */
8105 feature_type *f_ptr = &f_info[f_idx];
8107 /* Choose a color */
8108 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
8110 /* Display the name */
8111 c_prt(attr, f_name + f_ptr->name, row + i, col);
8113 /* Hack -- visual_list mode */
8116 c_prt(attr, format("%02x/%02x", f_ptr->x_attr, f_ptr->x_char), row + i, 60);
8119 /* Display symbol */
8120 Term_putch(68, row + i, f_ptr->x_attr, f_ptr->x_char);
8124 if (f_ptr->x_attr & 0x80)
8125 Term_putch(68 + 1, row + i, 255, -1);
8127 Term_putch(68 + 1, row + i, 0, ' ');
8131 /* Clear remaining lines */
8132 for (; i < per_page; i++)
8134 Term_erase(col, row + i, 255);
8140 * Interact with feature visuals.
8142 static void do_cmd_knowledge_features(void)
8145 int grp_cur, grp_top, old_grp_cur;
8146 int feat_cur, feat_top;
8147 int grp_cnt, grp_idx[100];
8155 bool visual_list = FALSE;
8156 byte attr_top = 0, char_left = 0;
8162 Term_get_size(&wid, &hgt);
8164 browser_rows = hgt - 8;
8166 /* Allocate the "feat_idx" array */
8167 C_MAKE(feat_idx, max_f_idx, int);
8172 /* Check every group */
8173 for (i = 0; feature_group_text[i] != NULL; i++)
8175 /* Measure the label */
8176 len = strlen(feature_group_text[i]);
8178 /* Save the maximum length */
8179 if (len > max) max = len;
8181 /* See if any features are known */
8182 if (collect_features(i, feat_idx))
8184 /* Build a list of groups with known features */
8185 grp_idx[grp_cnt++] = i;
8189 /* Terminate the list */
8190 grp_idx[grp_cnt] = -1;
8193 grp_cur = grp_top = 0;
8194 feat_cur = feat_top = 0;
8200 while ((!flag) && (grp_cnt))
8203 feature_type *f_ptr;
8209 prt("Visuals - features", 2, 0);
8211 prt("Name", 4, max + 3);
8214 for (i = 0; i < 78; i++)
8216 Term_putch(i, 5, TERM_WHITE, '=');
8219 for (i = 0; i < browser_rows; i++)
8221 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8227 /* Scroll group list */
8228 if (grp_cur < grp_top) grp_top = grp_cur;
8229 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8231 /* Display a list of feature groups */
8232 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
8234 if (old_grp_cur != grp_cur)
8236 old_grp_cur = grp_cur;
8238 /* Get a list of features in the current group */
8239 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx);
8242 /* Scroll feature list */
8243 while (feat_cur < feat_top)
8244 feat_top = MAX(0, feat_top - browser_rows/2);
8245 while (feat_cur >= feat_top + browser_rows)
8246 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
8250 /* Display a list of features in the current group */
8251 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top);
8255 feat_top = feat_cur;
8257 /* Display a list of features in the current group */
8258 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top);
8260 /* Display visual list below first object */
8261 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8266 prt(format("<Êý¸þ>%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
8268 prt(format("<dir>%s%s, ESC", visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
8271 /* Get the current feature */
8272 f_ptr = &f_info[feat_idx[feat_cur]];
8278 y = 7 + (f_ptr->x_attr - attr_top);
8279 if (use_bigtile) x = max + 3 + 2 * (f_ptr->x_char - char_left);
8280 else x = max + 3 + (f_ptr->x_char - char_left);
8282 /* Place the cursor */
8287 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8291 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
8296 /* Do visual mode command if needed */
8297 if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &f_ptr->x_attr, &f_ptr->x_char)) continue;
8309 /* Move the cursor */
8310 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
8317 if (!grp_cnt) msg_print("No features known.");
8319 /* Free the "feat_idx" array */
8320 C_KILL(feat_idx, max_f_idx, int);
8325 * List wanted monsters
8327 static void do_cmd_knowledge_kubi(void)
8332 char file_name[1024];
8335 /* Open a new file */
8336 fff = my_fopen_temp(file_name, 1024);
8339 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8341 msg_format("Failed to create temporary file %s.", file_name);
8350 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
8352 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
8354 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
8356 fprintf(fff, "List of wanted monsters\n");
8358 for (i = 0; i < MAX_KUBI; i++)
8360 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
8361 if (kubi_r_idx[i] > 10000)
8363 fprintf(fff, "ºÑ\n");
8365 fprintf(fff, "done\n");
8368 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
8372 /* Close the file */
8375 /* Display the file contents */
8377 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
8379 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
8383 /* Remove the file */
8388 * List virtues & status
8390 static void do_cmd_knowledge_virtues(void)
8394 char file_name[1024];
8397 /* Open a new file */
8398 fff = my_fopen_temp(file_name, 1024);
8401 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8403 msg_format("Failed to create temporary file %s.", file_name);
8412 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
8414 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
8419 /* Close the file */
8422 /* Display the file contents */
8424 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
8426 show_file(TRUE, file_name, "Virtues", 0, 0);
8430 /* Remove the file */
8438 static void do_cmd_knowledge_dungeon(void)
8442 char file_name[1024];
8446 /* Open a new file */
8447 fff = my_fopen_temp(file_name, 1024);
8450 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8452 msg_format("Failed to create temporary file %s.", file_name);
8460 for (i = 1; i < max_d_idx; i++)
8464 if (!d_info[i].maxdepth) continue;
8465 if (!max_dlv[i]) continue;
8466 if (d_info[i].final_guardian)
8468 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
8470 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
8472 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
8474 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
8479 /* Close the file */
8482 /* Display the file contents */
8484 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
8486 show_file(TRUE, file_name, "Dungeon", 0, 0);
8490 /* Remove the file */
8495 * List virtues & status
8498 static void do_cmd_knowledge_stat(void)
8502 char file_name[1024];
8505 /* Open a new file */
8506 fff = my_fopen_temp(file_name, 1024);
8509 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8511 msg_format("Failed to create temporary file %s.", file_name);
8519 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
8520 (2 * p_ptr->hitdie +
8521 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
8524 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
8525 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
8526 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
8528 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
8529 else fprintf(fff, "Your current Life Rating is ???.\n\n");
8530 fprintf(fff, "Limits of maximum stats\n\n");
8532 for (v_nr = 0; v_nr < 6; v_nr++)
8534 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);
8535 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
8541 /* Close the file */
8544 /* Display the file contents */
8546 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
8548 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
8552 /* Remove the file */
8558 * Print quest status of all active quests
8560 static void do_cmd_knowledge_quests(void)
8563 char file_name[1024];
8565 char rand_tmp_str[120] = "\0";
8567 monster_race *r_ptr;
8569 int rand_level = 100;
8572 /* Open a new file */
8573 fff = my_fopen_temp(file_name, 1024);
8576 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8578 msg_format("Failed to create temporary file %s.", file_name);
8585 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
8587 fprintf(fff, "< Current Quest >\n");
8590 for (i = 1; i < max_quests; i++)
8592 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
8597 /* Clear the text */
8598 for (j = 0; j < 10; j++)
8600 quest_text[j][0] = '\0';
8603 quest_text_line = 0;
8605 /* Set the quest number temporary */
8606 old_quest = p_ptr->inside_quest;
8607 p_ptr->inside_quest = i;
8609 /* Get the quest text */
8610 init_flags = INIT_SHOW_TEXT;
8612 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8614 /* Reset the old quest number */
8615 p_ptr->inside_quest = old_quest;
8617 /* No info from "silent" quests */
8618 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8622 if (quest[i].type != QUEST_TYPE_RANDOM)
8624 char note[80] = "\0";
8626 if (quest[i].status == QUEST_STATUS_TAKEN)
8628 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
8630 r_ptr = &r_info[quest[i].r_idx];
8631 strcpy(name, r_name + r_ptr->name);
8632 if (quest[i].max_num > 1)
8635 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8638 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
8643 sprintf(note," - %s¤òÅݤ¹¡£",name);
8645 sprintf(note," - kill %s.",name);
8648 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
8651 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
8653 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
8656 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
8658 strcpy(name, a_name + a_info[quest[i].k_idx].name);
8660 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
8662 sprintf(note," - Find out %s.", name);
8665 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
8667 sprintf(note," - õº÷¤¹¤ë¡£");
8669 sprintf(note," - Search.");
8671 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
8673 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
8675 sprintf(note," - Kill all monsters.");
8679 /* Print the quest info */
8681 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
8682 quest[i].name, quest[i].level, note);
8684 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
8685 quest[i].name, quest[i].level, note);
8688 fprintf(fff, tmp_str);
8690 if (quest[i].status == QUEST_STATUS_COMPLETED)
8693 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
8695 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
8698 fprintf(fff, tmp_str);
8704 while (quest_text[j][0] && j < 10)
8706 fprintf(fff, " %s\n", quest_text[j]);
8711 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
8712 (quest[i].level < rand_level))
8715 rand_level = quest[i].level;
8717 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
8719 /* Print the quest info */
8720 r_ptr = &r_info[quest[i].r_idx];
8721 strcpy(name, r_name + r_ptr->name);
8723 if (quest[i].max_num > 1)
8726 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
8727 quest[i].name, quest[i].level,
8728 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8732 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
8733 quest[i].name, quest[i].level,
8734 quest[i].max_num, name, quest[i].cur_num);
8740 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
8741 quest[i].name, quest[i].level, name);
8743 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
8744 quest[i].name, quest[i].level, name);
8752 /* Print the current random quest */
8753 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
8756 if (!total) fprintf(fff, "¤Ê¤·\n");
8758 if (!total) fprintf(fff, "Nothing.\n");
8762 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8764 fprintf(fff, "\n< Completed Quest >\n");
8767 for (i = 1; i < max_quests; i++)
8769 if (quest[i].status == QUEST_STATUS_FINISHED)
8771 if (i < MIN_RANDOM_QUEST)
8775 /* Set the quest number temporary */
8776 old_quest = p_ptr->inside_quest;
8777 p_ptr->inside_quest = i;
8780 init_flags = INIT_ASSIGN;
8782 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8784 /* Reset the old quest number */
8785 p_ptr->inside_quest = old_quest;
8787 /* No info from "silent" quests */
8788 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8793 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8795 /* Print the quest info */
8797 if (quest[i].complev == 0)
8801 "%s (%d³¬) - ÉÔÀᄀ\n",
8803 "%s (Dungeon level: %d) - (Cancelled)\n",
8805 r_name+r_info[quest[i].r_idx].name,
8812 "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8814 "%s (Dungeon level: %d) - level %d\n",
8816 r_name+r_info[quest[i].r_idx].name,
8823 /* Print the quest info */
8825 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8826 quest[i].name, quest[i].level, quest[i].complev);
8828 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8829 quest[i].name, quest[i].level, quest[i].complev);
8833 fprintf(fff, tmp_str);
8837 if (!total) fprintf(fff, "¤Ê¤·\n");
8839 if (!total) fprintf(fff, "Nothing.\n");
8843 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8845 fprintf(fff, "\n< Failed Quest >\n");
8848 for (i = 1; i < max_quests; i++)
8850 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
8852 if (i < MIN_RANDOM_QUEST)
8856 /* Set the quest number temporary */
8857 old_quest = p_ptr->inside_quest;
8858 p_ptr->inside_quest = i;
8860 /* Get the quest text */
8861 init_flags = INIT_ASSIGN;
8863 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8865 /* Reset the old quest number */
8866 p_ptr->inside_quest = old_quest;
8868 /* No info from "silent" quests */
8869 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8874 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8876 /* Print the quest info */
8878 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8879 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
8881 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
8882 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
8887 /* Print the quest info */
8889 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8890 quest[i].name, quest[i].level, quest[i].complev);
8892 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8893 quest[i].name, quest[i].level, quest[i].complev);
8896 fprintf(fff, tmp_str);
8900 if (!total) fprintf(fff, "¤Ê¤·\n");
8902 if (!total) fprintf(fff, "Nothing.\n");
8905 if (p_ptr->wizard) {
8907 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
8909 fprintf(fff, "\n< Remaining Random Quest >\n");
8912 for (i = 1; i < max_quests; i++)
8914 /* No info from "silent" quests */
8915 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8917 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
8921 /* Print the quest info */
8923 sprintf(tmp_str, "%s (%d³¬, %s)\n",
8924 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8926 sprintf(tmp_str, "%s (%d, %s)\n",
8927 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8929 fprintf(fff, tmp_str);
8933 if (!total) fprintf(fff, "¤Ê¤·\n");
8935 if (!total) fprintf(fff, "Nothing.\n");
8939 /* Close the file */
8942 /* Display the file contents */
8944 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
8946 show_file(TRUE, file_name, "Quest status", 0, 0);
8950 /* Remove the file */
8959 static void do_cmd_knowledge_home(void)
8964 char file_name[1024];
8966 char o_name[MAX_NLEN];
8969 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
8971 /* Open a new file */
8972 fff = my_fopen_temp(file_name, 1024);
8975 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8977 msg_format("Failed to create temporary file %s.", file_name);
8985 /* Print all homes in the different towns */
8986 st_ptr = &town[1].store[STORE_HOME];
8988 /* Home -- if anything there */
8989 if (st_ptr->stock_num)
8991 /* Header with name of the town */
8993 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
8995 fprintf(fff, " [Home Inventory]\n");
8999 /* Dump all available items */
9000 for (i = 0; i < st_ptr->stock_num; i++)
9003 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
9004 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
9005 if (strlen(o_name) <= 80-3)
9007 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9013 for (n = 0, t = o_name; n < 80-3; n++, t++)
9014 if(iskanji(*t)) {t++; n++;}
9015 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
9017 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
9018 fprintf(fff, " %.77s\n", o_name+n);
9021 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
9022 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9027 /* Add an empty line */
9028 fprintf(fff, "\n\n");
9032 /* Close the file */
9035 /* Display the file contents */
9037 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
9039 show_file(TRUE, file_name, "Home Inventory", 0, 0);
9043 /* Remove the file */
9049 * Check the status of "autopick"
9051 static void do_cmd_knowledge_autopick(void)
9055 char file_name[1024];
9057 /* Open a new file */
9058 fff = my_fopen_temp(file_name, 1024);
9063 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9065 msg_format("Failed to create temporary file %s.", file_name);
9074 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
9076 fprintf(fff, "No preference for auto picker/destroyer.");
9082 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
9084 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
9088 for (k = 0; k < max_autopick; k++)
9091 byte act = autopick_list[k].action;
9092 if (act & DONT_AUTOPICK)
9100 else if (act & DO_AUTODESTROY)
9108 else if (act & DO_AUTOPICK)
9116 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
9125 if (act & DO_DISPLAY)
9126 fprintf(fff, "%11s", format("[%s]", tmp));
9128 fprintf(fff, "%11s", format("(%s)", tmp));
9130 tmp = autopick_line_from_entry(&autopick_list[k]);
9131 fprintf(fff, " %s", tmp);
9135 /* Close the file */
9137 /* Display the file contents */
9139 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
9141 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
9144 /* Remove the file */
9150 * Interact with "knowledge"
9152 void do_cmd_knowledge(void)
9155 /* File type is "TEXT" */
9156 FILE_TYPE(FILE_TYPE_TEXT);
9157 /* Save the screen */
9159 /* Interact until done */
9164 /* Ask for a choice */
9166 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
9167 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
9169 prt(format("page %d/2", (p+1)), 2, 65);
9170 prt("Display current knowledge", 3, 0);
9173 /* Give some choices */
9176 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
9177 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
9178 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
9179 prt("(4) ´ûÃΤΥâ¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
9180 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
9181 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
9182 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
9183 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
9184 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
9186 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
9187 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
9188 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
9189 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
9190 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
9191 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
9192 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
9193 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
9194 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
9198 prt("(1) Display known artifacts", 6, 5);
9199 prt("(2) Display known objects", 7, 5);
9200 prt("(3) Display remaining uniques", 8, 5);
9201 prt("(4) Display known monster", 9, 5);
9202 prt("(5) Display kill count", 10, 5);
9203 prt("(6) Display wanted monsters", 11, 5);
9204 prt("(7) Display current pets", 12, 5);
9205 prt("(8) Display home inventory", 13, 5);
9206 prt("(9) Display *identified* equip.", 14, 5);
9208 prt("(a) Display about yourself", 6, 5);
9209 prt("(b) Display mutations", 7, 5);
9210 prt("(c) Display weapon proficiency", 8, 5);
9211 prt("(d) Display spell proficiency", 9, 5);
9212 prt("(e) Display misc. proficiency", 10, 5);
9213 prt("(f) Display virtues", 11, 5);
9214 prt("(g) Display dungeons", 12, 5);
9215 prt("(h) Display current quests", 13, 5);
9216 prt("(i) Display auto pick/destroy", 14, 5);
9221 prt("-³¤¯-", 16, 8);
9222 prt("ESC) È´¤±¤ë", 21, 1);
9223 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
9224 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
9225 prt("¥³¥Þ¥ó¥É:", 20, 0);
9227 prt("-more-", 16, 8);
9228 prt("ESC) Exit menu", 21, 1);
9229 prt("SPACE) Next page", 21, 30);
9230 /*prt("-) Previous page", 21, 60);*/
9231 prt("Command: ", 20, 0);
9237 if (i == ESCAPE) break;
9240 case ' ': /* Page change */
9244 case '1': /* Artifacts */
9245 do_cmd_knowledge_artifacts();
9247 case '2': /* Objects */
9248 do_cmd_knowledge_objects();
9250 case '3': /* Uniques */
9251 do_cmd_knowledge_uniques();
9253 case '4': /* Monsters */
9254 do_cmd_knowledge_monsters();
9256 case '5': /* Kill count */
9257 do_cmd_knowledge_kill_count();
9259 case '6': /* wanted */
9260 do_cmd_knowledge_kubi();
9262 case '7': /* Pets */
9263 do_cmd_knowledge_pets();
9265 case '8': /* Home */
9266 do_cmd_knowledge_home();
9268 case '9': /* Resist list */
9269 do_cmd_knowledge_inven();
9271 case '0': /* Feature list */
9272 do_cmd_knowledge_features();
9275 case 'a': /* Max stat */
9276 do_cmd_knowledge_stat();
9278 case 'b': /* Mutations */
9279 do_cmd_knowledge_mutations();
9281 case 'c': /* weapon-exp */
9282 do_cmd_knowledge_weapon_exp();
9284 case 'd': /* spell-exp */
9285 do_cmd_knowledge_spell_exp();
9287 case 'e': /* skill-exp */
9288 do_cmd_knowledge_skill_exp();
9290 case 'f': /* Virtues */
9291 do_cmd_knowledge_virtues();
9293 case 'g': /* Dungeon */
9294 do_cmd_knowledge_dungeon();
9296 case 'h': /* Quests */
9297 do_cmd_knowledge_quests();
9299 case 'i': /* Autopick */
9300 do_cmd_knowledge_autopick();
9302 default: /* Unknown option */
9305 /* Flush messages */
9308 /* Restore the screen */
9314 * Check on the status of an active quest
9316 void do_cmd_checkquest(void)
9318 /* File type is "TEXT" */
9319 FILE_TYPE(FILE_TYPE_TEXT);
9321 /* Save the screen */
9325 do_cmd_knowledge_quests();
9327 /* Restore the screen */
9333 * Display the time and date
9335 void do_cmd_time(void)
9337 int day, hour, min, full, start, end, num;
9344 extract_day_hour_min(&day, &hour, &min);
9346 full = hour * 100 + min;
9354 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
9356 strcpy(desc, "It is a strange time.");
9362 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
9363 day, (hour % 12 == 0) ? 12 : (hour % 12),
9364 min, (hour < 12) ? "AM" : "PM");
9366 msg_format("This is day %d. The time is %d:%02d %s.",
9367 day, (hour % 12 == 0) ? 12 : (hour % 12),
9368 min, (hour < 12) ? "AM" : "PM");
9373 if (!randint0(10) || p_ptr->image)
9376 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
9378 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
9385 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
9387 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
9392 /* Open this file */
9393 fff = my_fopen(buf, "rt");
9398 /* Find this time */
9399 while (!my_fgets(fff, buf, sizeof(buf)))
9401 /* Ignore comments */
9402 if (!buf[0] || (buf[0] == '#')) continue;
9404 /* Ignore invalid lines */
9405 if (buf[1] != ':') continue;
9407 /* Process 'Start' */
9410 /* Extract the starting time */
9411 start = atoi(buf + 2);
9413 /* Assume valid for an hour */
9423 /* Extract the ending time */
9424 end = atoi(buf + 2);
9430 /* Ignore incorrect range */
9431 if ((start > full) || (full > end)) continue;
9433 /* Process 'Description' */
9438 /* Apply the randomizer */
9439 if (!randint0(num)) strcpy(desc, buf + 2);
9449 /* Close the file */