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);
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)
3431 const char *empty_symbol = "<< ? >>";
3433 if (use_bigtile) empty_symbol = "<< ?? >>";
3435 /* File type is "TEXT" */
3436 FILE_TYPE(FILE_TYPE_TEXT);
3439 /* Save the screen */
3443 /* Interact until done */
3449 /* Ask for a choice */
3451 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3453 prt("Interact with Visuals", 2, 0);
3457 /* Give some choices */
3459 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3461 prt("(1) Load a user pref file", 4, 5);
3464 #ifdef ALLOW_VISUALS
3466 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3467 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3468 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3469 prt("(5) (̤»ÈÍÑ)", 8, 5);
3470 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3471 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3472 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3473 prt("(9) (̤»ÈÍÑ)", 12, 5);
3475 prt("(2) Dump monster attr/chars", 5, 5);
3476 prt("(3) Dump object attr/chars", 6, 5);
3477 prt("(4) Dump feature attr/chars", 7, 5);
3478 prt("(5) (unused)", 8, 5);
3479 prt("(6) Change monster attr/chars", 9, 5);
3480 prt("(7) Change object attr/chars", 10, 5);
3481 prt("(8) Change feature attr/chars", 11, 5);
3482 prt("(9) (unused)", 12, 5);
3487 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3489 prt("(0) Reset visuals", 13, 5);
3495 prt("¥³¥Þ¥ó¥É:", 18, 0);
3497 prt("Command: ", 15, 0);
3505 if (i == ESCAPE) break;
3507 /* Load a 'pref' file */
3512 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3514 prt("Command: Load a user pref file", 15, 0);
3520 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3522 prt("File: ", 17, 0);
3526 /* Default filename */
3527 sprintf(tmp, "%s.prf", player_name);
3530 if (!askfor_aux(tmp, 70)) continue;
3532 /* Process the given filename */
3533 (void)process_pref_file(tmp);
3536 #ifdef ALLOW_VISUALS
3538 /* Dump monster attr/chars */
3541 static cptr mark = "Monster attr/chars";
3546 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3548 prt("Command: Dump monster attr/chars", 15, 0);
3554 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3556 prt("File: ", 17, 0);
3560 /* Default filename */
3561 sprintf(tmp, "%s.prf", player_name);
3563 /* Get a filename */
3564 if (!askfor_aux(tmp, 70)) continue;
3566 /* Build the filename */
3567 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3569 /* Append to the file */
3570 fff = open_auto_dump(buf, mark, &line_num);
3575 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3577 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3582 for (i = 1; i < max_r_idx; i++)
3584 monster_race *r_ptr = &r_info[i];
3586 /* Skip non-entries */
3587 if (!r_ptr->name) continue;
3589 /* Dump a comment */
3590 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3593 /* Dump the monster attr/char info */
3594 fprintf(fff, "R:%d:0x%02X/0x%02X\n\n", i,
3595 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3600 close_auto_dump(fff, mark, line_num);
3604 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3606 msg_print("Dumped monster attr/chars.");
3611 /* Dump object attr/chars */
3614 static cptr mark = "Object attr/chars";
3619 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3621 prt("Command: Dump object attr/chars", 15, 0);
3627 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3629 prt("File: ", 17, 0);
3633 /* Default filename */
3634 sprintf(tmp, "%s.prf", player_name);
3636 /* Get a filename */
3637 if (!askfor_aux(tmp, 70)) continue;
3639 /* Build the filename */
3640 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3642 /* Append to the file */
3643 fff = open_auto_dump(buf, mark, &line_num);
3648 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3650 fprintf(fff, "\n# Object attr/char definitions\n\n");
3655 for (i = 1; i < max_k_idx; i++)
3658 object_kind *k_ptr = &k_info[i];
3660 /* Skip non-entries */
3661 if (!k_ptr->name) continue;
3663 /* Skip entries with flavor */
3664 if (k_ptr->flavor) continue;
3667 strip_name(o_name, i);
3669 /* Dump a comment */
3670 fprintf(fff, "# %s\n", o_name);
3673 /* Dump the object attr/char info */
3674 fprintf(fff, "K:%d:0x%02X/0x%02X\n\n", i,
3675 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3680 close_auto_dump(fff, mark, line_num);
3684 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3686 msg_print("Dumped object attr/chars.");
3691 /* Dump feature attr/chars */
3694 static cptr mark = "Feature attr/chars";
3699 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3701 prt("Command: Dump feature attr/chars", 15, 0);
3707 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3709 prt("File: ", 17, 0);
3713 /* Default filename */
3714 sprintf(tmp, "%s.prf", player_name);
3716 /* Get a filename */
3717 if (!askfor_aux(tmp, 70)) continue;
3719 /* Build the filename */
3720 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3722 /* Append to the file */
3723 fff = open_auto_dump(buf, mark, &line_num);
3728 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3730 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3735 for (i = 1; i < max_f_idx; i++)
3737 feature_type *f_ptr = &f_info[i];
3739 /* Skip non-entries */
3740 if (!f_ptr->name) continue;
3742 /* Skip mimiccing features */
3743 if (f_ptr->mimic != i) continue;
3745 /* Dump a comment */
3746 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3749 /* Dump the feature attr/char info */
3750 fprintf(fff, "F:%d:0x%02X/0x%02X\n\n", i,
3751 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3756 close_auto_dump(fff, mark, line_num);
3760 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3762 msg_print("Dumped feature attr/chars.");
3767 /* Modify monster attr/chars */
3774 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3776 prt("Command: Change monster attr/chars", 15, 0);
3780 /* Hack -- query until done */
3783 monster_race *r_ptr = &r_info[r];
3788 byte da = (r_ptr->d_attr);
3789 byte dc = (r_ptr->d_char);
3790 byte ca = (r_ptr->x_attr);
3791 byte cc = (r_ptr->x_char);
3793 /* Label the object */
3795 Term_putstr(5, 17, -1, TERM_WHITE,
3796 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3797 r, (r_name + r_ptr->name)));
3799 Term_putstr(5, 17, -1, TERM_WHITE,
3800 format("Monster = %d, Name = %-40.40s",
3801 r, (r_name + r_ptr->name)));
3805 /* Label the Default values */
3807 Term_putstr(10, 19, -1, TERM_WHITE,
3808 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3810 Term_putstr(10, 19, -1, TERM_WHITE,
3811 format("Default attr/char = %3u / %3u", da, dc));
3814 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3818 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
3820 Term_putch(43, 19, a, c);
3821 if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
3823 /* Label the Current values */
3825 Term_putstr(10, 20, -1, TERM_WHITE,
3826 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3828 Term_putstr(10, 20, -1, TERM_WHITE,
3829 format("Current attr/char = %3u / %3u", ca, cc));
3832 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3836 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
3838 Term_putch(43, 20, a, c);
3839 if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
3844 Term_putstr(0, 22, -1, TERM_WHITE,
3845 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3847 Term_putstr(0, 22, -1, TERM_WHITE,
3848 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3855 if (i == ESCAPE) break;
3857 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3858 else if (isupper(i)) c = 'a' + i - 'A';
3864 cmd_visuals_aux(i, &r, max_r_idx);
3867 t = (int)r_ptr->x_attr;
3868 cmd_visuals_aux(i, &t, 256);
3869 r_ptr->x_attr = (byte)t;
3872 t = (int)r_ptr->x_char;
3873 cmd_visuals_aux(i, &t, 256);
3874 r_ptr->x_char = (byte)t;
3880 /* Modify object attr/chars */
3887 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3889 prt("Command: Change object attr/chars", 15, 0);
3893 /* Hack -- query until done */
3896 object_kind *k_ptr = &k_info[k];
3901 byte da = (byte)k_ptr->d_attr;
3902 byte dc = (byte)k_ptr->d_char;
3903 byte ca = (byte)k_ptr->x_attr;
3904 byte cc = (byte)k_ptr->x_char;
3906 /* Label the object */
3908 Term_putstr(5, 17, -1, TERM_WHITE,
3909 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3910 k, (k_name + k_ptr->name)));
3912 Term_putstr(5, 17, -1, TERM_WHITE,
3913 format("Object = %d, Name = %-40.40s",
3914 k, (k_name + k_ptr->name)));
3918 /* Label the Default values */
3920 Term_putstr(10, 19, -1, TERM_WHITE,
3921 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3923 Term_putstr(10, 19, -1, TERM_WHITE,
3924 format("Default attr/char = %3d / %3d", da, dc));
3927 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
3930 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
3932 Term_putch(43, 19, a, c);
3933 if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
3936 /* Label the Current values */
3938 Term_putstr(10, 20, -1, TERM_WHITE,
3939 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3941 Term_putstr(10, 20, -1, TERM_WHITE,
3942 format("Current attr/char = %3d / %3d", ca, cc));
3945 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
3948 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
3950 Term_putch(43, 20, a, c);
3951 if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
3956 Term_putstr(0, 22, -1, TERM_WHITE,
3957 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3959 Term_putstr(0, 22, -1, TERM_WHITE,
3960 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3967 if (i == ESCAPE) break;
3969 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3970 else if (isupper(i)) c = 'a' + i - 'A';
3976 cmd_visuals_aux(i, &k, max_k_idx);
3979 t = (int)k_info[k].x_attr;
3980 cmd_visuals_aux(i, &t, 256);
3981 k_info[k].x_attr = (byte)t;
3984 t = (int)k_info[k].x_char;
3985 cmd_visuals_aux(i, &t, 256);
3986 k_info[k].x_char = (byte)t;
3992 /* Modify feature attr/chars */
3999 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
4001 prt("Command: Change feature attr/chars", 15, 0);
4005 /* Hack -- query until done */
4008 feature_type *f_ptr = &f_info[f];
4013 byte da = (byte)f_ptr->d_attr;
4014 byte dc = (byte)f_ptr->d_char;
4015 byte ca = (byte)f_ptr->x_attr;
4016 byte cc = (byte)f_ptr->x_char;
4018 /* Label the object */
4020 Term_putstr(5, 17, -1, TERM_WHITE,
4021 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
4022 f, (f_name + f_ptr->name)));
4024 Term_putstr(5, 17, -1, TERM_WHITE,
4025 format("Terrain = %d, Name = %-40.40s",
4026 f, (f_name + f_ptr->name)));
4030 /* Label the Default values */
4032 Term_putstr(10, 19, -1, TERM_WHITE,
4033 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4035 Term_putstr(10, 19, -1, TERM_WHITE,
4036 format("Default attr/char = %3d / %3d", da, dc));
4039 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
4042 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
4044 Term_putch(43, 19, a, c);
4045 if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
4048 /* Label the Current values */
4050 Term_putstr(10, 20, -1, TERM_WHITE,
4051 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4053 Term_putstr(10, 20, -1, TERM_WHITE,
4054 format("Current attr/char = %3d / %3d", ca, cc));
4057 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
4060 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
4062 Term_putch(43, 20, a, c);
4063 if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
4068 Term_putstr(0, 22, -1, TERM_WHITE,
4069 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
4071 Term_putstr(0, 22, -1, TERM_WHITE,
4072 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4079 if (i == ESCAPE) break;
4081 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4082 else if (isupper(i)) c = 'a' + i - 'A';
4088 cmd_visuals_aux(i, &f, max_f_idx);
4091 t = (int)f_info[f].x_attr;
4092 cmd_visuals_aux(i, &t, 256);
4093 f_info[f].x_attr = (byte)t;
4096 t = (int)f_info[f].x_char;
4097 cmd_visuals_aux(i, &t, 256);
4098 f_info[f].x_char = (byte)t;
4114 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4116 msg_print("Visual attr/char tables reset.");
4121 /* Unknown option */
4127 /* Flush messages */
4132 /* Restore the screen */
4138 * Interact with "colors"
4140 void do_cmd_colors(void)
4151 /* File type is "TEXT" */
4152 FILE_TYPE(FILE_TYPE_TEXT);
4155 /* Save the screen */
4159 /* Interact until done */
4165 /* Ask for a choice */
4167 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4169 prt("Interact with Colors", 2, 0);
4173 /* Give some choices */
4175 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4177 prt("(1) Load a user pref file", 4, 5);
4182 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4183 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4185 prt("(2) Dump colors", 5, 5);
4186 prt("(3) Modify colors", 6, 5);
4193 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4195 prt("Command: ", 8, 0);
4203 if (i == ESCAPE) break;
4205 /* Load a 'pref' file */
4210 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4212 prt("Command: Load a user pref file", 8, 0);
4218 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4220 prt("File: ", 10, 0);
4225 sprintf(tmp, "%s.prf", player_name);
4228 if (!askfor_aux(tmp, 70)) continue;
4230 /* Process the given filename */
4231 (void)process_pref_file(tmp);
4233 /* Mega-Hack -- react to changes */
4234 Term_xtra(TERM_XTRA_REACT, 0);
4236 /* Mega-Hack -- redraw */
4245 static cptr mark = "Colors";
4250 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4252 prt("Command: Dump colors", 8, 0);
4258 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4260 prt("File: ", 10, 0);
4264 /* Default filename */
4265 sprintf(tmp, "%s.prf", player_name);
4267 /* Get a filename */
4268 if (!askfor_aux(tmp, 70)) continue;
4270 /* Build the filename */
4271 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4273 /* Append to the file */
4274 fff = open_auto_dump(buf, mark, &line_num);
4279 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4281 fprintf(fff, "\n# Color redefinitions\n\n");
4286 for (i = 0; i < 256; i++)
4288 int kv = angband_color_table[i][0];
4289 int rv = angband_color_table[i][1];
4290 int gv = angband_color_table[i][2];
4291 int bv = angband_color_table[i][3];
4296 cptr name = "unknown";
4300 /* Skip non-entries */
4301 if (!kv && !rv && !gv && !bv) continue;
4303 /* Extract the color name */
4304 if (i < 16) name = color_names[i];
4306 /* Dump a comment */
4308 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4310 fprintf(fff, "# Color '%s'\n", name);
4314 /* Dump the monster attr/char info */
4315 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4321 close_auto_dump(fff, mark, line_num);
4325 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4327 msg_print("Dumped color redefinitions.");
4339 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4341 prt("Command: Modify colors", 8, 0);
4345 /* Hack -- query until done */
4354 /* Exhibit the normal colors */
4355 for (j = 0; j < 16; j++)
4357 /* Exhibit this color */
4358 Term_putstr(j*4, 20, -1, a, "###");
4360 /* Exhibit all colors */
4361 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4364 /* Describe the color */
4366 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4368 name = ((a < 16) ? color_names[a] : "undefined");
4372 /* Describe the color */
4374 Term_putstr(5, 10, -1, TERM_WHITE,
4375 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4377 Term_putstr(5, 10, -1, TERM_WHITE,
4378 format("Color = %d, Name = %s", a, name));
4382 /* Label the Current values */
4383 Term_putstr(5, 12, -1, TERM_WHITE,
4384 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4385 angband_color_table[a][0],
4386 angband_color_table[a][1],
4387 angband_color_table[a][2],
4388 angband_color_table[a][3]));
4392 Term_putstr(0, 14, -1, TERM_WHITE,
4393 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4395 Term_putstr(0, 14, -1, TERM_WHITE,
4396 "Command (n/N/k/K/r/R/g/G/b/B): ");
4404 if (i == ESCAPE) break;
4407 if (i == 'n') a = (byte)(a + 1);
4408 if (i == 'N') a = (byte)(a - 1);
4409 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4410 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4411 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4412 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4413 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4414 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4415 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4416 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4418 /* Hack -- react to changes */
4419 Term_xtra(TERM_XTRA_REACT, 0);
4421 /* Hack -- redraw */
4428 /* Unknown option */
4434 /* Flush messages */
4439 /* Restore the screen */
4445 * Note something in the message recall
4447 void do_cmd_note(void)
4456 if (!get_string("¥á¥â: ", buf, 60)) return;
4458 if (!get_string("Note: ", buf, 60)) return;
4462 /* Ignore empty notes */
4463 if (!buf[0] || (buf[0] == ' ')) return;
4465 /* Add the note to the message recall */
4467 msg_format("¥á¥â: %s", buf);
4469 msg_format("Note: %s", buf);
4476 * Mention the current version
4478 void do_cmd_version(void)
4483 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4484 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4486 msg_format("You are playing Hengband %d.%d.%d.",
4487 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4494 * Array of feeling strings
4496 static cptr do_cmd_feeling_text[11] =
4499 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4501 "Looks like any other level.",
4505 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4507 "You feel there is something special about this level.",
4511 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4513 "You nearly faint as horrible visions of death fill your mind!",
4517 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4519 "This level looks very dangerous.",
4523 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4525 "You have a very bad feeling...",
4529 "°¤¤Í½´¶¤¬¤¹¤ë...",
4531 "You have a bad feeling...",
4537 "You feel nervous.",
4541 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4543 "You feel your luck is turning...",
4547 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4549 "You don't like the look of this place.",
4553 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4555 "This level looks reasonably safe.",
4559 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4561 "What a boring place..."
4566 static cptr do_cmd_feeling_text_combat[11] =
4569 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4571 "Looks like any other level.",
4575 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4577 "You feel there is something special about this level.",
4581 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4583 "You nearly faint as horrible visions of death fill your mind!",
4587 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4589 "This level looks very dangerous.",
4593 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4595 "You have a very bad feeling...",
4599 "°¤¤Í½´¶¤¬¤¹¤ë...",
4601 "You have a bad feeling...",
4607 "You feel nervous.",
4611 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4613 "You feel your luck is turning...",
4617 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4619 "You don't like the look of this place.",
4623 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4625 "This level looks reasonably safe.",
4629 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4631 "What a boring place..."
4636 static cptr do_cmd_feeling_text_lucky[11] =
4639 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4640 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4641 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4642 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4643 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4644 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4645 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4646 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4647 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4648 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4649 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4651 "Looks like any other level.",
4652 "You feel there is something special about this level.",
4653 "You have a superb feeling about this level.",
4654 "You have an excellent feeling...",
4655 "You have a very good feeling...",
4656 "You have a good feeling...",
4657 "You feel strangely lucky...",
4658 "You feel your luck is turning...",
4659 "You like the look of this place...",
4660 "This level can't be all bad...",
4661 "What a boring place..."
4667 * Note that "feeling" is set to zero unless some time has passed.
4668 * Note that this is done when the level is GENERATED, not entered.
4670 void do_cmd_feeling(void)
4672 /* Verify the feeling */
4673 if (feeling > 10) feeling = 10;
4675 /* No useful feeling in quests */
4676 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4679 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4681 msg_print("Looks like a typical quest level.");
4687 /* No useful feeling in town */
4688 else if (p_ptr->town_num && !dun_level)
4691 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4693 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4697 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4699 msg_print("Looks like a strange wilderness.");
4707 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4709 msg_print("Looks like a typical town.");
4716 /* No useful feeling in the wilderness */
4717 else if (!dun_level)
4720 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4722 msg_print("Looks like a typical wilderness.");
4728 /* Display the feeling */
4729 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4731 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4733 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4734 msg_print(do_cmd_feeling_text_combat[feeling]);
4736 msg_print(do_cmd_feeling_text[feeling]);
4741 msg_print(do_cmd_feeling_text[0]);
4748 * Description of each monster group.
4750 static cptr monster_group_text[] =
4753 "¥æ¥Ë¡¼¥¯", /* "Uniques" */
4782 /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */
4799 /* "¾åµé¥Ç¡¼¥â¥ó", */
4837 /* "Ancient Dragon/Wyrm", */
4846 "Multi-Headed Reptile",
4851 "Reptile/Amphibian",
4852 "Spider/Scorpion/Tick",
4854 /* "Major Demon", */
4868 * Symbols of monsters in each group. Note the "Uniques" group
4869 * is handled differently.
4871 static cptr monster_group_char[] =
4932 * hook function to sort monsters by level
4934 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
4936 u16b *who = (u16b*)(u);
4941 monster_race *r_ptr1 = &r_info[w1];
4942 monster_race *r_ptr2 = &r_info[w2];
4947 if (r_ptr2->level > r_ptr1->level) return TRUE;
4948 if (r_ptr1->level > r_ptr2->level) return FALSE;
4950 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
4951 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
4956 * Build a list of monster indexes in the given group. Return the number
4957 * of monsters in the group.
4959 * mode & 0x01 : check for non-empty group
4960 * mode & 0x02 : cheat?
4962 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
4967 /* Get a list of x_char in this group */
4968 cptr group_char = monster_group_char[grp_cur];
4970 /* XXX Hack -- Check if this is the "Uniques" group */
4971 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
4973 /* Check every race */
4974 for (i = 0; i < max_r_idx; i++)
4976 /* Access the race */
4977 monster_race *r_ptr = &r_info[i];
4979 /* Skip empty race */
4980 if (!r_ptr->name) continue ;
4982 /* Require known monsters */
4983 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights ) continue;
4985 if (grp_unique && !(r_ptr->flags1 & RF1_UNIQUE)) continue;
4987 /* Check for race in the group */
4988 if (grp_unique || strchr(group_char, r_ptr->d_char))
4991 mon_idx[mon_cnt++] = i;
4993 /* XXX Hack -- Just checking for non-empty group */
4994 if (mode & 0x01) break;
4998 /* Terminate the list */
4999 mon_idx[mon_cnt] = 0;
5001 /* Select the sort method */
5002 ang_sort_comp = ang_sort_comp_monster_level;
5003 ang_sort_swap = ang_sort_swap_hook;
5005 /* Sort by monster level */
5006 ang_sort(mon_idx, &dummy_why, mon_cnt);
5008 /* Return the number of races */
5014 * Description of each monster group.
5016 static cptr object_group_text[] =
5019 "¥¥Î¥³", /* "Mushrooms" */
5020 "Ìô", /* "Potions" */
5021 "Ìý¤Ä¤Ü", /* "Flasks" */
5022 "´¬Êª", /* "Scrolls" */
5023 "»ØÎØ", /* "Rings" */
5024 "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */
5025 "ū", /* "Whistle" */
5026 "¸÷¸»", /* "Lanterns" */
5027 "ËâË¡ËÀ", /* "Wands" */
5028 "¾ó", /* "Staffs" */
5029 "¥í¥Ã¥É", /* "Rods" */
5030 "¥«¡¼¥É", /* "Cards" */
5031 "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë",
5040 "Åá·õÎà", /* "Swords" */
5041 "Æß´ï", /* "Blunt Weapons" */
5042 "ĹÊÁÉð´ï", /* "Polearms" */
5043 "ºÎ·¡Æ»¶ñ", /* "Diggers" */
5044 "Èô¤ÓÆ»¶ñ", /* "Bows" */
5048 "·ÚÁõ³»", /* "Soft Armor" */
5049 "½ÅÁõ³»", /* "Hard Armor" */
5050 "¥É¥é¥´¥ó³»", /* "Dragon Armor" */
5051 "½â", /* "Shields" */
5052 "¥¯¥í¡¼¥¯", /* "Cloaks" */
5053 "äƼê", /* "Gloves" */
5054 "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */
5055 "´§", /* "Crowns" */
5056 "¥Ö¡¼¥Ä", /* "Boots" */
5104 * TVALs of items in each group
5106 static byte object_group_tval[] =
5146 TV_LIFE_BOOK, /* Hack -- all spellbooks */
5152 * Build a list of monster indexes in the given group. Return the number
5153 * of monsters in the group.
5155 static int collect_objects(int grp_cur, int object_idx[])
5157 int i, j, k, object_cnt = 0;
5159 /* Get a list of x_char in this group */
5160 byte group_tval = object_group_tval[grp_cur];
5162 /* Check every object */
5163 for (i = 0; i < max_k_idx; i++)
5165 /* Access the race */
5166 object_kind *k_ptr = &k_info[i];
5168 /* Skip empty objects */
5169 if (!k_ptr->name) continue;
5171 /* Skip non-flavoured objects */
5172 if (!k_ptr->flavor && !p_ptr->wizard) continue;
5174 /* Skip items with no distribution (special artifacts) */
5175 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
5178 /* Require objects ever seen*/
5179 if (!k_ptr->aware && !p_ptr->wizard) continue;
5181 /* Check for race in the group */
5182 if (TV_LIFE_BOOK == group_tval)
5184 /* Hack -- All spell books */
5185 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HISSATSU_BOOK)
5188 object_idx[object_cnt++] = i;
5191 else if (k_ptr->tval == group_tval)
5194 object_idx[object_cnt++] = i;
5198 /* Terminate the list */
5199 object_idx[object_cnt] = 0;
5201 /* Return the number of races */
5207 * Description of each feature group.
5209 static cptr feature_group_text[] =
5217 * Build a list of feature indexes in the given group. Return the number
5218 * of features in the group.
5220 static int collect_features(int grp_cur, int *feat_idx)
5222 int i, feat_cnt = 0;
5224 /* Unused; There is a single group. */
5227 /* Check every feature */
5228 for (i = 1; i < max_f_idx; i++)
5230 /* Access the index */
5231 feature_type *f_ptr = &f_info[i];
5233 /* Skip empty index */
5234 if (!f_ptr->name) continue;
5236 /* Skip mimiccing features */
5237 if (f_ptr->mimic != i) continue;
5240 feat_idx[feat_cnt++] = i;
5243 /* Terminate the list */
5244 feat_idx[feat_cnt] = 0;
5246 /* Return the number of races */
5253 * Build a list of monster indexes in the given group. Return the number
5254 * of monsters in the group.
5256 static int collect_artifacts(int grp_cur, int object_idx[])
5258 int i, object_cnt = 0;
5260 /* Get a list of x_char in this group */
5261 byte group_tval = object_group_tval[grp_cur];
5263 /* Check every object */
5264 for (i = 0; i < max_a_idx; i++)
5266 /* Access the artifact */
5267 artifact_type *a_ptr = &a_info[i];
5269 /* Skip empty artifacts */
5270 if (!a_ptr->name) continue;
5272 /* Skip "uncreated" artifacts */
5273 if (!a_ptr->cur_num) continue;
5275 /* Check for race in the group */
5276 if (a_ptr->tval == group_tval)
5279 object_idx[object_cnt++] = i;
5283 /* Terminate the list */
5284 object_idx[object_cnt] = 0;
5286 /* Return the number of races */
5293 * Encode the screen colors
5295 static char hack[17] = "dwsorgbuDWvyRGBU";
5298 static errr photo_fgets(FILE *fff, char *buf, huge n)
5307 if (fgets(tmp, 1024, fff))
5309 /* Convert weirdness */
5310 for (s = tmp; *s; s++)
5312 /* Handle newline */
5323 else if (*s == '\t')
5325 /* Hack -- require room */
5326 if (i + 8 >= n) break;
5328 /* Append a space */
5331 /* Append some more spaces */
5332 while (!(i % 8)) buf[i++] = ' ';
5336 else if (iskanji(*s))
5343 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
5344 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
5351 /* Handle printables */
5372 * Hack -- load a screen dump from a file
5374 void do_cmd_load_screen(void)
5389 Term_get_size(&wid, &hgt);
5391 /* Hack -- drop permissions */
5394 /* Build the filename */
5395 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5397 /* Append to the file */
5398 fff = my_fopen(buf, "r");
5403 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5405 msg_format("Failed to open %s.", buf);
5412 /* Save the screen */
5415 /* Clear the screen */
5419 /* Load the screen */
5420 for (y = 0; okay && (y < hgt); y++)
5422 /* Get a line of data */
5423 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5426 for (x = 0; x < wid - 1; x++)
5428 /* Put the attr/char */
5429 Term_draw(x, y, TERM_WHITE, buf[x]);
5433 /* Get the blank line */
5434 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5437 /* Dump the screen */
5438 for (y = 0; okay && (y < hgt); y++)
5440 /* Get a line of data */
5441 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5444 for (x = 0; x < wid - 1; x++)
5446 /* Get the attr/char */
5447 (void)(Term_what(x, y, &a, &c));
5449 /* Look up the attr */
5450 for (i = 0; i < 16; i++)
5452 /* Use attr matches */
5453 if (hack[i] == buf[x]) a = i;
5456 /* Put the attr/char */
5457 Term_draw(x, y, a, c);
5462 /* Get the blank line */
5463 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5469 /* Hack -- grab permissions */
5475 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
5477 msg_print("Screen dump loaded.");
5484 /* Restore the screen */
5491 cptr inven_res_label =
5493 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
5495 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
5498 /* XTRA HACK RESLIST */
5499 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
5500 int *j, byte tval, char *where)
5502 char o_name[MAX_NLEN];
5503 u32b flgs[TR_FLAG_SIZE];
5505 if (!o_ptr->k_idx)return;
5506 if (o_ptr->tval != tval)return;
5509 * HACK:Ring of Lordly protection and Dragon shield/helm
5510 * have random resistances.
5512 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
5513 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
5514 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
5515 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
5516 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
5517 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
5518 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
5521 object_desc(o_name, o_ptr, TRUE, 0);
5523 while ( o_name[i] && i < 26 ){
5525 if (iskanji(o_name[i])) i++;
5529 if(i<28) while(i<28){o_name[i]=' ';i++;}
5532 fprintf(fff,"%s %s", where, o_name);
5534 if (!(o_ptr->ident & (IDENT_MENTAL)))
5537 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
5539 fprintf(fff, "-------unknown------------ -------unknown------\n");
5543 object_flags_known(o_ptr, flgs);
5546 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
5547 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
5548 else fprintf(fff,"¡¦");
5550 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
5551 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
5552 else fprintf(fff,"¡¦");
5554 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
5555 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
5556 else fprintf(fff,"¡¦");
5558 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
5559 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
5560 else fprintf(fff,"¡¦");
5562 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
5563 else fprintf(fff,"¡¦");
5565 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
5566 else fprintf(fff,"¡¦");
5568 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
5569 else fprintf(fff,"¡¦");
5571 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
5572 else fprintf(fff,"¡¦");
5574 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
5575 else fprintf(fff,"¡¦");
5577 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
5578 else fprintf(fff,"¡¦");
5580 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
5581 else fprintf(fff,"¡¦");
5583 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
5584 else fprintf(fff,"¡¦");
5586 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
5587 else fprintf(fff,"¡¦");
5591 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
5592 else fprintf(fff,"¡¦");
5594 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
5595 else fprintf(fff,"¡¦");
5597 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
5598 else fprintf(fff,"¡¦");
5600 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
5601 else fprintf(fff,"¡¦");
5603 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
5604 else fprintf(fff,"¡¦");
5606 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
5607 else fprintf(fff,"¡¦");
5609 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
5610 else fprintf(fff,"¡¦");
5612 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
5613 else fprintf(fff,"¡¦");
5616 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
5617 else fprintf(fff,"¡¦");
5619 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
5620 else fprintf(fff,"¡¦");
5622 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
5623 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
5624 else fprintf(fff,". ");
5626 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
5627 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
5628 else fprintf(fff,". ");
5630 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
5631 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
5632 else fprintf(fff,". ");
5634 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5635 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5636 else fprintf(fff,". ");
5638 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5639 else fprintf(fff,". ");
5641 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5642 else fprintf(fff,". ");
5644 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5645 else fprintf(fff,". ");
5647 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5648 else fprintf(fff,". ");
5650 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5651 else fprintf(fff,". ");
5653 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5654 else fprintf(fff,". ");
5656 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5657 else fprintf(fff,". ");
5659 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5660 else fprintf(fff,". ");
5662 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5663 else fprintf(fff,". ");
5667 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5668 else fprintf(fff,". ");
5670 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5671 else fprintf(fff,". ");
5673 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5674 else fprintf(fff,". ");
5676 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5677 else fprintf(fff,". ");
5679 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5680 else fprintf(fff,". ");
5682 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5683 else fprintf(fff,". ");
5685 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5686 else fprintf(fff,". ");
5688 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5689 else fprintf(fff,". ");
5692 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5693 else fprintf(fff,". ");
5695 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5696 else fprintf(fff,". ");
5704 fprintf(fff,"%s\n", inven_res_label);
5710 * Display *ID* ed weapons/armors's resistances
5712 static void do_cmd_knowledge_inven(void)
5717 char file_name[1024];
5728 /* Open a new file */
5729 fff = my_fopen_temp(file_name, 1024);
5732 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5734 msg_format("Failed to create temporally file %s.", file_name);
5739 fprintf(fff,"%s\n",inven_res_label);
5741 for (tval=TV_BOW; tval <= TV_RING; tval++){
5744 for (;j<9;j++) fprintf(fff, "\n");
5746 fprintf(fff,"%s\n",inven_res_label);
5750 strcpy(where, "Áõ");
5752 strcpy(where, "E ");
5754 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5756 o_ptr = &inventory[i];
5757 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5761 strcpy(where, "»ý");
5763 strcpy(where, "I ");
5765 for (i = 0; i < INVEN_PACK; i++)
5767 o_ptr = &inventory[i];
5768 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5772 /* Print all homes in the different towns */
5773 st_ptr = &town[1].store[STORE_HOME];
5775 strcpy(where, "²È");
5777 strcpy(where, "H ");
5780 /* Dump all available items */
5781 for (i = 0; i < st_ptr->stock_num; i++)
5783 o_ptr = &st_ptr->stock[i];
5784 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5788 /* Close the file */
5791 /* Display the file contents */
5793 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5795 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5798 /* Remove the file */
5803 void do_cmd_save_screen_html_aux(char *filename, int message)
5807 byte a = 0, old_a = 0;
5821 cptr html_head[] = {
5822 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5826 cptr html_foot[] = {
5828 "</body>\n</html>\n",
5834 Term_get_size(&wid, &hgt);
5836 /* File type is "TEXT" */
5837 FILE_TYPE(FILE_TYPE_TEXT);
5839 /* Append to the file */
5840 fff = my_fopen(filename, "w");
5846 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5848 msg_format("Failed to open file %s.", filename);
5856 /* Save the screen */
5860 /* Build the filename */
5861 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5862 tmpfff = my_fopen(buf, "r");
5864 for (i = 0; html_head[i]; i++)
5865 fprintf(fff, html_head[i]);
5869 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5871 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5875 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5877 fprintf(fff, "%s\n", buf);
5882 /* Dump the screen */
5883 for (y = 0; y < hgt; y++)
5890 for (x = 0; x < wid - 1; x++)
5894 /* Get the attr/char */
5895 (void)(Term_what(x, y, &a, &c));
5899 case '&': cc = "&"; break;
5900 case '<': cc = "<"; break;
5901 case '>': cc = ">"; break;
5903 case 0x1f: c = '.'; break;
5904 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5909 if ((y == 0 && x == 0) || a != old_a) {
5910 rv = angband_color_table[a][1];
5911 gv = angband_color_table[a][2];
5912 bv = angband_color_table[a][3];
5913 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5914 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5918 fprintf(fff, "%s", cc);
5920 fprintf(fff, "%c", c);
5923 fprintf(fff, "</font>");
5926 for (i = 0; html_foot[i]; i++)
5927 fprintf(fff, html_foot[i]);
5932 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5934 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5938 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5940 fprintf(fff, "%s\n", buf);
5955 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5957 msg_print("Screen dump saved.");
5962 /* Restore the screen */
5968 * Hack -- save a screen dump to a file
5970 static void do_cmd_save_screen_html(void)
5972 char buf[1024], tmp[256] = "screen.html";
5975 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5977 if (!get_string("File name: ", tmp, 80))
5981 /* Build the filename */
5982 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5986 /* Hack -- drop permissions */
5989 do_cmd_save_screen_html_aux(buf, 1);
5991 /* Hack -- grab permissions */
5997 * Redefinable "save_screen" action
5999 void (*screendump_aux)(void) = NULL;
6003 * Hack -- save a screen dump to a file
6005 void do_cmd_save_screen(void)
6007 bool old_use_graphics = use_graphics;
6008 bool html_dump = FALSE;
6013 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
6015 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
6020 if (c == 'Y' || c == 'y')
6022 else if (c == 'H' || c == 'h')
6034 Term_get_size(&wid, &hgt);
6036 if (old_use_graphics)
6038 use_graphics = FALSE;
6041 /* Redraw everything */
6042 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6044 /* Hack -- update */
6050 do_cmd_save_screen_html();
6054 /* Do we use a special screendump function ? */
6055 else if (screendump_aux)
6057 /* Dump the screen to a graphics file */
6058 (*screendump_aux)();
6060 else /* Dump the screen as text */
6072 /* Hack -- drop permissions */
6075 /* Build the filename */
6076 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
6078 /* File type is "TEXT" */
6079 FILE_TYPE(FILE_TYPE_TEXT);
6081 /* Append to the file */
6082 fff = my_fopen(buf, "w");
6087 /* Hack -- grab permissions */
6090 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
6092 msg_format("Failed to open file %s.", buf);
6099 /* Save the screen */
6103 /* Dump the screen */
6104 for (y = 0; y < hgt; y++)
6107 for (x = 0; x < wid - 1; x++)
6109 /* Get the attr/char */
6110 (void)(Term_what(x, y, &a, &c));
6120 fprintf(fff, "%s\n", buf);
6127 /* Dump the screen */
6128 for (y = 0; y < hgt; y++)
6131 for (x = 0; x < wid - 1; x++)
6133 /* Get the attr/char */
6134 (void)(Term_what(x, y, &a, &c));
6137 buf[x] = hack[a&0x0F];
6144 fprintf(fff, "%s\n", buf);
6154 /* Hack -- grab permissions */
6159 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6161 msg_print("Screen dump saved.");
6167 /* Restore the screen */
6171 if (old_use_graphics)
6173 use_graphics = TRUE;
6176 /* Redraw everything */
6177 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6179 /* Hack -- update */
6186 * Sorting hook -- Comp function -- see below
6188 * We use "u" to point to array of monster indexes,
6189 * and "v" to select the type of sorting to perform on "u".
6191 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
6193 u16b *who = (u16b*)(u);
6195 u16b *why = (u16b*)(v);
6202 /* Sort by total kills */
6205 /* Extract total kills */
6206 z1 = a_info[w1].tval;
6207 z2 = a_info[w2].tval;
6209 /* Compare total kills */
6210 if (z1 < z2) return (TRUE);
6211 if (z1 > z2) return (FALSE);
6215 /* Sort by monster level */
6218 /* Extract levels */
6219 z1 = a_info[w1].sval;
6220 z2 = a_info[w2].sval;
6222 /* Compare levels */
6223 if (z1 < z2) return (TRUE);
6224 if (z1 > z2) return (FALSE);
6228 /* Sort by monster experience */
6231 /* Extract experience */
6232 z1 = a_info[w1].level;
6233 z2 = a_info[w2].level;
6235 /* Compare experience */
6236 if (z1 < z2) return (TRUE);
6237 if (z1 > z2) return (FALSE);
6241 /* Compare indexes */
6247 * Sorting hook -- Swap function -- see below
6249 * We use "u" to point to array of monster indexes,
6250 * and "v" to select the type of sorting to perform.
6252 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
6254 u16b *who = (u16b*)(u);
6269 * Check the status of "artifacts"
6271 static void do_cmd_knowledge_artifacts(void)
6273 int i, k, z, x, y, n = 0;
6279 char file_name[1024];
6281 char base_name[MAX_NLEN];
6285 /* Open a new file */
6286 fff = my_fopen_temp(file_name, 1024);
6290 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6292 msg_format("Failed to create temporary file %s.", file_name);
6298 /* Allocate the "who" array */
6299 C_MAKE(who, max_a_idx, s16b);
6301 /* Allocate the "okay" array */
6302 C_MAKE(okay, max_a_idx, bool);
6304 /* Scan the artifacts */
6305 for (k = 0; k < max_a_idx; k++)
6307 artifact_type *a_ptr = &a_info[k];
6312 /* Skip "empty" artifacts */
6313 if (!a_ptr->name) continue;
6315 /* Skip "uncreated" artifacts */
6316 if (!a_ptr->cur_num) continue;
6322 /* Check the dungeon */
6323 for (y = 0; y < cur_hgt; y++)
6325 for (x = 0; x < cur_wid; x++)
6327 cave_type *c_ptr = &cave[y][x];
6329 s16b this_o_idx, next_o_idx = 0;
6331 /* Scan all objects in the grid */
6332 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
6336 /* Acquire object */
6337 o_ptr = &o_list[this_o_idx];
6339 /* Acquire next object */
6340 next_o_idx = o_ptr->next_o_idx;
6342 /* Ignore non-artifacts */
6343 if (!artifact_p(o_ptr)) continue;
6345 /* Ignore known items */
6346 if (object_known_p(o_ptr)) continue;
6348 /* Note the artifact */
6349 okay[o_ptr->name1] = FALSE;
6354 /* Check the inventory and equipment */
6355 for (i = 0; i < INVEN_TOTAL; i++)
6357 object_type *o_ptr = &inventory[i];
6359 /* Ignore non-objects */
6360 if (!o_ptr->k_idx) continue;
6362 /* Ignore non-artifacts */
6363 if (!artifact_p(o_ptr)) continue;
6365 /* Ignore known items */
6366 if (object_known_p(o_ptr)) continue;
6368 /* Note the artifact */
6369 okay[o_ptr->name1] = FALSE;
6372 for (k = 0; k < max_a_idx; k++)
6374 if (okay[k]) who[n++] = k;
6377 /* Select the sort method */
6378 ang_sort_comp = ang_sort_art_comp;
6379 ang_sort_swap = ang_sort_art_swap;
6381 /* Sort the array by dungeon depth of monsters */
6382 ang_sort(who, &why, n);
6384 /* Scan the artifacts */
6385 for (k = 0; k < n; k++)
6387 artifact_type *a_ptr = &a_info[who[k]];
6391 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
6393 strcpy(base_name, "Unknown Artifact");
6397 /* Obtain the base object type */
6398 z = lookup_kind(a_ptr->tval, a_ptr->sval);
6406 /* Get local object */
6409 /* Create fake object */
6410 object_prep(q_ptr, z);
6412 /* Make it an artifact */
6413 q_ptr->name1 = (byte)who[k];
6415 /* Describe the artifact */
6416 object_desc_store(base_name, q_ptr, FALSE, 0);
6419 /* Hack -- Build the artifact name */
6421 fprintf(fff, " %s\n", base_name);
6423 fprintf(fff, " The %s\n", base_name);
6428 /* Free the "who" array */
6429 C_KILL(who, max_a_idx, s16b);
6431 /* Free the "okay" array */
6432 C_KILL(okay, max_a_idx, bool);
6434 /* Close the file */
6437 /* Display the file contents */
6439 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
6441 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
6445 /* Remove the file */
6451 * Display known uniques
6453 static void do_cmd_knowledge_uniques(void)
6461 char file_name[1024];
6463 /* Open a new file */
6464 fff = my_fopen_temp(file_name, 1024);
6468 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6470 msg_format("Failed to create temporary file %s.", file_name);
6476 /* Allocate the "who" array */
6477 C_MAKE(who, max_r_idx, s16b);
6479 /* Scan the monsters */
6480 for (i = 1; i < max_r_idx; i++)
6482 monster_race *r_ptr = &r_info[i];
6484 /* Use that monster */
6485 if (r_ptr->name) who[n++] = i;
6488 /* Select the sort method */
6489 ang_sort_comp = ang_sort_comp_hook;
6490 ang_sort_swap = ang_sort_swap_hook;
6492 /* Sort the array by dungeon depth of monsters */
6493 ang_sort(who, &why, n);
6495 /* Scan the monster races */
6496 for (k = 0; k < n; k++)
6498 monster_race *r_ptr = &r_info[who[k]];
6500 /* Only print Uniques */
6501 if (r_ptr->flags1 & (RF1_UNIQUE))
6503 bool dead = (r_ptr->max_num == 0);
6507 /* Only display "known" uniques */
6508 if (dead || cheat_know || r_ptr->r_sights)
6510 /* Print a message */
6512 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
6513 (r_name + r_ptr->name));
6515 fprintf(fff, " %s is alive\n",
6516 (r_name + r_ptr->name));
6523 /* Free the "who" array */
6524 C_KILL(who, max_r_idx, s16b);
6526 /* Close the file */
6529 /* Display the file contents */
6531 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6533 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6537 /* Remove the file */
6543 * Display weapon-exp
6545 static void do_cmd_knowledge_weapon_exp(void)
6547 int i,j, num, shougou;
6551 char file_name[1024];
6554 /* Open a new file */
6555 fff = my_fopen_temp(file_name, 1024);
6558 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6560 msg_format("Failed to create temporary file %s.", file_name);
6566 for(i = 0; i < 5; i++)
6568 for (num = 0; num < 64; num++)
6570 for (j = 0; j < max_k_idx; j++)
6572 object_kind *k_ptr = &k_info[j];
6574 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6576 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6578 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6579 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6580 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6581 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6584 fprintf(fff,"%-25s ",tmp);
6585 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6586 else fprintf(fff," ");
6587 fprintf(fff,"%s",shougou_moji[shougou]);
6588 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6596 /* Close the file */
6599 /* Display the file contents */
6601 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6603 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6607 /* Remove the file */
6615 static void do_cmd_knowledge_spell_exp(void)
6622 char file_name[1024];
6624 /* Open a new file */
6625 fff = my_fopen_temp(file_name, 1024);
6628 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6630 msg_format("Failed to create temporary file %s.", file_name);
6636 if(p_ptr->realm1 != REALM_NONE)
6639 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6641 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6643 for (i = 0; i < 32; i++)
6645 if (!is_magic(p_ptr->realm1))
6647 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6651 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6653 if(s_ptr->slevel == 99) continue;
6654 if(p_ptr->spell_exp[i]<900) shougou=0;
6655 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6656 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6657 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6659 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6660 if (p_ptr->realm1 == REALM_HISSATSU)
6661 fprintf(fff,"[--]");
6664 if (shougou == 4) fprintf(fff,"!");
6665 else fprintf(fff," ");
6666 fprintf(fff,"%s",shougou_moji[shougou]);
6668 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6673 if(p_ptr->realm2 != REALM_NONE)
6675 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6676 for (i = 0; i < 32; i++)
6678 if (!is_magic(p_ptr->realm1))
6680 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6684 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6686 if(s_ptr->slevel == 99) continue;
6688 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6689 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6690 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6692 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6693 if (shougou == 3) fprintf(fff,"!");
6694 else fprintf(fff," ");
6695 fprintf(fff,"%s",shougou_moji[shougou]);
6696 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6701 /* Close the file */
6704 /* Display the file contents */
6706 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6708 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6712 /* Remove the file */
6720 static void do_cmd_knowledge_skill_exp(void)
6726 char file_name[1024];
6728 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6730 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6733 /* Open a new file */
6734 fff = my_fopen_temp(file_name, 1024);
6737 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6739 msg_format("Failed to create temporary file %s.", file_name);
6745 for (i = 0; i < 3; i++)
6747 if(i == GINOU_RIDING)
6749 if(p_ptr->skill_exp[i]<500) shougou=0;
6750 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6751 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6752 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6757 if(p_ptr->skill_exp[i]<4000) shougou=0;
6758 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6759 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6760 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6763 fprintf(fff,"%-20s ",skill_name[i]);
6764 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6765 else fprintf(fff," ");
6766 fprintf(fff,"%s",shougou_moji[shougou]);
6767 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6771 /* Close the file */
6774 /* Display the file contents */
6776 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6778 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6782 /* Remove the file */
6788 * Pluralize a monster name
6790 void plural_aux(char *Name)
6792 int NameLen = strlen(Name);
6794 if (strstr(Name, "Disembodied hand"))
6796 strcpy(Name, "Disembodied hands that strangled people");
6798 else if (strstr(Name, "Colour out of space"))
6800 strcpy(Name, "Colours out of space");
6802 else if (strstr(Name, "stairway to hell"))
6804 strcpy(Name, "stairways to hell");
6806 else if (strstr(Name, "Dweller on the threshold"))
6808 strcpy(Name, "Dwellers on the threshold");
6810 else if (strstr(Name, " of "))
6812 cptr aider = strstr(Name, " of ");
6823 if (dummy[i-1] == 's')
6825 strcpy(&(dummy[i]), "es");
6830 strcpy(&(dummy[i]), "s");
6833 strcpy(&(dummy[i+1]), aider);
6834 strcpy(Name, dummy);
6836 else if (strstr(Name, "coins"))
6839 strcpy(dummy, "piles of ");
6840 strcat(dummy, Name);
6841 strcpy(Name, dummy);
6844 else if (strstr(Name, "Manes"))
6848 else if (streq(&(Name[NameLen - 2]), "ey"))
6850 strcpy(&(Name[NameLen - 2]), "eys");
6852 else if (Name[NameLen - 1] == 'y')
6854 strcpy(&(Name[NameLen - 1]), "ies");
6856 else if (streq(&(Name[NameLen - 4]), "ouse"))
6858 strcpy(&(Name[NameLen - 4]), "ice");
6860 else if (streq(&(Name[NameLen - 2]), "us"))
6862 strcpy(&(Name[NameLen - 2]), "i");
6864 else if (streq(&(Name[NameLen - 6]), "kelman"))
6866 strcpy(&(Name[NameLen - 6]), "kelmen");
6868 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6870 strcpy(&(Name[NameLen - 8]), "wordsmen");
6872 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6874 strcpy(&(Name[NameLen - 7]), "oodsmen");
6876 else if (streq(&(Name[NameLen - 7]), "eastman"))
6878 strcpy(&(Name[NameLen - 7]), "eastmen");
6880 else if (streq(&(Name[NameLen - 8]), "izardman"))
6882 strcpy(&(Name[NameLen - 8]), "izardmen");
6884 else if (streq(&(Name[NameLen - 5]), "geist"))
6886 strcpy(&(Name[NameLen - 5]), "geister");
6888 else if (streq(&(Name[NameLen - 2]), "ex"))
6890 strcpy(&(Name[NameLen - 2]), "ices");
6892 else if (streq(&(Name[NameLen - 2]), "lf"))
6894 strcpy(&(Name[NameLen - 2]), "lves");
6896 else if (suffix(Name, "ch") ||
6897 suffix(Name, "sh") ||
6898 suffix(Name, "nx") ||
6899 suffix(Name, "s") ||
6902 strcpy(&(Name[NameLen]), "es");
6906 strcpy(&(Name[NameLen]), "s");
6911 * Display current pets
6913 static void do_cmd_knowledge_pets(void)
6917 monster_type *m_ptr;
6919 int show_upkeep = 0;
6920 char file_name[1024];
6923 /* Open a new file */
6924 fff = my_fopen_temp(file_name, 1024);
6927 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6929 msg_format("Failed to create temporary file %s.", file_name);
6935 /* Process the monsters (backwards) */
6936 for (i = m_max - 1; i >= 1; i--)
6938 monster_race *r_ptr;
6939 /* Access the monster */
6942 /* Ignore "dead" monsters */
6943 if (!m_ptr->r_idx) continue;
6944 r_ptr = &r_info[m_ptr->r_idx];
6946 /* Calculate "upkeep" for pets */
6951 monster_desc(pet_name, m_ptr, 0x88);
6952 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i, 0x00));
6953 if (p_ptr->riding == i)
6955 fprintf(fff, " ¾èÇÏÃæ");
6957 fprintf(fff, " Riding");
6963 show_upkeep = calculate_upkeep();
6965 fprintf(fff, "----------------------------------------------\n");
6967 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6968 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6970 fprintf(fff, " Total: %d pet%s.\n",
6971 t_friends, (t_friends == 1 ? "" : "s"));
6972 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6977 /* Close the file */
6980 /* Display the file contents */
6982 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6984 show_file(TRUE, file_name, "Current Pets", 0, 0);
6988 /* Remove the file */
6996 * Note that the player ghosts are ignored. XXX XXX XXX
6998 static void do_cmd_knowledge_kill_count(void)
7006 char file_name[1024];
7011 /* Open a new file */
7012 fff = my_fopen_temp(file_name, 1024);
7016 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7018 msg_format("Failed to create temporary file %s.", file_name);
7024 /* Allocate the "who" array */
7025 C_MAKE(who, max_r_idx, s16b);
7028 /* Monsters slain */
7031 for (kk = 1; kk < max_r_idx; kk++)
7033 monster_race *r_ptr = &r_info[kk];
7035 if (r_ptr->flags1 & (RF1_UNIQUE))
7037 bool dead = (r_ptr->max_num == 0);
7046 s16b This = r_ptr->r_pkills;
7057 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
7059 fprintf(fff,"You have defeated no enemies yet.\n\n");
7062 else if (Total == 1)
7064 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
7066 fprintf(fff,"You have defeated one enemy.\n\n");
7071 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
7073 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
7080 /* Scan the monsters */
7081 for (i = 1; i < max_r_idx; i++)
7083 monster_race *r_ptr = &r_info[i];
7085 /* Use that monster */
7086 if (r_ptr->name) who[n++] = i;
7089 /* Select the sort method */
7090 ang_sort_comp = ang_sort_comp_hook;
7091 ang_sort_swap = ang_sort_swap_hook;
7093 /* Sort the array by dungeon depth of monsters */
7094 ang_sort(who, &why, n);
7096 /* Scan the monster races */
7097 for (k = 0; k < n; k++)
7099 monster_race *r_ptr = &r_info[who[k]];
7101 if (r_ptr->flags1 & (RF1_UNIQUE))
7103 bool dead = (r_ptr->max_num == 0);
7107 /* Print a message */
7108 fprintf(fff, " %s\n",
7109 (r_name + r_ptr->name));
7115 s16b This = r_ptr->r_pkills;
7120 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
7121 if(strchr("pt",r_ptr->d_char))
7122 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
7124 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
7128 if (strstr(r_name + r_ptr->name, "coins"))
7130 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
7134 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
7140 strcpy(ToPlural, (r_name + r_ptr->name));
7141 plural_aux(ToPlural);
7142 fprintf(fff, " %d %s\n", This, ToPlural);
7152 fprintf(fff,"----------------------------------------------\n");
7154 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
7156 fprintf(fff," Total: %lu creature%s killed.\n",
7157 Total, (Total == 1 ? "" : "s"));
7161 /* Free the "who" array */
7162 C_KILL(who, max_r_idx, s16b);
7164 /* Close the file */
7167 /* Display the file contents */
7169 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
7171 show_file(TRUE, file_name, "Kill Count", 0, 0);
7175 /* Remove the file */
7181 * Display the object groups.
7183 static void display_group_list(int col, int row, int wid, int per_page,
7184 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
7188 /* Display lines until done */
7189 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
7191 /* Get the group index */
7192 int grp = grp_idx[grp_top + i];
7194 /* Choose a color */
7195 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
7197 /* Erase the entire line */
7198 Term_erase(col, row + i, wid);
7200 /* Display the group label */
7201 c_put_str(attr, group_text[grp], row + i, col);
7207 * Move the cursor in a browser window
7209 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
7210 int *list_cur, int list_cnt)
7215 int list = *list_cur;
7217 /* Extract direction */
7220 /* Hack -- scroll up full screen */
7225 /* Hack -- scroll down full screen */
7230 d = get_keymap_dir(ch);
7235 /* Diagonals - hack */
7236 if ((ddx[d] > 0) && ddy[d])
7242 Term_get_size(&wid, &hgt);
7244 browser_rows = hgt - 8;
7246 /* Browse group list */
7251 /* Move up or down */
7252 grp += ddy[d] * (browser_rows - 1);
7255 if (grp >= grp_cnt) grp = grp_cnt - 1;
7256 if (grp < 0) grp = 0;
7257 if (grp != old_grp) list = 0;
7260 /* Browse sub-list list */
7263 /* Move up or down */
7264 list += ddy[d] * browser_rows;
7267 if (list >= list_cnt) list = list_cnt - 1;
7268 if (list < 0) list = 0;
7280 if (col < 0) col = 0;
7281 if (col > 1) col = 1;
7288 /* Browse group list */
7293 /* Move up or down */
7297 if (grp >= grp_cnt) grp = grp_cnt - 1;
7298 if (grp < 0) grp = 0;
7299 if (grp != old_grp) list = 0;
7302 /* Browse sub-list list */
7305 /* Move up or down */
7309 if (list >= list_cnt) list = list_cnt - 1;
7310 if (list < 0) list = 0;
7321 static void display_visual_list(int col, int row, int height, int width, byte attr_top, byte char_left)
7325 /* Clear the display lines */
7326 for (i = 0; i < height; i++)
7328 Term_erase(col, row + i, width);
7331 /* Bigtile mode uses double width */
7332 if (use_bigtile) width /= 2;
7334 /* Display lines until done */
7335 for (i = 0; i < height; i++)
7337 /* Display columns until done */
7338 for (j = 0; j < width; j++)
7346 /* Bigtile mode uses double width */
7347 if (use_bigtile) x += j;
7352 /* Ignore illegal characters */
7353 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
7354 (!use_graphics && ic > 0x7f))
7360 /* Force correct code for both ASCII character and tile */
7361 if (c & 0x80) a |= 0x80;
7363 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
7365 /* Display symbol */
7366 Term_putch(x, y, a, c);
7369 if (use_bigtile) Term_putch(x + 1, y, a2, c2);
7376 * Place the cursor at the collect position for visual mode
7378 static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr_top, byte char_left)
7380 int i = (a & 0x7f) - attr_top;
7381 int j = c - char_left;
7386 /* Bigtile mode uses double width */
7387 if (use_bigtile) x += j;
7389 /* Place the cursor */
7395 * Clipboard variables for copy&paste in visual mode
7397 static byte attr_idx = 0;
7398 static byte char_idx = 0;
7401 * Do visual mode command -- Change symbols
7403 static bool visual_mode_command(char ch, bool *visual_list_ptr,
7404 int height, int width,
7405 byte *attr_top_ptr, byte *char_left_ptr,
7406 byte *cur_attr_ptr, byte *cur_char_ptr)
7408 static byte attr_old = 0, char_old = 0;
7413 if (*visual_list_ptr)
7416 *cur_attr_ptr = attr_old;
7417 *cur_char_ptr = char_old;
7418 *visual_list_ptr = FALSE;
7427 if (*visual_list_ptr)
7430 *visual_list_ptr = FALSE;
7438 if (!*visual_list_ptr)
7440 *visual_list_ptr = TRUE;
7442 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7443 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7445 attr_old = *cur_attr_ptr;
7446 char_old = *cur_char_ptr;
7454 /* Set the visual */
7455 attr_idx = *cur_attr_ptr;
7456 char_idx = *cur_char_ptr;
7465 *cur_attr_ptr = attr_idx;
7466 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
7472 *cur_char_ptr = char_idx;
7473 *char_left_ptr = MAX(0, *cur_char_ptr - 10);
7479 if (*visual_list_ptr)
7482 int d = get_keymap_dir(ch);
7483 byte a = (*cur_attr_ptr & 0x7f);
7484 byte c = *cur_char_ptr;
7486 if (use_bigtile) eff_width = width / 2;
7487 else eff_width = width;
7489 /* Restrict direction */
7490 if ((a == 0) && (ddy[d] < 0)) d = 0;
7491 if ((c == 0) && (ddx[d] < 0)) d = 0;
7492 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
7493 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
7498 /* Force correct code for both ASCII character and tile */
7499 if (c & 0x80) a |= 0x80;
7501 /* Set the visual */
7506 /* Move the frame */
7507 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
7508 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
7509 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
7510 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
7517 /* Visual mode command is not used */
7523 * Display the monsters in a group.
7525 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
7526 int mon_cur, int mon_top)
7530 /* Display lines until done */
7531 for (i = 0; i < per_page && mon_idx[mon_top + i]; i++)
7537 /* Get the race index */
7538 int r_idx = mon_idx[mon_top + i] ;
7540 /* Access the race */
7541 monster_race *r_ptr = &r_info[r_idx];
7544 /* Choose a color */
7545 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
7547 /* Display the name */
7548 c_prt(attr, (r_name + r_ptr->name), row + i, col);
7550 /* Hack -- visual_list mode */
7553 c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, 60);
7555 else if (p_ptr->wizard)
7557 c_prt(attr, format("%d", r_idx), row + i, 60);
7562 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
7564 /* Display symbol */
7565 Term_putch(70, row + i, a, c);
7568 if (use_bigtile) Term_putch(70 + 1, row + i, a2, c2);
7571 if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
7573 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 73);
7575 else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "dead" : "alive"), row + i, 73);
7580 /* Clear remaining lines */
7581 for (; i < per_page; i++)
7583 Term_erase(col, row + i, 255);
7589 * Display known monsters.
7591 static void do_cmd_knowledge_monsters(void)
7594 int grp_cur, grp_top, old_grp_cur;
7595 int mon_cur, mon_top;
7596 int grp_cnt, grp_idx[100];
7604 bool visual_list = FALSE;
7605 byte attr_top = 0, char_left = 0;
7611 Term_get_size(&wid, &hgt);
7613 browser_rows = hgt - 8;
7615 /* Allocate the "mon_idx" array */
7616 C_MAKE(mon_idx, max_r_idx, s16b);
7621 /* Check every group */
7622 for (i = 0; monster_group_text[i] != NULL; i++)
7624 /* Measure the label */
7625 len = strlen(monster_group_text[i]);
7627 /* Save the maximum length */
7628 if (len > max) max = len;
7630 /* See if any monsters are known */
7631 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, 0x01))
7633 /* Build a list of groups with known monsters */
7634 grp_idx[grp_cnt++] = i;
7638 /* Terminate the list */
7639 grp_idx[grp_cnt] = -1;
7642 grp_cur = grp_top = 0;
7643 mon_cur = mon_top = 0;
7652 monster_race *r_ptr;
7659 prt("Ãμ± - ¥â¥ó¥¹¥¿¡¼", 2, 0);
7660 prt("¥°¥ë¡¼¥×", 4, 0);
7661 prt("̾Á°", 4, max + 3);
7662 if (p_ptr->wizard) prt("Idx", 4, 60);
7663 prt("ʸ»ú »¦³²¿ô", 4, 67);
7665 prt("Knowledge - Monsters", 2, 0);
7667 prt("Name", 4, max + 3);
7668 if (p_ptr->wizard) prt("Idx", 4, 60);
7669 prt("Sym Kills", 4, 67);
7672 for (i = 0; i < 78; i++)
7674 Term_putch(i, 5, TERM_WHITE, '=');
7677 for (i = 0; i < browser_rows; i++)
7679 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7685 /* Scroll group list */
7686 if (grp_cur < grp_top) grp_top = grp_cur;
7687 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
7689 /* Display a list of monster groups */
7690 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
7692 if (old_grp_cur != grp_cur)
7694 old_grp_cur = grp_cur;
7696 /* Get a list of monsters in the current group */
7697 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, 0x00);
7700 /* Scroll monster list */
7701 while (mon_cur < mon_top)
7702 mon_top = MAX(0, mon_top - browser_rows/2);
7703 while (mon_cur >= mon_top + browser_rows)
7704 mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
7708 /* Display a list of monsters in the current group */
7709 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top);
7715 /* Display a monster name */
7716 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top);
7718 /* Display visual list below first monster */
7719 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
7724 prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
7726 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);
7729 /* Get the current monster */
7730 r_ptr = &r_info[mon_idx[mon_cur]];
7732 /* Mega Hack -- track this monster race */
7733 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
7735 /* Hack -- handle stuff */
7740 place_visual_list_cursor(max + 3, 7, r_ptr->x_attr, r_ptr->x_char, attr_top, char_left);
7744 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7748 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
7753 /* Do visual mode command if needed */
7754 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;
7767 /* Recall on screen */
7768 if (mon_idx[mon_cur])
7770 screen_roff(mon_idx[mon_cur], 0);
7781 /* Move the cursor */
7782 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
7789 /* Free the "mon_idx" array */
7790 C_KILL(mon_idx, max_r_idx, s16b);
7795 * Display the objects in a group.
7797 static void display_object_list(int col, int row, int per_page, int object_idx[],
7798 int object_cur, int object_top)
7802 /* Display lines until done */
7803 for (i = 0; i < per_page && object_idx[object_top + i]; i++)
7809 /* Get the object index */
7810 int k_idx = object_idx[object_top + i];
7812 /* Access the object */
7813 object_kind *k_ptr = &k_info[k_idx];
7815 /* Choose a color */
7816 byte attr = (k_ptr->aware ? TERM_WHITE : TERM_SLATE);
7817 byte cursor = (k_ptr->aware ? TERM_L_BLUE : TERM_BLUE);
7819 attr = ((i + object_top == object_cur) ? cursor : attr);
7822 strip_name(o_name, k_idx);
7824 /* Display the name */
7825 c_prt(attr, o_name, row + i, col);
7827 /* Hack -- visual_list mode */
7830 c_prt(attr, format("%02x/%02x", k_ptr->x_attr, k_ptr->x_char), row + i, 60);
7832 else if (p_ptr->wizard)
7834 c_prt(attr, format ("%d", k_idx), row + i, 70);
7837 a = k_ptr->flavor ? misc_to_attr[k_ptr->flavor] : k_ptr->x_attr;
7838 c = k_ptr->flavor ? misc_to_char[k_ptr->flavor] : k_ptr->x_char;
7840 /* Symbol is unknown */
7841 if (!k_ptr->aware && !p_ptr->wizard)
7847 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
7849 /* Display symbol */
7850 Term_putch(76, row + i, a, c);
7853 if (use_bigtile) Term_putch(76 + 1, row + i, a2, c2);
7856 /* Clear remaining lines */
7857 for (; i < per_page; i++)
7859 Term_erase(col, row + i, 255);
7864 * Describe fake object
7866 static void desc_obj_fake(int k_idx)
7869 object_type object_type_body;
7871 /* Get local object */
7872 o_ptr = &object_type_body;
7874 /* Wipe the object */
7877 /* Create the artifact */
7878 object_prep(o_ptr, k_idx);
7880 /* It's fully know */
7881 o_ptr->ident |= IDENT_KNOWN;
7883 /* Track the object */
7884 /* object_actual_track(o_ptr); */
7886 /* Hack - mark as fake */
7887 /* term_obj_real = FALSE; */
7889 /* Hack -- Handle stuff */
7892 if (!screen_object(o_ptr, FALSE))
7895 msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
7897 msg_print("You see nothing special.");
7906 * Display known objects
7908 static void do_cmd_knowledge_objects(void)
7911 int grp_cur, grp_top, old_grp_cur;
7912 int object_old, object_cur, object_top;
7913 int grp_cnt, grp_idx[100];
7921 bool visual_list = FALSE;
7922 byte attr_top = 0, char_left = 0;
7928 Term_get_size(&wid, &hgt);
7930 browser_rows = hgt - 8;
7932 /* Allocate the "object_idx" array */
7933 C_MAKE(object_idx, max_k_idx, int);
7938 /* Check every group */
7939 for (i = 0; object_group_text[i] != NULL; i++)
7941 /* Measure the label */
7942 len = strlen(object_group_text[i]);
7944 /* Save the maximum length */
7945 if (len > max) max = len;
7947 /* See if any monsters are known */
7948 if (collect_objects(i, object_idx))
7950 /* Build a list of groups with known monsters */
7951 grp_idx[grp_cnt++] = i;
7955 /* Terminate the list */
7956 grp_idx[grp_cnt] = -1;
7959 grp_cur = grp_top = 0;
7960 object_cur = object_top = 0;
7977 prt("Ãμ± - ¥¢¥¤¥Æ¥à", 2, 0);
7978 prt("¥°¥ë¡¼¥×", 4, 0);
7979 prt("̾Á°", 4, max + 3);
7980 if (p_ptr->wizard) prt("Idx", 4, 70);
7983 prt("Knowledge - objects", 2, 0);
7985 prt("Name", 4, max + 3);
7986 if (p_ptr->wizard) prt("Idx", 4, 70);
7990 for (i = 0; i < 78; i++)
7992 Term_putch(i, 5, TERM_WHITE, '=');
7995 for (i = 0; i < browser_rows; i++)
7997 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8003 /* Scroll group list */
8004 if (grp_cur < grp_top) grp_top = grp_cur;
8005 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8007 /* Display a list of object groups */
8008 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
8010 if (old_grp_cur != grp_cur)
8012 old_grp_cur = grp_cur;
8014 /* Get a list of objects in the current group */
8015 object_cnt = collect_objects(grp_idx[grp_cur], object_idx);
8018 /* Scroll object list */
8019 while (object_cur < object_top)
8020 object_top = MAX(0, object_top - browser_rows/2);
8021 while (object_cur >= object_top + browser_rows)
8022 object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
8026 /* Display a list of objects in the current group */
8027 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top);
8031 object_top = object_cur;
8033 /* Display a list of objects in the current group */
8034 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top);
8036 /* Display visual list below first object */
8037 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8040 /* Get the current object */
8041 k_ptr = &k_info[object_idx[object_cur]];
8043 /* Mega Hack -- track this object */
8044 if (object_cnt) object_kind_track(object_idx[object_cur]);
8048 prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", k_ptr->flavor ? "" : visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
8050 prt(format("<dir>, 'r' to recall%s%s, ESC", k_ptr->flavor ? "" : visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
8053 /* The "current" object changed */
8054 if (object_old != object_idx[object_cur])
8056 /* Hack -- handle stuff */
8059 /* Remember the "current" object */
8060 object_old = object_idx[object_cur];
8065 place_visual_list_cursor(max + 3, 7, k_ptr->x_attr, k_ptr->x_char, attr_top, char_left);
8069 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8073 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
8078 /* Do visual mode command if needed */
8079 /* Symbol of objects with flavor cannot be changed */
8080 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;
8093 /* Recall on screen */
8095 desc_obj_fake(object_idx[object_cur]);
8103 /* Move the cursor */
8104 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
8110 /* Free the "object_idx" array */
8111 C_KILL(object_idx, max_k_idx, int);
8117 * Display the features in a group.
8119 static void display_feature_list(int col, int row, int per_page, int *feat_idx,
8120 int feat_cur, int feat_top)
8124 /* Display lines until done */
8125 for (i = 0; i < per_page && feat_idx[feat_top + i]; i++)
8132 int f_idx = feat_idx[feat_top + i];
8134 /* Access the index */
8135 feature_type *f_ptr = &f_info[f_idx];
8137 /* Choose a color */
8138 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
8140 /* Display the name */
8141 c_prt(attr, f_name + f_ptr->name, row + i, col);
8143 /* Hack -- visual_list mode */
8146 c_prt(attr, format("%02x/%02x", f_ptr->x_attr, f_ptr->x_char), row + i, 60);
8152 if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
8154 /* Display symbol */
8155 Term_putch(68, row + i, a, c);
8158 if (use_bigtile) Term_putch(68 + 1, row + i, a2, c2);
8161 /* Clear remaining lines */
8162 for (; i < per_page; i++)
8164 Term_erase(col, row + i, 255);
8170 * Interact with feature visuals.
8172 static void do_cmd_knowledge_features(void)
8175 int grp_cur, grp_top, old_grp_cur;
8176 int feat_cur, feat_top;
8177 int grp_cnt, grp_idx[100];
8185 bool visual_list = FALSE;
8186 byte attr_top = 0, char_left = 0;
8192 Term_get_size(&wid, &hgt);
8194 browser_rows = hgt - 8;
8196 /* Allocate the "feat_idx" array */
8197 C_MAKE(feat_idx, max_f_idx, int);
8202 /* Check every group */
8203 for (i = 0; feature_group_text[i] != NULL; i++)
8205 /* Measure the label */
8206 len = strlen(feature_group_text[i]);
8208 /* Save the maximum length */
8209 if (len > max) max = len;
8211 /* See if any features are known */
8212 if (collect_features(i, feat_idx))
8214 /* Build a list of groups with known features */
8215 grp_idx[grp_cnt++] = i;
8219 /* Terminate the list */
8220 grp_idx[grp_cnt] = -1;
8223 grp_cur = grp_top = 0;
8224 feat_cur = feat_top = 0;
8230 while ((!flag) && (grp_cnt))
8233 feature_type *f_ptr;
8239 prt("Visuals - features", 2, 0);
8241 prt("Name", 4, max + 3);
8244 for (i = 0; i < 78; i++)
8246 Term_putch(i, 5, TERM_WHITE, '=');
8249 for (i = 0; i < browser_rows; i++)
8251 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
8257 /* Scroll group list */
8258 if (grp_cur < grp_top) grp_top = grp_cur;
8259 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
8261 /* Display a list of feature groups */
8262 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
8264 if (old_grp_cur != grp_cur)
8266 old_grp_cur = grp_cur;
8268 /* Get a list of features in the current group */
8269 feat_cnt = collect_features(grp_idx[grp_cur], feat_idx);
8272 /* Scroll feature list */
8273 while (feat_cur < feat_top)
8274 feat_top = MAX(0, feat_top - browser_rows/2);
8275 while (feat_cur >= feat_top + browser_rows)
8276 feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
8280 /* Display a list of features in the current group */
8281 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top);
8285 feat_top = feat_cur;
8287 /* Display a list of features in the current group */
8288 display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top);
8290 /* Display visual list below first object */
8291 display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
8296 prt(format("<Êý¸þ>%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
8298 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);
8301 /* Get the current feature */
8302 f_ptr = &f_info[feat_idx[feat_cur]];
8306 place_visual_list_cursor(max + 3, 7, f_ptr->x_attr, f_ptr->x_char, attr_top, char_left);
8310 Term_gotoxy(0, 6 + (grp_cur - grp_top));
8314 Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
8319 /* Do visual mode command if needed */
8320 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;
8332 /* Move the cursor */
8333 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
8340 if (!grp_cnt) msg_print("No features known.");
8342 /* Free the "feat_idx" array */
8343 C_KILL(feat_idx, max_f_idx, int);
8348 * List wanted monsters
8350 static void do_cmd_knowledge_kubi(void)
8355 char file_name[1024];
8358 /* Open a new file */
8359 fff = my_fopen_temp(file_name, 1024);
8362 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8364 msg_format("Failed to create temporary file %s.", file_name);
8373 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
8375 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
8377 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
8379 fprintf(fff, "List of wanted monsters\n");
8381 for (i = 0; i < MAX_KUBI; i++)
8383 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
8384 if (kubi_r_idx[i] > 10000)
8386 fprintf(fff, "ºÑ\n");
8388 fprintf(fff, "done\n");
8391 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
8395 /* Close the file */
8398 /* Display the file contents */
8400 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
8402 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
8406 /* Remove the file */
8411 * List virtues & status
8413 static void do_cmd_knowledge_virtues(void)
8417 char file_name[1024];
8420 /* Open a new file */
8421 fff = my_fopen_temp(file_name, 1024);
8424 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8426 msg_format("Failed to create temporary file %s.", file_name);
8435 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
8437 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
8442 /* Close the file */
8445 /* Display the file contents */
8447 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
8449 show_file(TRUE, file_name, "Virtues", 0, 0);
8453 /* Remove the file */
8461 static void do_cmd_knowledge_dungeon(void)
8465 char file_name[1024];
8469 /* Open a new file */
8470 fff = my_fopen_temp(file_name, 1024);
8473 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8475 msg_format("Failed to create temporary file %s.", file_name);
8483 for (i = 1; i < max_d_idx; i++)
8487 if (!d_info[i].maxdepth) continue;
8488 if (!max_dlv[i]) continue;
8489 if (d_info[i].final_guardian)
8491 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
8493 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
8495 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
8497 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
8502 /* Close the file */
8505 /* Display the file contents */
8507 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
8509 show_file(TRUE, file_name, "Dungeon", 0, 0);
8513 /* Remove the file */
8518 * List virtues & status
8521 static void do_cmd_knowledge_stat(void)
8525 char file_name[1024];
8528 /* Open a new file */
8529 fff = my_fopen_temp(file_name, 1024);
8532 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8534 msg_format("Failed to create temporary file %s.", file_name);
8542 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
8543 (2 * p_ptr->hitdie +
8544 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
8547 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
8548 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
8549 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
8551 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
8552 else fprintf(fff, "Your current Life Rating is ???.\n\n");
8553 fprintf(fff, "Limits of maximum stats\n\n");
8555 for (v_nr = 0; v_nr < 6; v_nr++)
8557 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);
8558 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
8564 /* Close the file */
8567 /* Display the file contents */
8569 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
8571 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
8575 /* Remove the file */
8581 * Print quest status of all active quests
8583 static void do_cmd_knowledge_quests(void)
8586 char file_name[1024];
8588 char rand_tmp_str[120] = "\0";
8590 monster_race *r_ptr;
8592 int rand_level = 100;
8595 /* Open a new file */
8596 fff = my_fopen_temp(file_name, 1024);
8599 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8601 msg_format("Failed to create temporary file %s.", file_name);
8608 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
8610 fprintf(fff, "< Current Quest >\n");
8613 for (i = 1; i < max_quests; i++)
8615 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
8620 /* Clear the text */
8621 for (j = 0; j < 10; j++)
8623 quest_text[j][0] = '\0';
8626 quest_text_line = 0;
8628 /* Set the quest number temporary */
8629 old_quest = p_ptr->inside_quest;
8630 p_ptr->inside_quest = i;
8632 /* Get the quest text */
8633 init_flags = INIT_SHOW_TEXT;
8635 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8637 /* Reset the old quest number */
8638 p_ptr->inside_quest = old_quest;
8640 /* No info from "silent" quests */
8641 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8645 if (quest[i].type != QUEST_TYPE_RANDOM)
8647 char note[80] = "\0";
8649 if (quest[i].status == QUEST_STATUS_TAKEN)
8651 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
8653 r_ptr = &r_info[quest[i].r_idx];
8654 strcpy(name, r_name + r_ptr->name);
8655 if (quest[i].max_num > 1)
8658 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8661 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
8666 sprintf(note," - %s¤òÅݤ¹¡£",name);
8668 sprintf(note," - kill %s.",name);
8671 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
8674 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
8676 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
8679 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
8681 strcpy(name, a_name + a_info[quest[i].k_idx].name);
8683 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
8685 sprintf(note," - Find out %s.", name);
8688 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
8690 sprintf(note," - õº÷¤¹¤ë¡£");
8692 sprintf(note," - Search.");
8694 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
8696 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
8698 sprintf(note," - Kill all monsters.");
8702 /* Print the quest info */
8704 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
8705 quest[i].name, quest[i].level, note);
8707 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
8708 quest[i].name, quest[i].level, note);
8711 fprintf(fff, tmp_str);
8713 if (quest[i].status == QUEST_STATUS_COMPLETED)
8716 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
8718 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
8721 fprintf(fff, tmp_str);
8727 while (quest_text[j][0] && j < 10)
8729 fprintf(fff, " %s\n", quest_text[j]);
8734 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
8735 (quest[i].level < rand_level))
8738 rand_level = quest[i].level;
8740 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
8742 /* Print the quest info */
8743 r_ptr = &r_info[quest[i].r_idx];
8744 strcpy(name, r_name + r_ptr->name);
8746 if (quest[i].max_num > 1)
8749 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
8750 quest[i].name, quest[i].level,
8751 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8755 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
8756 quest[i].name, quest[i].level,
8757 quest[i].max_num, name, quest[i].cur_num);
8763 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
8764 quest[i].name, quest[i].level, name);
8766 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
8767 quest[i].name, quest[i].level, name);
8775 /* Print the current random quest */
8776 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
8779 if (!total) fprintf(fff, "¤Ê¤·\n");
8781 if (!total) fprintf(fff, "Nothing.\n");
8785 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8787 fprintf(fff, "\n< Completed Quest >\n");
8790 for (i = 1; i < max_quests; i++)
8792 if (quest[i].status == QUEST_STATUS_FINISHED)
8794 if (i < MIN_RANDOM_QUEST)
8798 /* Set the quest number temporary */
8799 old_quest = p_ptr->inside_quest;
8800 p_ptr->inside_quest = i;
8803 init_flags = INIT_ASSIGN;
8805 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8807 /* Reset the old quest number */
8808 p_ptr->inside_quest = old_quest;
8810 /* No info from "silent" quests */
8811 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8816 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8818 /* Print the quest info */
8820 if (quest[i].complev == 0)
8824 "%s (%d³¬) - ÉÔÀᄀ\n",
8826 "%s (Dungeon level: %d) - (Cancelled)\n",
8828 r_name+r_info[quest[i].r_idx].name,
8835 "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8837 "%s (Dungeon level: %d) - level %d\n",
8839 r_name+r_info[quest[i].r_idx].name,
8846 /* Print the quest info */
8848 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8849 quest[i].name, quest[i].level, quest[i].complev);
8851 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8852 quest[i].name, quest[i].level, quest[i].complev);
8856 fprintf(fff, tmp_str);
8860 if (!total) fprintf(fff, "¤Ê¤·\n");
8862 if (!total) fprintf(fff, "Nothing.\n");
8866 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8868 fprintf(fff, "\n< Failed Quest >\n");
8871 for (i = 1; i < max_quests; i++)
8873 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
8875 if (i < MIN_RANDOM_QUEST)
8879 /* Set the quest number temporary */
8880 old_quest = p_ptr->inside_quest;
8881 p_ptr->inside_quest = i;
8883 /* Get the quest text */
8884 init_flags = INIT_ASSIGN;
8886 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8888 /* Reset the old quest number */
8889 p_ptr->inside_quest = old_quest;
8891 /* No info from "silent" quests */
8892 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8897 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8899 /* Print the quest info */
8901 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8902 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
8904 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
8905 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
8910 /* Print the quest info */
8912 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8913 quest[i].name, quest[i].level, quest[i].complev);
8915 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8916 quest[i].name, quest[i].level, quest[i].complev);
8919 fprintf(fff, tmp_str);
8923 if (!total) fprintf(fff, "¤Ê¤·\n");
8925 if (!total) fprintf(fff, "Nothing.\n");
8928 if (p_ptr->wizard) {
8930 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
8932 fprintf(fff, "\n< Remaining Random Quest >\n");
8935 for (i = 1; i < max_quests; i++)
8937 /* No info from "silent" quests */
8938 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8940 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
8944 /* Print the quest info */
8946 sprintf(tmp_str, "%s (%d³¬, %s)\n",
8947 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8949 sprintf(tmp_str, "%s (%d, %s)\n",
8950 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8952 fprintf(fff, tmp_str);
8956 if (!total) fprintf(fff, "¤Ê¤·\n");
8958 if (!total) fprintf(fff, "Nothing.\n");
8962 /* Close the file */
8965 /* Display the file contents */
8967 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
8969 show_file(TRUE, file_name, "Quest status", 0, 0);
8973 /* Remove the file */
8982 static void do_cmd_knowledge_home(void)
8987 char file_name[1024];
8989 char o_name[MAX_NLEN];
8992 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
8994 /* Open a new file */
8995 fff = my_fopen_temp(file_name, 1024);
8998 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9000 msg_format("Failed to create temporary file %s.", file_name);
9008 /* Print all homes in the different towns */
9009 st_ptr = &town[1].store[STORE_HOME];
9011 /* Home -- if anything there */
9012 if (st_ptr->stock_num)
9014 /* Header with name of the town */
9016 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
9018 fprintf(fff, " [Home Inventory]\n");
9022 /* Dump all available items */
9023 for (i = 0; i < st_ptr->stock_num; i++)
9026 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
9027 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
9028 if (strlen(o_name) <= 80-3)
9030 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9036 for (n = 0, t = o_name; n < 80-3; n++, t++)
9037 if(iskanji(*t)) {t++; n++;}
9038 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
9040 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
9041 fprintf(fff, " %.77s\n", o_name+n);
9044 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
9045 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
9050 /* Add an empty line */
9051 fprintf(fff, "\n\n");
9055 /* Close the file */
9058 /* Display the file contents */
9060 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
9062 show_file(TRUE, file_name, "Home Inventory", 0, 0);
9066 /* Remove the file */
9072 * Check the status of "autopick"
9074 static void do_cmd_knowledge_autopick(void)
9078 char file_name[1024];
9080 /* Open a new file */
9081 fff = my_fopen_temp(file_name, 1024);
9086 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
9088 msg_format("Failed to create temporary file %s.", file_name);
9097 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
9099 fprintf(fff, "No preference for auto picker/destroyer.");
9105 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
9107 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
9111 for (k = 0; k < max_autopick; k++)
9114 byte act = autopick_list[k].action;
9115 if (act & DONT_AUTOPICK)
9123 else if (act & DO_AUTODESTROY)
9131 else if (act & DO_AUTOPICK)
9139 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
9148 if (act & DO_DISPLAY)
9149 fprintf(fff, "%11s", format("[%s]", tmp));
9151 fprintf(fff, "%11s", format("(%s)", tmp));
9153 tmp = autopick_line_from_entry(&autopick_list[k]);
9154 fprintf(fff, " %s", tmp);
9158 /* Close the file */
9160 /* Display the file contents */
9162 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
9164 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
9167 /* Remove the file */
9173 * Interact with "knowledge"
9175 void do_cmd_knowledge(void)
9178 /* File type is "TEXT" */
9179 FILE_TYPE(FILE_TYPE_TEXT);
9180 /* Save the screen */
9182 /* Interact until done */
9187 /* Ask for a choice */
9189 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
9190 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
9192 prt(format("page %d/2", (p+1)), 2, 65);
9193 prt("Display current knowledge", 3, 0);
9196 /* Give some choices */
9199 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
9200 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
9201 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
9202 prt("(4) ´ûÃΤΥâ¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
9203 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
9204 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
9205 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
9206 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
9207 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
9208 prt("(0) ÃÏ·Á¤Îɽ¼¨Ê¸»ú/¥¿¥¤¥ë ¤Î°ìÍ÷", 15, 5);
9210 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
9211 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
9212 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
9213 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
9214 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
9215 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
9216 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
9217 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
9218 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
9222 prt("(1) Display known artifacts", 6, 5);
9223 prt("(2) Display known objects", 7, 5);
9224 prt("(3) Display remaining uniques", 8, 5);
9225 prt("(4) Display known monster", 9, 5);
9226 prt("(5) Display kill count", 10, 5);
9227 prt("(6) Display wanted monsters", 11, 5);
9228 prt("(7) Display current pets", 12, 5);
9229 prt("(8) Display home inventory", 13, 5);
9230 prt("(9) Display *identified* equip.", 14, 5);
9231 prt("(0) Display terrain symbols.", 15, 5);
9233 prt("(a) Display about yourself", 6, 5);
9234 prt("(b) Display mutations", 7, 5);
9235 prt("(c) Display weapon proficiency", 8, 5);
9236 prt("(d) Display spell proficiency", 9, 5);
9237 prt("(e) Display misc. proficiency", 10, 5);
9238 prt("(f) Display virtues", 11, 5);
9239 prt("(g) Display dungeons", 12, 5);
9240 prt("(h) Display current quests", 13, 5);
9241 prt("(i) Display auto pick/destroy", 14, 5);
9246 prt("-³¤¯-", 17, 8);
9247 prt("ESC) È´¤±¤ë", 21, 1);
9248 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
9249 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
9250 prt("¥³¥Þ¥ó¥É:", 20, 0);
9252 prt("-more-", 17, 8);
9253 prt("ESC) Exit menu", 21, 1);
9254 prt("SPACE) Next page", 21, 30);
9255 /*prt("-) Previous page", 21, 60);*/
9256 prt("Command: ", 20, 0);
9262 if (i == ESCAPE) break;
9265 case ' ': /* Page change */
9269 case '1': /* Artifacts */
9270 do_cmd_knowledge_artifacts();
9272 case '2': /* Objects */
9273 do_cmd_knowledge_objects();
9275 case '3': /* Uniques */
9276 do_cmd_knowledge_uniques();
9278 case '4': /* Monsters */
9279 do_cmd_knowledge_monsters();
9281 case '5': /* Kill count */
9282 do_cmd_knowledge_kill_count();
9284 case '6': /* wanted */
9285 do_cmd_knowledge_kubi();
9287 case '7': /* Pets */
9288 do_cmd_knowledge_pets();
9290 case '8': /* Home */
9291 do_cmd_knowledge_home();
9293 case '9': /* Resist list */
9294 do_cmd_knowledge_inven();
9296 case '0': /* Feature list */
9297 do_cmd_knowledge_features();
9300 case 'a': /* Max stat */
9301 do_cmd_knowledge_stat();
9303 case 'b': /* Mutations */
9304 do_cmd_knowledge_mutations();
9306 case 'c': /* weapon-exp */
9307 do_cmd_knowledge_weapon_exp();
9309 case 'd': /* spell-exp */
9310 do_cmd_knowledge_spell_exp();
9312 case 'e': /* skill-exp */
9313 do_cmd_knowledge_skill_exp();
9315 case 'f': /* Virtues */
9316 do_cmd_knowledge_virtues();
9318 case 'g': /* Dungeon */
9319 do_cmd_knowledge_dungeon();
9321 case 'h': /* Quests */
9322 do_cmd_knowledge_quests();
9324 case 'i': /* Autopick */
9325 do_cmd_knowledge_autopick();
9327 default: /* Unknown option */
9330 /* Flush messages */
9333 /* Restore the screen */
9339 * Check on the status of an active quest
9341 void do_cmd_checkquest(void)
9343 /* File type is "TEXT" */
9344 FILE_TYPE(FILE_TYPE_TEXT);
9346 /* Save the screen */
9350 do_cmd_knowledge_quests();
9352 /* Restore the screen */
9358 * Display the time and date
9360 void do_cmd_time(void)
9362 int day, hour, min, full, start, end, num;
9369 extract_day_hour_min(&day, &hour, &min);
9371 full = hour * 100 + min;
9379 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
9381 strcpy(desc, "It is a strange time.");
9387 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
9388 day, (hour % 12 == 0) ? 12 : (hour % 12),
9389 min, (hour < 12) ? "AM" : "PM");
9391 msg_format("This is day %d. The time is %d:%02d %s.",
9392 day, (hour % 12 == 0) ? 12 : (hour % 12),
9393 min, (hour < 12) ? "AM" : "PM");
9398 if (!randint0(10) || p_ptr->image)
9401 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
9403 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
9410 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
9412 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
9417 /* Open this file */
9418 fff = my_fopen(buf, "rt");
9423 /* Find this time */
9424 while (!my_fgets(fff, buf, sizeof(buf)))
9426 /* Ignore comments */
9427 if (!buf[0] || (buf[0] == '#')) continue;
9429 /* Ignore invalid lines */
9430 if (buf[1] != ':') continue;
9432 /* Process 'Start' */
9435 /* Extract the starting time */
9436 start = atoi(buf + 2);
9438 /* Assume valid for an hour */
9448 /* Extract the ending time */
9449 end = atoi(buf + 2);
9455 /* Ignore incorrect range */
9456 if ((start > full) || (full > end)) continue;
9458 /* Process 'Description' */
9463 /* Apply the randomizer */
9464 if (!randint0(num)) strcpy(desc, buf + 2);
9474 /* Close the file */