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);
481 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)))
492 if (!(dun_level+num)) to = "ÃϾå";
493 else to = format("%d³¬", dun_level+num);
495 if (!(dun_level+num)) to = "surface";
496 else to = format("level %d", dun_level+num);
501 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
503 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
510 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
512 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
519 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
521 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
531 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, p_ptr->arena_number + 1, note);
533 int n = p_ptr->arena_number + 1;
534 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"));
539 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
541 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);
543 if (num == MAX_ARENA_MONS)
546 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
548 fprintf(fff, " win all fight to become a Chanpion.\n");
557 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
559 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
574 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
576 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
580 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
582 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
597 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
599 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
603 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Ñ¥¿¡¼¥ó¤ÎÎϤǰÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
605 fprintf(fff, " %2d:%02d %20s use Pattern to teleport to %s.\n", hour, min, note_level, to);
612 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
614 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
618 case NIKKI_GAMESTART:
620 time_t ct = time((time_t*)0);
624 fprintf(fff, "%s %s",note, ctime(&ct));
627 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
630 case NIKKI_NAMED_PET:
632 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
637 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
639 fprintf(fff, "decide to travel together with %s.\n", note);
644 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
646 fprintf(fff, "unname %s.\n", note);
651 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
653 fprintf(fff, "dismiss %s.\n", note);
658 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
660 fprintf(fff, "%s die.\n", note);
665 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
667 fprintf(fff, "move to other map leaving %s behind.\n", note);
672 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
674 fprintf(fff, "lose sight of %s.\n", note);
679 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
681 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
686 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
688 fprintf(fff, "%s is crushed by falling rocks.\n", note);
703 /* Hack -- grab permissions */
706 if (do_level) write_level = FALSE;
712 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
714 static void do_cmd_disp_nikki(void)
716 char nikki_title[256];
721 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
722 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
733 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
734 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
735 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
736 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
741 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
750 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
752 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
753 "Attack is the best form of defence.",
755 "An unexpected windfall",
756 "A drowning man will catch at a straw",
757 "Don't count your chickens before they are hatched.",
758 "It is no use crying over spilt milk.",
759 "Seeing is believing.",
760 "Strike the iron while it is hot.",
761 "I don't care what follows.",
762 "To dig a well to put out a house on fire.",
763 "Tomorrow is another day.",
764 "Easy come, easy go.",
765 "The more haste, the less speed.",
766 "Where there is life, there is hope.",
767 "There is no royal road to *WINNER*.",
768 "Danger past, God forgotten.",
769 "The best thing to do now is to run away.",
770 "Life is but an empty dream.",
771 "Dead men tell no tales.",
772 "A book that remains shut is but a block.",
773 "Misfortunes never come singly.",
774 "A little knowledge is a dangerous thing.",
775 "History repeats itself.",
776 "*WINNER* was not built in a day.",
777 "Ignorance is bliss.",
778 "To lose is to win?",
779 "No medicine can cure folly.",
780 "All good things come to an end.",
781 "M$ Empire strikes back.",
782 "To see is to believe",
784 "Quest of The World's Greatest Brain"};
787 sprintf(file_name,"playrecord-%s.txt",savefile_base);
789 sprintf(file_name,"playrec-%s.txt",savefile_base);
792 /* Hack -- drop permissions */
795 /* Build the filename */
796 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
798 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
799 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
800 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
801 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
802 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
805 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
806 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
808 sprintf(nikki_title, "Legend of %s %s '%s'",
809 ap_ptr->title, player_name, tmp);
812 /* Display the file contents */
813 show_file(FALSE, buf, nikki_title, -1, 0);
815 /* Hack -- grab permissions */
819 static void do_cmd_bunshou(void)
822 char bunshou[80] = "\0";
825 if (get_string("ÆâÍÆ: ", tmp, 79))
827 if (get_string("diary note: ", tmp, 79))
830 strcpy(bunshou, tmp);
832 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
836 static void do_cmd_last_get(void)
841 if (record_o_name[0] == '\0') return;
844 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
846 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
848 if (!get_check(buf)) return;
853 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
855 sprintf(buf,"descover %s.", record_o_name);
857 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
861 static void do_cmd_erase_nikki(void)
868 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
870 if (!get_check("Do you really want to delete all your record? ")) return;
874 sprintf(file_name,"playrecord-%s.txt",savefile_base);
876 sprintf(file_name,"playrec-%s.txt",savefile_base);
879 /* Hack -- drop permissions */
882 /* Build the filename */
883 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
885 /* Remove the file */
888 fff = my_fopen(buf, "w");
892 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
894 msg_format("deleted record.");
898 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
900 msg_format("failed to delete %s.", buf);
905 /* Hack -- grab permissions */
912 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
918 void do_cmd_nikki(void)
922 /* File type is "TEXT" */
923 FILE_TYPE(FILE_TYPE_TEXT);
925 /* Save the screen */
928 /* Interact until done */
934 /* Ask for a choice */
936 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
938 prt("[ Play Record ]", 2, 0);
942 /* Give some choices */
944 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
945 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
946 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
947 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
949 prt("(1) Display your record", 4, 5);
950 prt("(2) Add record", 5, 5);
951 prt("(3) Record item you last get/identify", 6, 5);
952 prt("(4) Delete your record", 7, 5);
958 prt("¥³¥Þ¥ó¥É:", 18, 0);
960 prt("Command: ", 18, 0);
968 if (i == ESCAPE) break;
982 do_cmd_erase_nikki();
989 default: /* Unknown option */
997 /* Restore the screen */
1002 * Hack -- redraw the screen
1004 * This command performs various low level updates, clears all the "extra"
1005 * windows, does a total redraw of the main window, and requests all of the
1006 * interesting updates and redraws that I can think of.
1008 * This command is also used to "instantiate" the results of the user
1009 * selecting various things, such as graphics mode, so it must call
1010 * the "TERM_XTRA_REACT" hook before redrawing the windows.
1012 void do_cmd_redraw(void)
1019 /* Hack -- react to changes */
1020 Term_xtra(TERM_XTRA_REACT, 0);
1023 /* Combine and Reorder the pack (later) */
1024 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1028 p_ptr->update |= (PU_TORCH);
1031 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1033 /* Forget lite/view */
1034 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1036 /* Update lite/view */
1037 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1039 /* Update monsters */
1040 p_ptr->update |= (PU_MONSTERS);
1042 /* Redraw everything */
1043 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1046 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1049 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1053 /* Hack -- update */
1056 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1059 /* Redraw every window */
1060 for (j = 0; j < 8; j++)
1063 if (!angband_term[j]) continue;
1066 Term_activate(angband_term[j]);
1081 * Hack -- change name
1083 void do_cmd_change_name(void)
1092 /* Save the screen */
1100 /* Display the player */
1101 display_player(mode);
1106 display_player(mode);
1111 Term_putstr(2, 23, -1, TERM_WHITE,
1112 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1114 Term_putstr(2, 23, -1, TERM_WHITE,
1115 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1123 if (c == ESCAPE) break;
1130 /* Process the player name */
1131 process_player_name(FALSE);
1137 sprintf(tmp, "%s.txt", player_base);
1139 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1141 if (get_string("File name: ", tmp, 80))
1145 if (tmp[0] && (tmp[0] != ' '))
1147 file_character(tmp, TRUE);
1164 /* Flush messages */
1168 /* Restore the screen */
1171 /* Redraw everything */
1172 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1179 * Recall the most recent message
1181 void do_cmd_message_one(void)
1183 /* Recall one message XXX XXX XXX */
1184 prt(format("> %s", message_str(0)), 0, 0);
1189 * Show previous messages to the user -BEN-
1191 * The screen format uses line 0 and 23 for headers and prompts,
1192 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1194 * This command shows you which commands you are viewing, and allows
1195 * you to "search" for strings in the recall.
1197 * Note that messages may be longer than 80 characters, but they are
1198 * displayed using "infinite" length, with a special sub-command to
1199 * "slide" the virtual display to the left or right.
1201 * Attempt to only hilite the matching portions of the string.
1203 void do_cmd_messages(int num_now)
1214 Term_get_size(&wid, &hgt);
1223 /* Total messages */
1226 /* Start on first message */
1229 /* Start at leftmost edge */
1232 /* Save the screen */
1235 /* Process requests until done */
1241 /* Dump up to 20 lines of messages */
1242 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1244 cptr msg = message_str(i+j);
1246 /* Apply horizontal scroll */
1247 msg = (strlen(msg) >= q) ? (msg + q) : "";
1249 /* Dump the messages, bottom to top */
1250 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1252 /* Hilite "shower" */
1257 /* Display matches */
1258 while ((str = strstr(str, shower)) != NULL)
1260 int len = strlen(shower);
1262 /* Display the match */
1263 Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
1271 /* Display header XXX XXX XXX */
1274 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1275 i, i+j-1, n, q), 0, 0);
1277 prt(format("Message Recall (%d-%d of %d), Offset %d",
1278 i, i+j-1, n, q), 0, 0);
1282 /* Display prompt (not very informative) */
1284 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1286 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1293 /* Exit on Escape */
1294 if (k == ESCAPE) break;
1296 /* Hack -- Save the old index */
1299 /* Horizontal scroll */
1303 q = (q >= 40) ? (q - 40) : 0;
1309 /* Horizontal scroll */
1319 /* Hack -- handle show */
1324 prt("¶¯Ä´: ", hgt - 1, 0);
1326 prt("Show: ", hgt - 1, 0);
1330 /* Get a "shower" string, or continue */
1331 if (!askfor_aux(shower, 80)) continue;
1337 /* Hack -- handle find */
1344 prt("¸¡º÷: ", hgt - 1, 0);
1346 prt("Find: ", hgt - 1, 0);
1350 /* Get a "finder" string, or continue */
1351 if (!askfor_aux(finder, 80)) continue;
1354 strcpy(shower, finder);
1357 for (z = i + 1; z < n; z++)
1359 cptr msg = message_str(z);
1362 if (strstr(msg, finder))
1373 /* Recall 1 older message */
1374 if ((k == '8') || (k == '\n') || (k == '\r'))
1376 /* Go newer if legal */
1377 if (i + 1 < n) i += 1;
1380 /* Recall 10 older messages */
1383 /* Go older if legal */
1384 if (i + 10 < n) i += 10;
1387 /* Recall 20 older messages */
1388 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1390 /* Go older if legal */
1391 if (i + 20 < n) i += 20;
1394 /* Recall 20 newer messages */
1395 if ((k == 'n') || (k == KTRL('N')))
1397 /* Go newer (if able) */
1398 i = (i >= 20) ? (i - 20) : 0;
1401 /* Recall 10 newer messages */
1404 /* Go newer (if able) */
1405 i = (i >= 20) ? (i - 20) : 0;
1408 /* Recall 1 newer messages */
1411 /* Go newer (if able) */
1412 i = (i >= 1) ? (i - 1) : 0;
1415 /* Hack -- Error of some kind */
1419 /* Restore the screen */
1426 * Number of cheating options
1433 static option_type cheat_info[CHEAT_MAX] =
1435 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1437 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1439 "cheat_peek", "Peek into object creation"
1443 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1445 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1447 "cheat_hear", "Peek into monster creation"
1451 { &cheat_room, FALSE, 255, 0x04, 0x00,
1453 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1455 "cheat_room", "Peek into dungeon creation"
1459 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1461 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë"
1463 "cheat_xtra", "Peek into something else"
1467 { &cheat_know, FALSE, 255, 0x10, 0x00,
1469 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë"
1471 "cheat_know", "Know complete monster info"
1475 { &cheat_live, FALSE, 255, 0x20, 0x00,
1477 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë"
1479 "cheat_live", "Allow player to avoid death"
1483 { &cheat_save, FALSE, 255, 0x40, 0x00,
1485 "cheat_save", "»à¤ó¤À»þ¥»¡¼¥Ö¤¹¤ë¤«³Îǧ¤¹¤ë"
1487 "cheat_save", "Ask for saving death"
1493 * Interact with some options for cheating
1495 static void do_cmd_options_cheat(cptr info)
1499 int i, k = 0, n = CHEAT_MAX;
1507 /* Interact with the player */
1512 /* Prompt XXX XXX XXX */
1514 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1516 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1522 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1523 prt(" << Ãí°Õ >>", 11, 0);
1524 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1525 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1526 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1528 /* Display the options */
1529 for (i = 0; i < n; i++)
1531 byte a = TERM_WHITE;
1533 /* Color current option */
1534 if (i == k) a = TERM_L_BLUE;
1536 /* Display the option text */
1537 sprintf(buf, "%-48s: %s (%s)",
1538 cheat_info[i].o_desc,
1540 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1542 (*cheat_info[i].o_var ? "yes" : "no "),
1545 cheat_info[i].o_text);
1546 c_prt(a, buf, i + 2, 0);
1549 /* Hilite current option */
1550 move_cursor(k + 2, 50);
1556 * HACK - Try to translate the key into a direction
1557 * to allow using the roguelike keys for navigation.
1559 dir = get_keymap_dir(ch);
1560 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1574 k = (n + k - 1) % n;
1593 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1595 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1597 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1598 (*cheat_info[k].o_var) = TRUE;
1607 (*cheat_info[k].o_var) = FALSE;
1615 strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text);
1617 strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text);
1619 /* Peruse the help file */
1620 (void)show_file(TRUE, buf, NULL, 0, 0);
1636 static option_type autosave_info[2] =
1638 { &autosave_l, FALSE, 255, 0x01, 0x00,
1640 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1642 "autosave_l", "Autosave when entering new levels" },
1646 { &autosave_t, FALSE, 255, 0x02, 0x00,
1648 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1650 "autosave_t", "Timed autosave" },
1656 static s16b toggle_frequency(s16b current)
1658 if (current == 0) return 50;
1659 if (current == 50) return 100;
1660 if (current == 100) return 250;
1661 if (current == 250) return 500;
1662 if (current == 500) return 1000;
1663 if (current == 1000) return 2500;
1664 if (current == 2500) return 5000;
1665 if (current == 5000) return 10000;
1666 if (current == 10000) return 25000;
1673 * Interact with some options for cheating
1675 static void do_cmd_options_autosave(cptr info)
1679 int i, k = 0, n = 2;
1687 /* Interact with the player */
1690 /* Prompt XXX XXX XXX */
1692 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1694 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1699 /* Display the options */
1700 for (i = 0; i < n; i++)
1702 byte a = TERM_WHITE;
1704 /* Color current option */
1705 if (i == k) a = TERM_L_BLUE;
1707 /* Display the option text */
1708 sprintf(buf, "%-48s: %s (%s)",
1709 autosave_info[i].o_desc,
1711 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1713 (*autosave_info[i].o_var ? "yes" : "no "),
1716 autosave_info[i].o_text);
1717 c_prt(a, buf, i + 2, 0);
1721 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1723 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1728 /* Hilite current option */
1729 move_cursor(k + 2, 50);
1745 k = (n + k - 1) % n;
1763 (*autosave_info[k].o_var) = TRUE;
1772 (*autosave_info[k].o_var) = FALSE;
1780 autosave_freq = toggle_frequency(autosave_freq);
1782 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1783 autosave_freq), 5, 0);
1785 prt(format("Timed autosave frequency: every %d turns",
1786 autosave_freq), 5, 0);
1794 (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0);
1796 (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0);
1814 #define PAGE_AUTODESTROY 7
1817 * Interact with some options
1819 void do_cmd_options_aux(int page, cptr info)
1822 int i, k = 0, n = 0, l;
1827 /* Lookup the options */
1828 for (i = 0; i < 24; i++) opt[i] = 0;
1830 /* Scan the options */
1831 for (i = 0; option_info[i].o_desc; i++)
1833 /* Notice options on this "page" */
1834 if (option_info[i].o_page == page) opt[n++] = i;
1841 /* Interact with the player */
1846 /* Prompt XXX XXX XXX */
1848 sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, y/n:Êѹ¹, ESC:½ªÎ», ?:¥Ø¥ë¥×) ", info);
1850 sprintf(buf, "%s (RET:next, y/n:change, ESC:accept, ?:help) ", info);
1856 /* HACK -- description for easy-auto-destroy options */
1858 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
1860 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
1863 /* Display the options */
1864 for (i = 0; i < n; i++)
1866 byte a = TERM_WHITE;
1868 /* Color current option */
1869 if (i == k) a = TERM_L_BLUE;
1871 /* Display the option text */
1872 sprintf(buf, "%-48s: %s (%.19s)",
1873 option_info[opt[i]].o_desc,
1875 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1877 (*option_info[opt[i]].o_var ? "yes" : "no "),
1880 option_info[opt[i]].o_text);
1881 if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1882 else c_prt(a, buf, i + 2, 0);
1885 if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3;
1888 /* Hilite current option */
1889 move_cursor(k + 2 + l, 50);
1895 * HACK - Try to translate the key into a direction
1896 * to allow using the roguelike keys for navigation.
1898 dir = get_keymap_dir(ch);
1899 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1913 k = (n + k - 1) % n;
1930 (*option_info[opt[k]].o_var) = TRUE;
1939 (*option_info[opt[k]].o_var) = FALSE;
1947 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1954 strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text);
1956 strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text);
1958 /* Peruse the help file */
1959 (void)show_file(TRUE, buf, NULL, 0, 0);
1976 * Modify the "window" options
1978 static void do_cmd_options_win(void)
1992 /* Memorize old flags */
1993 for (j = 0; j < 8; j++)
1995 /* Acquire current flags */
1996 old_flag[j] = window_flag[j];
2006 /* Prompt XXX XXX XXX */
2008 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
2010 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
2014 /* Display the windows */
2015 for (j = 0; j < 8; j++)
2017 byte a = TERM_WHITE;
2019 cptr s = angband_term_name[j];
2022 if (j == x) a = TERM_L_BLUE;
2024 /* Window name, staggered, centered */
2025 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
2028 /* Display the options */
2029 for (i = 0; i < 16; i++)
2031 byte a = TERM_WHITE;
2033 cptr str = window_flag_desc[i];
2036 if (i == y) a = TERM_L_BLUE;
2040 if (!str) str = "(̤»ÈÍÑ)";
2042 if (!str) str = "(Unused option)";
2047 Term_putstr(0, i + 5, -1, a, str);
2049 /* Display the windows */
2050 for (j = 0; j < 8; j++)
2052 byte a = TERM_WHITE;
2057 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2060 if (window_flag[j] & (1L << i)) c = 'X';
2063 Term_putch(35 + j * 5, i + 5, a, c);
2068 Term_gotoxy(35 + x * 5, y + 5);
2086 for (j = 0; j < 8; j++)
2088 window_flag[j] &= ~(1L << y);
2092 for (i = 0; i < 16; i++)
2094 window_flag[x] &= ~(1L << i);
2107 window_flag[x] |= (1L << y);
2115 window_flag[x] &= ~(1L << y);
2122 (void)show_file(TRUE, "joption.txt#Window", NULL, 0, 0);
2124 (void)show_file(TRUE, "option.txt#Window", NULL, 0, 0);
2134 d = get_keymap_dir(ch);
2136 x = (x + ddx[d] + 8) % 8;
2137 y = (y + ddy[d] + 16) % 16;
2144 /* Notice changes */
2145 for (j = 0; j < 8; j++)
2150 if (!angband_term[j]) continue;
2152 /* Ignore non-changes */
2153 if (window_flag[j] == old_flag[j]) continue;
2156 Term_activate(angband_term[j]);
2173 * Set or unset various options.
2175 * The user must use the "Ctrl-R" command to "adapt" to changes
2176 * in any options which control "visual" aspects of the game.
2178 void do_cmd_options(void)
2183 /* Save the screen */
2192 /* Why are we here */
2194 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2196 prt("Options", 2, 0);
2200 /* Give some choices */
2202 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2203 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2204 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2205 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2206 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2207 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2208 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2209 /* Special choices */
2210 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2211 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2212 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2214 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2216 prt("(1) Input Options", 4, 5);
2217 prt("(2) Output Options", 5, 5);
2218 prt("(3) Game-Play Options", 6, 5);
2219 prt("(4) Disturbance Options", 7, 5);
2220 prt("(5) Efficiency Options", 8, 5);
2221 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2222 prt("(R) Play-record Options", 10, 5);
2224 /* Special choices */
2225 prt("(D) Base Delay Factor", 12, 5);
2226 prt("(H) Hitpoint Warning", 13, 5);
2227 prt("(A) Autosave Options", 14, 5);
2231 prt("(W) Window Flags", 15, 5);
2234 if (p_ptr->noscore || allow_debug_opts)
2238 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2240 prt("(C) Cheating Options", 16, 5);
2247 prt("¥³¥Þ¥ó¥É:", 18, 0);
2249 prt("Command: ", 18, 0);
2257 if (k == ESCAPE) break;
2262 /* General Options */
2265 /* Process the general options */
2267 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2269 do_cmd_options_aux(1, "Input Options");
2275 /* General Options */
2278 /* Process the general options */
2280 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2282 do_cmd_options_aux(2, "Output Options");
2288 /* Inventory Options */
2293 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2295 do_cmd_options_aux(3, "Game-Play Options");
2301 /* Disturbance Options */
2306 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2308 do_cmd_options_aux(4, "Disturbance Options");
2314 /* Efficiency Options */
2319 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2321 do_cmd_options_aux(5, "Efficiency Options");
2327 /* Object auto-destruction Options */
2332 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2334 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2339 /* Play-record Options */
2345 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2347 do_cmd_options_aux(10, "Play-record Option");
2352 /* Cheating Options */
2355 if (!p_ptr->noscore && !allow_debug_opts)
2357 /* Cheat options are not permitted */
2364 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2366 do_cmd_options_cheat("Cheaters never win");
2376 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2378 do_cmd_options_autosave("Autosave");
2389 do_cmd_options_win();
2390 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2391 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2392 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2393 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2397 /* Hack -- Delay Speed */
2403 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2405 prt("Command: Base Delay Factor", 18, 0);
2409 /* Get a new value */
2412 int msec = delay_factor * delay_factor * delay_factor;
2414 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2415 delay_factor, msec), 22, 0);
2417 prt(format("Current base delay factor: %d (%d msec)",
2418 delay_factor, msec), 22, 0);
2422 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2424 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2428 if (k == ESCAPE) break;
2432 (void)show_file(TRUE, "joption.txt#BaseDelay", NULL, 0, 0);
2434 (void)show_file(TRUE, "option.txt#BaseDelay", NULL, 0, 0);
2438 else if (isdigit(k)) delay_factor = D2I(k);
2445 /* Hack -- hitpoint warning factor */
2451 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2453 prt("Command: Hitpoint Warning", 18, 0);
2457 /* Get a new value */
2461 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2462 hitpoint_warn), 22, 0);
2464 prt(format("Current hitpoint warning: %d0%%",
2465 hitpoint_warn), 22, 0);
2469 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2471 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2475 if (k == ESCAPE) break;
2479 (void)show_file(TRUE, "joption.txt#Hitpoint", NULL, 0, 0);
2481 (void)show_file(TRUE, "option.txt#Hitpoint", NULL, 0, 0);
2485 else if (isdigit(k)) hitpoint_warn = D2I(k);
2494 (void)show_file(TRUE, "joption.txt", NULL, 0, 0);
2496 (void)show_file(TRUE, "option.txt", NULL, 0, 0);
2501 /* Unknown option */
2510 /* Flush messages */
2515 /* Restore the screen */
2518 /* Hack - Redraw equippy chars */
2519 p_ptr->redraw |= (PR_EQUIPPY);
2525 * Ask for a "user pref line" and process it
2527 * XXX XXX XXX Allow absolute file names?
2529 void do_cmd_pref(void)
2536 /* Ask for a "user pref command" */
2538 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2540 if (!get_string("Pref: ", buf, 80)) return;
2544 /* Process that pref command */
2545 (void)process_pref_file_command(buf);
2548 void do_cmd_pickpref(void)
2554 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2556 if(!get_check("Reload auto-pick preference file? ")) return;
2559 /* Free old entries */
2562 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2564 sprintf(buf, "picktype-%s.prf", player_name);
2566 sprintf(buf, "pickpref-%s.prf", player_name);
2568 err = process_pickpref_file(buf);
2573 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2575 msg_format("loaded '%s'.", buf);
2579 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2581 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2585 err = process_pickpref_file("picktype.prf");
2587 err = process_pickpref_file("pickpref.prf");
2593 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2595 msg_print("loaded 'pickpref.prf'.");
2602 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2604 if(err) msg_print("Failed to reload autopick preference.");
2611 * Hack -- append all current macros to the given file
2613 static errr macro_dump(cptr fname)
2615 static cptr mark = "Macro Dump";
2623 /* Build the filename */
2624 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2626 /* File type is "TEXT" */
2627 FILE_TYPE(FILE_TYPE_TEXT);
2629 /* Append to the file */
2630 fff = open_auto_dump(buf, mark, &line_num);
2631 if (!fff) return (-1);
2635 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2637 fprintf(fff, "\n# Automatic macro dump\n\n");
2642 for (i = 0; i < macro__num; i++)
2644 /* Extract the action */
2645 ascii_to_text(buf, macro__act[i]);
2647 /* Dump the macro */
2648 fprintf(fff, "A:%s\n", buf);
2650 /* Extract the action */
2651 ascii_to_text(buf, macro__pat[i]);
2653 /* Dump normal macros */
2654 fprintf(fff, "P:%s\n", buf);
2659 /* count number of lines */
2664 close_auto_dump(fff, mark, line_num);
2672 * Hack -- ask for a "trigger" (see below)
2674 * Note the complex use of the "inkey()" function from "util.c".
2676 * Note that both "flush()" calls are extremely important.
2678 static void do_cmd_macro_aux(char *buf)
2688 /* Do not process macros */
2694 /* Read the pattern */
2700 /* Do not process macros */
2703 /* Do not wait for keys */
2706 /* Attempt to read a key */
2717 /* Convert the trigger */
2718 ascii_to_text(tmp, buf);
2720 /* Hack -- display the trigger */
2721 Term_addstr(-1, TERM_WHITE, tmp);
2728 * Hack -- ask for a keymap "trigger" (see below)
2730 * Note that both "flush()" calls are extremely important. This may
2731 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2733 static void do_cmd_macro_aux_keymap(char *buf)
2747 /* Convert to ascii */
2748 ascii_to_text(tmp, buf);
2750 /* Hack -- display the trigger */
2751 Term_addstr(-1, TERM_WHITE, tmp);
2760 * Hack -- append all keymaps to the given file
2762 static errr keymap_dump(cptr fname)
2764 static cptr mark = "Keymap Dump";
2776 if (rogue_like_commands)
2778 mode = KEYMAP_MODE_ROGUE;
2784 mode = KEYMAP_MODE_ORIG;
2788 /* Build the filename */
2789 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2791 /* File type is "TEXT" */
2792 FILE_TYPE(FILE_TYPE_TEXT);
2794 /* Append to the file */
2795 fff = open_auto_dump(buf, mark, &line_num);
2796 if (!fff) return -1;
2800 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2802 fprintf(fff, "\n# Automatic keymap dump\n\n");
2807 for (i = 0; i < 256; i++)
2811 /* Loop up the keymap */
2812 act = keymap_act[mode][i];
2814 /* Skip empty keymaps */
2817 /* Encode the key */
2820 ascii_to_text(key, buf);
2822 /* Encode the action */
2823 ascii_to_text(buf, act);
2825 /* Dump the macro */
2826 fprintf(fff, "A:%s\n", buf);
2827 fprintf(fff, "C:%d:%s\n", mode, key);
2832 close_auto_dump(fff, mark, line_num);
2841 * Interact with "macros"
2843 * Note that the macro "action" must be defined before the trigger.
2845 * Could use some helpful instructions on this page. XXX XXX XXX
2847 void do_cmd_macros(void)
2859 if (rogue_like_commands)
2861 mode = KEYMAP_MODE_ROGUE;
2867 mode = KEYMAP_MODE_ORIG;
2870 /* File type is "TEXT" */
2871 FILE_TYPE(FILE_TYPE_TEXT);
2878 /* Process requests until done */
2886 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2888 prt("Interact with Macros", 2, 0);
2893 /* Describe that action */
2895 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2897 prt("Current action (if any) shown below:", 20, 0);
2901 /* Analyze the current action */
2902 ascii_to_text(buf, macro__buf);
2904 /* Display the current action */
2910 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2912 prt("(1) Load a user pref file", 4, 5);
2917 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2918 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2919 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2920 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2921 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2922 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2923 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2924 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2925 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2927 prt("(2) Append macros to a file", 5, 5);
2928 prt("(3) Query a macro", 6, 5);
2929 prt("(4) Create a macro", 7, 5);
2930 prt("(5) Remove a macro", 8, 5);
2931 prt("(6) Append keymaps to a file", 9, 5);
2932 prt("(7) Query a keymap", 10, 5);
2933 prt("(8) Create a keymap", 11, 5);
2934 prt("(9) Remove a keymap", 12, 5);
2935 prt("(0) Enter a new action", 13, 5);
2938 #endif /* ALLOW_MACROS */
2942 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2944 prt("Command: ", 16, 0);
2952 if (i == ESCAPE) break;
2954 /* Load a 'macro' file */
2961 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2963 prt("Command: Load a user pref file", 16, 0);
2969 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2971 prt("File: ", 18, 0);
2975 /* Default filename */
2976 sprintf(tmp, "%s.prf", player_name);
2978 /* Ask for a file */
2979 if (!askfor_aux(tmp, 80)) continue;
2981 /* Process the given filename */
2982 err = process_pref_file(tmp);
2986 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2988 msg_format("Loaded default '%s'.", tmp);
2995 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2997 msg_format("Failed to load '%s'!");
3003 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
3005 msg_format("Loaded '%s'.", tmp);
3017 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3019 prt("Command: Append macros to a file", 16, 0);
3025 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3027 prt("File: ", 18, 0);
3031 /* Default filename */
3032 sprintf(tmp, "%s.prf", player_name);
3034 /* Ask for a file */
3035 if (!askfor_aux(tmp, 80)) continue;
3037 /* Dump the macros */
3038 (void)macro_dump(tmp);
3042 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3044 msg_print("Appended macros.");
3056 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
3058 prt("Command: Query a macro", 16, 0);
3064 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3066 prt("Trigger: ", 18, 0);
3070 /* Get a macro trigger */
3071 do_cmd_macro_aux(buf);
3073 /* Acquire action */
3074 k = macro_find_exact(buf);
3081 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3083 msg_print("Found no macro.");
3091 /* Obtain the action */
3092 strcpy(macro__buf, macro__act[k]);
3094 /* Analyze the current action */
3095 ascii_to_text(buf, macro__buf);
3097 /* Display the current action */
3102 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3104 msg_print("Found a macro.");
3110 /* Create a macro */
3115 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3117 prt("Command: Create a macro", 16, 0);
3123 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3125 prt("Trigger: ", 18, 0);
3129 /* Get a macro trigger */
3130 do_cmd_macro_aux(buf);
3137 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3139 prt("Action: ", 20, 0);
3143 /* Convert to text */
3144 ascii_to_text(tmp, macro__buf);
3146 /* Get an encoded action */
3147 if (askfor_aux(tmp, 80))
3149 /* Convert to ascii */
3150 text_to_ascii(macro__buf, tmp);
3152 /* Link the macro */
3153 macro_add(buf, macro__buf);
3157 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3159 msg_print("Added a macro.");
3165 /* Remove a macro */
3170 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3172 prt("Command: Remove a macro", 16, 0);
3178 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3180 prt("Trigger: ", 18, 0);
3184 /* Get a macro trigger */
3185 do_cmd_macro_aux(buf);
3187 /* Link the macro */
3188 macro_add(buf, buf);
3192 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3194 msg_print("Removed a macro.");
3204 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3206 prt("Command: Append keymaps to a file", 16, 0);
3212 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3214 prt("File: ", 18, 0);
3218 /* Default filename */
3219 sprintf(tmp, "%s.prf", player_name);
3221 /* Ask for a file */
3222 if (!askfor_aux(tmp, 80)) continue;
3224 /* Dump the macros */
3225 (void)keymap_dump(tmp);
3229 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3231 msg_print("Appended keymaps.");
3236 /* Query a keymap */
3243 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3245 prt("Command: Query a keymap", 16, 0);
3251 prt("²¡¤¹¥¡¼: ", 18, 0);
3253 prt("Keypress: ", 18, 0);
3257 /* Get a keymap trigger */
3258 do_cmd_macro_aux_keymap(buf);
3260 /* Look up the keymap */
3261 act = keymap_act[mode][(byte)(buf[0])];
3268 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3270 msg_print("Found no keymap.");
3278 /* Obtain the action */
3279 strcpy(macro__buf, act);
3281 /* Analyze the current action */
3282 ascii_to_text(buf, macro__buf);
3284 /* Display the current action */
3289 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3291 msg_print("Found a keymap.");
3297 /* Create a keymap */
3302 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3304 prt("Command: Create a keymap", 16, 0);
3310 prt("²¡¤¹¥¡¼: ", 18, 0);
3312 prt("Keypress: ", 18, 0);
3316 /* Get a keymap trigger */
3317 do_cmd_macro_aux_keymap(buf);
3324 prt("¹ÔÆ°: ", 20, 0);
3326 prt("Action: ", 20, 0);
3330 /* Convert to text */
3331 ascii_to_text(tmp, macro__buf);
3333 /* Get an encoded action */
3334 if (askfor_aux(tmp, 80))
3336 /* Convert to ascii */
3337 text_to_ascii(macro__buf, tmp);
3339 /* Free old keymap */
3340 string_free(keymap_act[mode][(byte)(buf[0])]);
3342 /* Make new keymap */
3343 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3347 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3349 msg_print("Added a keymap.");
3355 /* Remove a keymap */
3360 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3362 prt("Command: Remove a keymap", 16, 0);
3368 prt("²¡¤¹¥¡¼: ", 18, 0);
3370 prt("Keypress: ", 18, 0);
3374 /* Get a keymap trigger */
3375 do_cmd_macro_aux_keymap(buf);
3377 /* Free old keymap */
3378 string_free(keymap_act[mode][(byte)(buf[0])]);
3380 /* Make new keymap */
3381 keymap_act[mode][(byte)(buf[0])] = NULL;
3385 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3387 msg_print("Removed a keymap.");
3392 /* Enter a new action */
3397 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3399 prt("Command: Enter a new action", 16, 0);
3403 /* Go to the correct location */
3406 /* Hack -- limit the value */
3409 /* Get an encoded action */
3410 if (!askfor_aux(buf, 80)) continue;
3412 /* Extract an action */
3413 text_to_ascii(macro__buf, buf);
3416 #endif /* ALLOW_MACROS */
3425 /* Flush messages */
3434 static void cmd_visuals_aux(int i, int *num, int max)
3441 sprintf(str, "%d", *num);
3443 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3446 tmp = strtol(str, NULL, 0);
3447 if (tmp >= 0 && tmp < max)
3451 else if (isupper(i))
3452 *num = (*num + max - 1) % max;
3454 *num = (*num + 1) % max;
3460 * Interact with "visuals"
3462 void do_cmd_visuals(void)
3473 /* File type is "TEXT" */
3474 FILE_TYPE(FILE_TYPE_TEXT);
3477 /* Save the screen */
3481 /* Interact until done */
3487 /* Ask for a choice */
3489 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3491 prt("Interact with Visuals", 2, 0);
3495 /* Give some choices */
3497 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3499 prt("(1) Load a user pref file", 4, 5);
3502 #ifdef ALLOW_VISUALS
3504 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3505 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3506 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3507 prt("(5) (̤»ÈÍÑ)", 8, 5);
3508 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3509 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3510 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3511 prt("(9) (̤»ÈÍÑ)", 12, 5);
3513 prt("(2) Dump monster attr/chars", 5, 5);
3514 prt("(3) Dump object attr/chars", 6, 5);
3515 prt("(4) Dump feature attr/chars", 7, 5);
3516 prt("(5) (unused)", 8, 5);
3517 prt("(6) Change monster attr/chars", 9, 5);
3518 prt("(7) Change object attr/chars", 10, 5);
3519 prt("(8) Change feature attr/chars", 11, 5);
3520 prt("(9) (unused)", 12, 5);
3525 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3527 prt("(0) Reset visuals", 13, 5);
3533 prt("¥³¥Þ¥ó¥É:", 18, 0);
3535 prt("Command: ", 15, 0);
3543 if (i == ESCAPE) break;
3545 /* Load a 'pref' file */
3550 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3552 prt("Command: Load a user pref file", 15, 0);
3558 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3560 prt("File: ", 17, 0);
3564 /* Default filename */
3565 sprintf(tmp, "%s.prf", player_name);
3568 if (!askfor_aux(tmp, 70)) continue;
3570 /* Process the given filename */
3571 (void)process_pref_file(tmp);
3574 #ifdef ALLOW_VISUALS
3576 /* Dump monster attr/chars */
3579 static cptr mark = "Monster attr/chars";
3584 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3586 prt("Command: Dump monster attr/chars", 15, 0);
3592 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3594 prt("File: ", 17, 0);
3598 /* Default filename */
3599 sprintf(tmp, "%s.prf", player_name);
3601 /* Get a filename */
3602 if (!askfor_aux(tmp, 70)) continue;
3604 /* Build the filename */
3605 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3607 /* Append to the file */
3608 fff = open_auto_dump(buf, mark, &line_num);
3613 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3615 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3620 for (i = 0; i < max_r_idx; i++)
3622 monster_race *r_ptr = &r_info[i];
3624 /* Skip non-entries */
3625 if (!r_ptr->name) continue;
3627 /* Dump a comment */
3628 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3631 /* Dump the monster attr/char info */
3632 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3633 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3638 close_auto_dump(fff, mark, line_num);
3642 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3644 msg_print("Dumped monster attr/chars.");
3649 /* Dump object attr/chars */
3652 static cptr mark = "Object attr/chars";
3657 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3659 prt("Command: Dump object attr/chars", 15, 0);
3665 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3667 prt("File: ", 17, 0);
3671 /* Default filename */
3672 sprintf(tmp, "%s.prf", player_name);
3674 /* Get a filename */
3675 if (!askfor_aux(tmp, 70)) continue;
3677 /* Build the filename */
3678 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3680 /* Append to the file */
3681 fff = open_auto_dump(buf, mark, &line_num);
3686 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3688 fprintf(fff, "\n# Object attr/char definitions\n\n");
3693 for (i = 0; i < max_k_idx; i++)
3695 object_kind *k_ptr = &k_info[i];
3697 /* Skip non-entries */
3698 if (!k_ptr->name) continue;
3700 /* Dump a comment */
3701 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3704 /* Dump the object attr/char info */
3705 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3706 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3711 close_auto_dump(fff, mark, line_num);
3715 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3717 msg_print("Dumped object attr/chars.");
3722 /* Dump feature attr/chars */
3725 static cptr mark = "Feature attr/chars";
3730 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3732 prt("Command: Dump feature attr/chars", 15, 0);
3738 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3740 prt("File: ", 17, 0);
3744 /* Default filename */
3745 sprintf(tmp, "%s.prf", player_name);
3747 /* Get a filename */
3748 if (!askfor_aux(tmp, 70)) continue;
3750 /* Build the filename */
3751 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3753 /* Append to the file */
3754 fff = open_auto_dump(buf, mark, &line_num);
3759 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3761 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3766 for (i = 0; i < max_f_idx; i++)
3768 feature_type *f_ptr = &f_info[i];
3770 /* Skip non-entries */
3771 if (!f_ptr->name) continue;
3773 /* Dump a comment */
3774 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3777 /* Dump the feature attr/char info */
3778 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3779 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3784 close_auto_dump(fff, mark, line_num);
3788 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3790 msg_print("Dumped feature attr/chars.");
3795 /* Modify monster attr/chars */
3802 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3804 prt("Command: Change monster attr/chars", 15, 0);
3808 /* Hack -- query until done */
3811 monster_race *r_ptr = &r_info[r];
3815 byte da = (r_ptr->d_attr);
3816 byte dc = (r_ptr->d_char);
3817 byte ca = (r_ptr->x_attr);
3818 byte cc = (r_ptr->x_char);
3820 /* Label the object */
3822 Term_putstr(5, 17, -1, TERM_WHITE,
3823 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3824 r, (r_name + r_ptr->name)));
3826 Term_putstr(5, 17, -1, TERM_WHITE,
3827 format("Monster = %d, Name = %-40.40s",
3828 r, (r_name + r_ptr->name)));
3832 /* Label the Default values */
3834 Term_putstr(10, 19, -1, TERM_WHITE,
3835 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3837 Term_putstr(10, 19, -1, TERM_WHITE,
3838 format("Default attr/char = %3u / %3u", da, dc));
3841 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3842 Term_putch(43, 19, da, dc);
3846 Term_putch(44, 19, 255, -1);
3848 Term_putch(44, 19, 0, ' ');
3851 /* Label the Current values */
3853 Term_putstr(10, 20, -1, TERM_WHITE,
3854 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3856 Term_putstr(10, 20, -1, TERM_WHITE,
3857 format("Current attr/char = %3u / %3u", ca, cc));
3860 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3861 Term_putch(43, 20, ca, cc);
3865 Term_putch(44, 20, 255, -1);
3867 Term_putch(44, 20, 0, ' ');
3872 Term_putstr(0, 22, -1, TERM_WHITE,
3873 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3875 Term_putstr(0, 22, -1, TERM_WHITE,
3876 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3883 if (i == ESCAPE) break;
3885 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3886 else if (isupper(i)) c = 'a' + i - 'A';
3892 cmd_visuals_aux(i, &r, max_r_idx);
3895 t = (int)r_ptr->x_attr;
3896 cmd_visuals_aux(i, &t, 256);
3897 r_ptr->x_attr = (byte)t;
3900 t = (int)r_ptr->x_char;
3901 cmd_visuals_aux(i, &t, 256);
3902 r_ptr->x_char = (byte)t;
3908 /* Modify object attr/chars */
3915 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3917 prt("Command: Change object attr/chars", 15, 0);
3921 /* Hack -- query until done */
3924 object_kind *k_ptr = &k_info[k];
3928 byte da = (byte)k_ptr->d_attr;
3929 byte dc = (byte)k_ptr->d_char;
3930 byte ca = (byte)k_ptr->x_attr;
3931 byte cc = (byte)k_ptr->x_char;
3933 /* Label the object */
3935 Term_putstr(5, 17, -1, TERM_WHITE,
3936 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3937 k, (k_name + k_ptr->name)));
3939 Term_putstr(5, 17, -1, TERM_WHITE,
3940 format("Object = %d, Name = %-40.40s",
3941 k, (k_name + k_ptr->name)));
3945 /* Label the Default values */
3947 Term_putstr(10, 19, -1, TERM_WHITE,
3948 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3950 Term_putstr(10, 19, -1, TERM_WHITE,
3951 format("Default attr/char = %3d / %3d", da, dc));
3954 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3955 Term_putch(43, 19, da, dc);
3959 Term_putch(44, 19, 255, -1);
3961 Term_putch(44, 19, 0, ' ');
3964 /* Label the Current values */
3966 Term_putstr(10, 20, -1, TERM_WHITE,
3967 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3969 Term_putstr(10, 20, -1, TERM_WHITE,
3970 format("Current attr/char = %3d / %3d", ca, cc));
3973 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3974 Term_putch(43, 20, ca, cc);
3978 Term_putch(44, 20, 255, -1);
3980 Term_putch(44, 20, 0, ' ');
3985 Term_putstr(0, 22, -1, TERM_WHITE,
3986 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3988 Term_putstr(0, 22, -1, TERM_WHITE,
3989 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3996 if (i == ESCAPE) break;
3998 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3999 else if (isupper(i)) c = 'a' + i - 'A';
4005 cmd_visuals_aux(i, &k, max_k_idx);
4008 t = (int)k_info[k].x_attr;
4009 cmd_visuals_aux(i, &t, 256);
4010 k_info[k].x_attr = (byte)t;
4013 t = (int)k_info[k].x_char;
4014 cmd_visuals_aux(i, &t, 256);
4015 k_info[k].x_char = (byte)t;
4021 /* Modify feature attr/chars */
4028 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
4030 prt("Command: Change feature attr/chars", 15, 0);
4034 /* Hack -- query until done */
4037 feature_type *f_ptr = &f_info[f];
4041 byte da = (byte)f_ptr->d_attr;
4042 byte dc = (byte)f_ptr->d_char;
4043 byte ca = (byte)f_ptr->x_attr;
4044 byte cc = (byte)f_ptr->x_char;
4046 /* Label the object */
4048 Term_putstr(5, 17, -1, TERM_WHITE,
4049 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
4050 f, (f_name + f_ptr->name)));
4052 Term_putstr(5, 17, -1, TERM_WHITE,
4053 format("Terrain = %d, Name = %-40.40s",
4054 f, (f_name + f_ptr->name)));
4058 /* Label the Default values */
4060 Term_putstr(10, 19, -1, TERM_WHITE,
4061 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4063 Term_putstr(10, 19, -1, TERM_WHITE,
4064 format("Default attr/char = %3d / %3d", da, dc));
4067 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
4068 Term_putch(43, 19, da, dc);
4072 Term_putch(44, 19, 255, -1);
4074 Term_putch(44, 19, 0, ' ');
4077 /* Label the Current values */
4079 Term_putstr(10, 20, -1, TERM_WHITE,
4080 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4082 Term_putstr(10, 20, -1, TERM_WHITE,
4083 format("Current attr/char = %3d / %3d", ca, cc));
4086 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
4087 Term_putch(43, 20, ca, cc);
4091 Term_putch(44, 20, 255, -1);
4093 Term_putch(44, 20, 0, ' ');
4098 Term_putstr(0, 22, -1, TERM_WHITE,
4099 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
4101 Term_putstr(0, 22, -1, TERM_WHITE,
4102 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4109 if (i == ESCAPE) break;
4111 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4112 else if (isupper(i)) c = 'a' + i - 'A';
4118 cmd_visuals_aux(i, &f, max_f_idx);
4121 t = (int)f_info[f].x_attr;
4122 cmd_visuals_aux(i, &t, 256);
4123 f_info[f].x_attr = (byte)t;
4126 t = (int)f_info[f].x_char;
4127 cmd_visuals_aux(i, &t, 256);
4128 f_info[f].x_char = (byte)t;
4144 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4146 msg_print("Visual attr/char tables reset.");
4151 /* Unknown option */
4157 /* Flush messages */
4162 /* Restore the screen */
4168 * Interact with "colors"
4170 void do_cmd_colors(void)
4181 /* File type is "TEXT" */
4182 FILE_TYPE(FILE_TYPE_TEXT);
4185 /* Save the screen */
4189 /* Interact until done */
4195 /* Ask for a choice */
4197 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4199 prt("Interact with Colors", 2, 0);
4203 /* Give some choices */
4205 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4207 prt("(1) Load a user pref file", 4, 5);
4212 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4213 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4215 prt("(2) Dump colors", 5, 5);
4216 prt("(3) Modify colors", 6, 5);
4223 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4225 prt("Command: ", 8, 0);
4233 if (i == ESCAPE) break;
4235 /* Load a 'pref' file */
4240 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4242 prt("Command: Load a user pref file", 8, 0);
4248 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4250 prt("File: ", 10, 0);
4255 sprintf(tmp, "%s.prf", player_name);
4258 if (!askfor_aux(tmp, 70)) continue;
4260 /* Process the given filename */
4261 (void)process_pref_file(tmp);
4263 /* Mega-Hack -- react to changes */
4264 Term_xtra(TERM_XTRA_REACT, 0);
4266 /* Mega-Hack -- redraw */
4275 static cptr mark = "Colors";
4280 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4282 prt("Command: Dump colors", 8, 0);
4288 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4290 prt("File: ", 10, 0);
4294 /* Default filename */
4295 sprintf(tmp, "%s.prf", player_name);
4297 /* Get a filename */
4298 if (!askfor_aux(tmp, 70)) continue;
4300 /* Build the filename */
4301 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4303 /* Append to the file */
4304 fff = open_auto_dump(buf, mark, &line_num);
4309 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4311 fprintf(fff, "\n# Color redefinitions\n\n");
4316 for (i = 0; i < 256; i++)
4318 int kv = angband_color_table[i][0];
4319 int rv = angband_color_table[i][1];
4320 int gv = angband_color_table[i][2];
4321 int bv = angband_color_table[i][3];
4326 cptr name = "unknown";
4330 /* Skip non-entries */
4331 if (!kv && !rv && !gv && !bv) continue;
4333 /* Extract the color name */
4334 if (i < 16) name = color_names[i];
4336 /* Dump a comment */
4338 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4340 fprintf(fff, "# Color '%s'\n", name);
4344 /* Dump the monster attr/char info */
4345 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4351 close_auto_dump(fff, mark, line_num);
4355 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4357 msg_print("Dumped color redefinitions.");
4369 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4371 prt("Command: Modify colors", 8, 0);
4375 /* Hack -- query until done */
4384 /* Exhibit the normal colors */
4385 for (j = 0; j < 16; j++)
4387 /* Exhibit this color */
4388 Term_putstr(j*4, 20, -1, a, "###");
4390 /* Exhibit all colors */
4391 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4394 /* Describe the color */
4396 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4398 name = ((a < 16) ? color_names[a] : "undefined");
4402 /* Describe the color */
4404 Term_putstr(5, 10, -1, TERM_WHITE,
4405 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4407 Term_putstr(5, 10, -1, TERM_WHITE,
4408 format("Color = %d, Name = %s", a, name));
4412 /* Label the Current values */
4413 Term_putstr(5, 12, -1, TERM_WHITE,
4414 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4415 angband_color_table[a][0],
4416 angband_color_table[a][1],
4417 angband_color_table[a][2],
4418 angband_color_table[a][3]));
4422 Term_putstr(0, 14, -1, TERM_WHITE,
4423 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4425 Term_putstr(0, 14, -1, TERM_WHITE,
4426 "Command (n/N/k/K/r/R/g/G/b/B): ");
4434 if (i == ESCAPE) break;
4437 if (i == 'n') a = (byte)(a + 1);
4438 if (i == 'N') a = (byte)(a - 1);
4439 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4440 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4441 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4442 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4443 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4444 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4445 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4446 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4448 /* Hack -- react to changes */
4449 Term_xtra(TERM_XTRA_REACT, 0);
4451 /* Hack -- redraw */
4458 /* Unknown option */
4464 /* Flush messages */
4469 /* Restore the screen */
4475 * Note something in the message recall
4477 void do_cmd_note(void)
4486 if (!get_string("¥á¥â: ", buf, 60)) return;
4488 if (!get_string("Note: ", buf, 60)) return;
4492 /* Ignore empty notes */
4493 if (!buf[0] || (buf[0] == ' ')) return;
4495 /* Add the note to the message recall */
4497 msg_format("¥á¥â: %s", buf);
4499 msg_format("Note: %s", buf);
4506 * Mention the current version
4508 void do_cmd_version(void)
4513 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4514 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4516 msg_format("You are playing Hengband %d.%d.%d.",
4517 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4524 * Array of feeling strings
4526 static cptr do_cmd_feeling_text[11] =
4529 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4531 "Looks like any other level.",
4535 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4537 "You feel there is something special about this level.",
4541 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4543 "You nearly faint as horrible visions of death fill your mind!",
4547 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4549 "This level looks very dangerous.",
4553 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4555 "You have a very bad feeling...",
4559 "°¤¤Í½´¶¤¬¤¹¤ë...",
4561 "You have a bad feeling...",
4567 "You feel nervous.",
4571 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4573 "You feel your luck is turning...",
4577 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4579 "You don't like the look of this place.",
4583 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4585 "This level looks reasonably safe.",
4589 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4591 "What a boring place..."
4596 static cptr do_cmd_feeling_text_combat[11] =
4599 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4601 "Looks like any other level.",
4605 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4607 "You feel there is something special about this level.",
4611 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4613 "You nearly faint as horrible visions of death fill your mind!",
4617 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4619 "This level looks very dangerous.",
4623 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4625 "You have a very bad feeling...",
4629 "°¤¤Í½´¶¤¬¤¹¤ë...",
4631 "You have a bad feeling...",
4637 "You feel nervous.",
4641 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4643 "You feel your luck is turning...",
4647 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4649 "You don't like the look of this place.",
4653 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4655 "This level looks reasonably safe.",
4659 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4661 "What a boring place..."
4666 static cptr do_cmd_feeling_text_lucky[11] =
4669 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4670 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4671 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4672 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4673 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4674 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4675 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4676 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4677 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4678 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4679 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4681 "Looks like any other level.",
4682 "You feel there is something special about this level.",
4683 "You have a superb feeling about this level.",
4684 "You have an excellent feeling...",
4685 "You have a very good feeling...",
4686 "You have a good feeling...",
4687 "You feel strangely lucky...",
4688 "You feel your luck is turning...",
4689 "You like the look of this place...",
4690 "This level can't be all bad...",
4691 "What a boring place..."
4697 * Note that "feeling" is set to zero unless some time has passed.
4698 * Note that this is done when the level is GENERATED, not entered.
4700 void do_cmd_feeling(void)
4702 /* Verify the feeling */
4703 if (feeling > 10) feeling = 10;
4705 /* No useful feeling in quests */
4706 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4709 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4711 msg_print("Looks like a typical quest level.");
4717 /* No useful feeling in town */
4718 else if (p_ptr->town_num && !dun_level)
4721 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4723 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4727 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4729 msg_print("Looks like a strange wilderness.");
4737 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4739 msg_print("Looks like a typical town.");
4746 /* No useful feeling in the wilderness */
4747 else if (!dun_level)
4750 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4752 msg_print("Looks like a typical wilderness.");
4758 /* Display the feeling */
4759 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4761 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4763 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4764 msg_print(do_cmd_feeling_text_combat[feeling]);
4766 msg_print(do_cmd_feeling_text[feeling]);
4771 msg_print(do_cmd_feeling_text[0]);
4777 #define BROWSER_ROWS 16
4779 * Description of each monster group.
4781 static cptr monster_group_text[] =
4784 "¥æ¥Ë¡¼¥¯", /* "Uniques" */
4813 /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */
4830 /* "¾åµé¥Ç¡¼¥â¥ó", */
4868 /* "Ancient Dragon/Wyrm", */
4877 "Multi-Headed Reptile",
4882 "Reptile/Amphibian",
4883 "Spider/Scorpion/Tick",
4885 /* "Major Demon", */
4898 * Symbols of monsters in each group. Note the "Uniques" group
4899 * is handled differently.
4901 static cptr monster_group_char[] =
4962 * hook function to sort monsters by level
4964 static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
4966 u16b *who = (u16b*)(u);
4971 monster_race *r_ptr1 = &r_info[w1];
4972 monster_race *r_ptr2 = &r_info[w2];
4974 if (r_ptr2->level > r_ptr1->level) return TRUE;
4975 if (r_ptr1->level > r_ptr2->level) return FALSE;
4977 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
4978 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
4983 * Build a list of monster indexes in the given group. Return the number
4984 * of monsters in the group.
4986 * mode & 0x01 : check for non-empty group
4987 * mode & 0x02 : cheat?
4989 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
4994 /* Get a list of x_char in this group */
4995 cptr group_char = monster_group_char[grp_cur];
4997 /* XXX Hack -- Check if this is the "Uniques" group */
4998 bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
5000 /* Check every race */
5001 for (i = 0; i < max_r_idx; i++)
5003 /* Access the race */
5004 monster_race *r_ptr = &r_info[i];
5006 /* Is this a unique? */
5007 bool unique = (bool)(r_ptr->flags1 & (RF1_UNIQUE)) ;
5009 /* Skip empty race */
5010 if (!r_ptr->name) continue ;
5012 /* Require known monsters */
5013 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights ) continue;
5015 if (grp_unique && !(unique)) continue;
5017 /* Check for race in the group */
5018 if (grp_unique || strchr(group_char, r_ptr->d_char))
5021 mon_idx[mon_cnt++] = i;
5023 /* XXX Hack -- Just checking for non-empty group */
5024 if (mode & 0x01) break;
5028 /* Terminate the list */
5029 mon_idx[mon_cnt] = 0;
5031 /* Select the sort method */
5032 ang_sort_comp = ang_sort_comp_monster_level;
5033 ang_sort_swap = ang_sort_swap_hook;
5035 /* Sort by monster level */
5036 ang_sort(mon_idx, &dummy_why, mon_cnt);
5038 /* Return the number of races */
5044 * Description of each monster group.
5046 static cptr object_group_text[] =
5049 "¥¥Î¥³", /* "Mushrooms" */
5050 "Ìô", /* "Potions" */
5051 "Ìý¤Ä¤Ü", /* "Flasks" */
5052 "´¬Êª", /* "Scrolls" */
5053 "»ØÎØ", /* "Rings" */
5054 "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */
5055 "ū", /* "Whistle" */
5056 "¸÷¸»", /* "Lanterns" */
5057 "ËâË¡ËÀ", /* "Wands" */
5058 "¾ó", /* "Staffs" */
5059 "¥í¥Ã¥É", /* "Rods" */
5060 "¥«¡¼¥É", /* "Cards" */
5061 "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë",
5069 "Åá·õÎà", /* "Swords" */
5070 "Æß´ï", /* "Blunt Weapons" */
5071 "ĹÊÁÉð´ï", /* "Polearms" */
5072 "ºÎ·¡Æ»¶ñ", /* "Diggers" */
5073 "Èô¤ÓÆ»¶ñ", /* "Bows" */
5077 "·ÚÁõ³»", /* "Soft Armor" */
5078 "½ÅÁõ³»", /* "Hard Armor" */
5079 "¥É¥é¥´¥ó³»", /* "Dragon Armor" */
5080 "½â", /* "Shields" */
5081 "¥¯¥í¡¼¥¯", /* "Cloaks" */
5082 "äƼê", /* "Gloves" */
5083 "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */
5084 "´§", /* "Crowns" */
5085 "¥Ö¡¼¥Ä", /* "Boots" */
5129 * TVALs of items in each group
5131 static byte object_group_tval[] =
5176 * Build a list of monster indexes in the given group. Return the number
5177 * of monsters in the group.
5179 static int collect_objects(int grp_cur, int object_idx[])
5181 int i, j, k, object_cnt = 0;
5183 /* Get a list of x_char in this group */
5184 byte group_tval = object_group_tval[grp_cur];
5186 /* Check every object */
5187 for (i = 0; i < max_k_idx; i++)
5189 /* Access the race */
5190 object_kind *k_ptr = &k_info[i];
5192 /* Skip empty objects */
5193 if (!k_ptr->name) continue;
5195 /* Skip non-flavoured objects */
5196 if (!k_ptr->flavor) continue;
5198 /* Skip items with no distribution (special artifacts) */
5199 for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
5202 /* Require objects ever seen*/
5203 if (!k_ptr->aware) continue;
5205 /* Check for race in the group */
5206 if (k_ptr->tval == group_tval)
5209 object_idx[object_cnt++] = i;
5213 /* Terminate the list */
5214 object_idx[object_cnt] = 0;
5216 /* Return the number of races */
5223 * Build a list of monster indexes in the given group. Return the number
5224 * of monsters in the group.
5226 static int collect_artifacts(int grp_cur, int object_idx[])
5228 int i, object_cnt = 0;
5230 /* Get a list of x_char in this group */
5231 byte group_tval = object_group_tval[grp_cur];
5233 /* Check every object */
5234 for (i = 0; i < max_a_idx; i++)
5236 /* Access the artifact */
5237 artifact_type *a_ptr = &a_info[i];
5239 /* Skip empty artifacts */
5240 if (!a_ptr->name) continue;
5242 /* Skip "uncreated" artifacts */
5243 if (!a_ptr->cur_num) continue;
5245 /* Check for race in the group */
5246 if (a_ptr->tval == group_tval)
5249 object_idx[object_cnt++] = i;
5253 /* Terminate the list */
5254 object_idx[object_cnt] = 0;
5256 /* Return the number of races */
5263 * Encode the screen colors
5265 static char hack[17] = "dwsorgbuDWvyRGBU";
5268 static errr photo_fgets(FILE *fff, char *buf, huge n)
5277 if (fgets(tmp, 1024, fff))
5279 /* Convert weirdness */
5280 for (s = tmp; *s; s++)
5282 /* Handle newline */
5293 else if (*s == '\t')
5295 /* Hack -- require room */
5296 if (i + 8 >= n) break;
5298 /* Append a space */
5301 /* Append some more spaces */
5302 while (!(i % 8)) buf[i++] = ' ';
5306 else if (iskanji(*s))
5313 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
5314 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
5321 /* Handle printables */
5342 * Hack -- load a screen dump from a file
5344 void do_cmd_load_screen(void)
5359 Term_get_size(&wid, &hgt);
5361 /* Hack -- drop permissions */
5364 /* Build the filename */
5365 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5367 /* Append to the file */
5368 fff = my_fopen(buf, "r");
5373 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5375 msg_format("Failed to open %s.", buf);
5382 /* Save the screen */
5385 /* Clear the screen */
5389 /* Load the screen */
5390 for (y = 0; okay && (y < hgt); y++)
5392 /* Get a line of data */
5393 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5396 for (x = 0; x < wid - 1; x++)
5398 /* Put the attr/char */
5399 Term_draw(x, y, TERM_WHITE, buf[x]);
5403 /* Get the blank line */
5404 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5407 /* Dump the screen */
5408 for (y = 0; okay && (y < hgt); y++)
5410 /* Get a line of data */
5411 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
5414 for (x = 0; x < wid - 1; x++)
5416 /* Get the attr/char */
5417 (void)(Term_what(x, y, &a, &c));
5419 /* Look up the attr */
5420 for (i = 0; i < 16; i++)
5422 /* Use attr matches */
5423 if (hack[i] == buf[x]) a = i;
5426 /* Put the attr/char */
5427 Term_draw(x, y, a, c);
5432 /* Get the blank line */
5433 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
5439 /* Hack -- grab permissions */
5445 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
5447 msg_print("Screen dump loaded.");
5454 /* Restore the screen */
5461 cptr inven_res_label =
5463 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
5465 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
5468 /* XTRA HACK RESLIST */
5469 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
5470 int *j, byte tval, char *where)
5472 char o_name[MAX_NLEN];
5473 u32b flgs[TR_FLAG_SIZE];
5475 if (!o_ptr->k_idx)return;
5476 if (o_ptr->tval != tval)return;
5479 * HACK:Ring of Lordly protection and Dragon shield/helm
5480 * have random resistances.
5482 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
5483 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
5484 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
5485 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
5486 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
5487 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
5488 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
5491 object_desc(o_name, o_ptr, TRUE, 0);
5493 while ( o_name[i] && i < 26 ){
5495 if (iskanji(o_name[i])) i++;
5499 if(i<28) while(i<28){o_name[i]=' ';i++;}
5502 fprintf(fff,"%s %s", where, o_name);
5504 if (!(o_ptr->ident & (IDENT_MENTAL)))
5507 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
5509 fprintf(fff, "-------unknown------------ -------unknown------\n");
5513 object_flags_known(o_ptr, flgs);
5516 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
5517 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
5518 else fprintf(fff,"¡¦");
5520 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
5521 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
5522 else fprintf(fff,"¡¦");
5524 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
5525 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
5526 else fprintf(fff,"¡¦");
5528 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
5529 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
5530 else fprintf(fff,"¡¦");
5532 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
5533 else fprintf(fff,"¡¦");
5535 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
5536 else fprintf(fff,"¡¦");
5538 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
5539 else fprintf(fff,"¡¦");
5541 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
5542 else fprintf(fff,"¡¦");
5544 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
5545 else fprintf(fff,"¡¦");
5547 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
5548 else fprintf(fff,"¡¦");
5550 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
5551 else fprintf(fff,"¡¦");
5553 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
5554 else fprintf(fff,"¡¦");
5556 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
5557 else fprintf(fff,"¡¦");
5561 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
5562 else fprintf(fff,"¡¦");
5564 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
5565 else fprintf(fff,"¡¦");
5567 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
5568 else fprintf(fff,"¡¦");
5570 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
5571 else fprintf(fff,"¡¦");
5573 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
5574 else fprintf(fff,"¡¦");
5576 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
5577 else fprintf(fff,"¡¦");
5579 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
5580 else fprintf(fff,"¡¦");
5582 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
5583 else fprintf(fff,"¡¦");
5586 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
5587 else fprintf(fff,"¡¦");
5589 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
5590 else fprintf(fff,"¡¦");
5592 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
5593 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
5594 else fprintf(fff,". ");
5596 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
5597 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
5598 else fprintf(fff,". ");
5600 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
5601 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
5602 else fprintf(fff,". ");
5604 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5605 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5606 else fprintf(fff,". ");
5608 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5609 else fprintf(fff,". ");
5611 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5612 else fprintf(fff,". ");
5614 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5615 else fprintf(fff,". ");
5617 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5618 else fprintf(fff,". ");
5620 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5621 else fprintf(fff,". ");
5623 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5624 else fprintf(fff,". ");
5626 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5627 else fprintf(fff,". ");
5629 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5630 else fprintf(fff,". ");
5632 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5633 else fprintf(fff,". ");
5637 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5638 else fprintf(fff,". ");
5640 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5641 else fprintf(fff,". ");
5643 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5644 else fprintf(fff,". ");
5646 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5647 else fprintf(fff,". ");
5649 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5650 else fprintf(fff,". ");
5652 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5653 else fprintf(fff,". ");
5655 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5656 else fprintf(fff,". ");
5658 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5659 else fprintf(fff,". ");
5662 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5663 else fprintf(fff,". ");
5665 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5666 else fprintf(fff,". ");
5674 fprintf(fff,"%s\n", inven_res_label);
5680 * Display *ID* ed weapons/armors's resistances
5682 static void do_cmd_knowledge_inven(void)
5687 char file_name[1024];
5698 /* Open a new file */
5699 fff = my_fopen_temp(file_name, 1024);
5702 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5704 msg_format("Failed to create temporally file %s.", file_name);
5709 fprintf(fff,"%s\n",inven_res_label);
5711 for (tval=TV_BOW; tval <= TV_RING; tval++){
5714 for (;j<9;j++) fprintf(fff, "\n");
5716 fprintf(fff,"%s\n",inven_res_label);
5720 strcpy(where, "Áõ");
5722 strcpy(where, "E ");
5724 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5726 o_ptr = &inventory[i];
5727 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5731 strcpy(where, "»ý");
5733 strcpy(where, "I ");
5735 for (i = 0; i < INVEN_PACK; i++)
5737 o_ptr = &inventory[i];
5738 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5742 /* Print all homes in the different towns */
5743 st_ptr = &town[1].store[STORE_HOME];
5745 strcpy(where, "²È");
5747 strcpy(where, "H ");
5750 /* Dump all available items */
5751 for (i = 0; i < st_ptr->stock_num; i++)
5753 o_ptr = &st_ptr->stock[i];
5754 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5758 /* Close the file */
5761 /* Display the file contents */
5763 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5765 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5768 /* Remove the file */
5773 void do_cmd_save_screen_html_aux(char *filename, int message)
5777 byte a = 0, old_a = 0;
5791 cptr html_head[] = {
5792 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5796 cptr html_foot[] = {
5798 "</body>\n</html>\n",
5804 Term_get_size(&wid, &hgt);
5806 /* File type is "TEXT" */
5807 FILE_TYPE(FILE_TYPE_TEXT);
5809 /* Append to the file */
5810 fff = my_fopen(filename, "w");
5816 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5818 msg_format("Failed to open file %s.", filename);
5826 /* Save the screen */
5830 /* Build the filename */
5831 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5832 tmpfff = my_fopen(buf, "r");
5834 for (i = 0; html_head[i]; i++)
5835 fprintf(fff, html_head[i]);
5839 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5841 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5845 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5847 fprintf(fff, "%s\n", buf);
5852 /* Dump the screen */
5853 for (y = 0; y < hgt; y++)
5860 for (x = 0; x < wid - 1; x++)
5864 /* Get the attr/char */
5865 (void)(Term_what(x, y, &a, &c));
5869 case '&': cc = "&"; break;
5870 case '<': cc = "<"; break;
5871 case '>': cc = ">"; break;
5873 case 0x1f: c = '.'; break;
5874 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5879 if ((y == 0 && x == 0) || a != old_a) {
5880 rv = angband_color_table[a][1];
5881 gv = angband_color_table[a][2];
5882 bv = angband_color_table[a][3];
5883 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5884 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5888 fprintf(fff, "%s", cc);
5890 fprintf(fff, "%c", c);
5893 fprintf(fff, "</font>");
5896 for (i = 0; html_foot[i]; i++)
5897 fprintf(fff, html_foot[i]);
5902 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5904 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5908 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5910 fprintf(fff, "%s\n", buf);
5925 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5927 msg_print("Screen dump saved.");
5932 /* Restore the screen */
5938 * Hack -- save a screen dump to a file
5940 static void do_cmd_save_screen_html(void)
5942 char buf[1024], tmp[256] = "screen.html";
5945 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5947 if (!get_string("File name: ", tmp, 80))
5951 /* Build the filename */
5952 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5956 /* Hack -- drop permissions */
5959 do_cmd_save_screen_html_aux(buf, 1);
5961 /* Hack -- grab permissions */
5967 * Redefinable "save_screen" action
5969 void (*screendump_aux)(void) = NULL;
5973 * Hack -- save a screen dump to a file
5975 void do_cmd_save_screen(void)
5977 bool old_use_graphics = use_graphics;
5978 bool html_dump = FALSE;
5983 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
5985 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
5990 if (c == 'Y' || c == 'y')
5992 else if (c == 'H' || c == 'h')
6004 Term_get_size(&wid, &hgt);
6006 if (old_use_graphics)
6008 use_graphics = FALSE;
6011 /* Redraw everything */
6012 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6014 /* Hack -- update */
6020 do_cmd_save_screen_html();
6024 /* Do we use a special screendump function ? */
6025 else if (screendump_aux)
6027 /* Dump the screen to a graphics file */
6028 (*screendump_aux)();
6030 else /* Dump the screen as text */
6042 /* Hack -- drop permissions */
6045 /* Build the filename */
6046 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
6048 /* File type is "TEXT" */
6049 FILE_TYPE(FILE_TYPE_TEXT);
6051 /* Append to the file */
6052 fff = my_fopen(buf, "w");
6057 /* Hack -- grab permissions */
6060 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
6062 msg_format("Failed to open file %s.", buf);
6069 /* Save the screen */
6073 /* Dump the screen */
6074 for (y = 0; y < hgt; y++)
6077 for (x = 0; x < wid - 1; x++)
6079 /* Get the attr/char */
6080 (void)(Term_what(x, y, &a, &c));
6090 fprintf(fff, "%s\n", buf);
6097 /* Dump the screen */
6098 for (y = 0; y < hgt; y++)
6101 for (x = 0; x < wid - 1; x++)
6103 /* Get the attr/char */
6104 (void)(Term_what(x, y, &a, &c));
6107 buf[x] = hack[a&0x0F];
6114 fprintf(fff, "%s\n", buf);
6124 /* Hack -- grab permissions */
6129 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
6131 msg_print("Screen dump saved.");
6137 /* Restore the screen */
6141 if (old_use_graphics)
6143 use_graphics = TRUE;
6146 /* Redraw everything */
6147 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
6149 /* Hack -- update */
6156 * Sorting hook -- Comp function -- see below
6158 * We use "u" to point to array of monster indexes,
6159 * and "v" to select the type of sorting to perform on "u".
6161 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
6163 u16b *who = (u16b*)(u);
6165 u16b *why = (u16b*)(v);
6173 /* Sort by total kills */
6176 /* Extract total kills */
6177 z1 = a_info[w1].tval;
6178 z2 = a_info[w2].tval;
6180 /* Compare total kills */
6181 if (z1 < z2) return (TRUE);
6182 if (z1 > z2) return (FALSE);
6186 /* Sort by monster level */
6189 /* Extract levels */
6190 z1 = a_info[w1].sval;
6191 z2 = a_info[w2].sval;
6193 /* Compare levels */
6194 if (z1 < z2) return (TRUE);
6195 if (z1 > z2) return (FALSE);
6199 /* Sort by monster experience */
6202 /* Extract experience */
6203 z1 = a_info[w1].level;
6204 z2 = a_info[w2].level;
6206 /* Compare experience */
6207 if (z1 < z2) return (TRUE);
6208 if (z1 > z2) return (FALSE);
6212 /* Compare indexes */
6218 * Sorting hook -- Swap function -- see below
6220 * We use "u" to point to array of monster indexes,
6221 * and "v" to select the type of sorting to perform.
6223 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
6225 u16b *who = (u16b*)(u);
6237 * Check the status of "artifacts"
6239 static void do_cmd_knowledge_artifacts(void)
6241 int i, k, z, x, y, n = 0;
6247 char file_name[1024];
6249 char base_name[MAX_NLEN];
6253 /* Open a new file */
6254 fff = my_fopen_temp(file_name, 1024);
6258 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6260 msg_format("Failed to create temporary file %s.", file_name);
6266 /* Allocate the "who" array */
6267 C_MAKE(who, max_a_idx, s16b);
6269 /* Allocate the "okay" array */
6270 C_MAKE(okay, max_a_idx, bool);
6272 /* Scan the artifacts */
6273 for (k = 0; k < max_a_idx; k++)
6275 artifact_type *a_ptr = &a_info[k];
6280 /* Skip "empty" artifacts */
6281 if (!a_ptr->name) continue;
6283 /* Skip "uncreated" artifacts */
6284 if (!a_ptr->cur_num) continue;
6290 /* Check the dungeon */
6291 for (y = 0; y < cur_hgt; y++)
6293 for (x = 0; x < cur_wid; x++)
6295 cave_type *c_ptr = &cave[y][x];
6297 s16b this_o_idx, next_o_idx = 0;
6299 /* Scan all objects in the grid */
6300 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
6304 /* Acquire object */
6305 o_ptr = &o_list[this_o_idx];
6307 /* Acquire next object */
6308 next_o_idx = o_ptr->next_o_idx;
6310 /* Ignore non-artifacts */
6311 if (!artifact_p(o_ptr)) continue;
6313 /* Ignore known items */
6314 if (object_known_p(o_ptr)) continue;
6316 /* Note the artifact */
6317 okay[o_ptr->name1] = FALSE;
6322 /* Check the inventory and equipment */
6323 for (i = 0; i < INVEN_TOTAL; i++)
6325 object_type *o_ptr = &inventory[i];
6327 /* Ignore non-objects */
6328 if (!o_ptr->k_idx) continue;
6330 /* Ignore non-artifacts */
6331 if (!artifact_p(o_ptr)) continue;
6333 /* Ignore known items */
6334 if (object_known_p(o_ptr)) continue;
6336 /* Note the artifact */
6337 okay[o_ptr->name1] = FALSE;
6340 for (k = 0; k < max_a_idx; k++)
6342 if (okay[k]) who[n++] = k;
6345 /* Select the sort method */
6346 ang_sort_comp = ang_sort_art_comp;
6347 ang_sort_swap = ang_sort_art_swap;
6349 /* Sort the array by dungeon depth of monsters */
6350 ang_sort(who, &why, n);
6352 /* Scan the artifacts */
6353 for (k = 0; k < n; k++)
6355 artifact_type *a_ptr = &a_info[who[k]];
6359 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
6361 strcpy(base_name, "Unknown Artifact");
6365 /* Obtain the base object type */
6366 z = lookup_kind(a_ptr->tval, a_ptr->sval);
6374 /* Get local object */
6377 /* Create fake object */
6378 object_prep(q_ptr, z);
6380 /* Make it an artifact */
6381 q_ptr->name1 = (byte)who[k];
6383 /* Describe the artifact */
6384 object_desc_store(base_name, q_ptr, FALSE, 0);
6387 /* Hack -- Build the artifact name */
6389 fprintf(fff, " %s\n", base_name);
6391 fprintf(fff, " The %s\n", base_name);
6396 /* Free the "who" array */
6397 C_KILL(who, max_a_idx, s16b);
6399 /* Free the "okay" array */
6400 C_KILL(okay, max_a_idx, bool);
6402 /* Close the file */
6405 /* Display the file contents */
6407 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
6409 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
6413 /* Remove the file */
6419 * Display known uniques
6421 static void do_cmd_knowledge_uniques(void)
6429 char file_name[1024];
6431 /* Open a new file */
6432 fff = my_fopen_temp(file_name, 1024);
6436 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6438 msg_format("Failed to create temporary file %s.", file_name);
6444 /* Allocate the "who" array */
6445 C_MAKE(who, max_r_idx, s16b);
6447 /* Scan the monsters */
6448 for (i = 1; i < max_r_idx; i++)
6450 monster_race *r_ptr = &r_info[i];
6452 /* Use that monster */
6453 if (r_ptr->name) who[n++] = i;
6456 /* Select the sort method */
6457 ang_sort_comp = ang_sort_comp_hook;
6458 ang_sort_swap = ang_sort_swap_hook;
6460 /* Sort the array by dungeon depth of monsters */
6461 ang_sort(who, &why, n);
6463 /* Scan the monster races */
6464 for (k = 0; k < n; k++)
6466 monster_race *r_ptr = &r_info[who[k]];
6468 /* Only print Uniques */
6469 if (r_ptr->flags1 & (RF1_UNIQUE))
6471 bool dead = (r_ptr->max_num == 0);
6475 /* Only display "known" uniques */
6476 if (dead || cheat_know || r_ptr->r_sights)
6478 /* Print a message */
6480 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
6481 (r_name + r_ptr->name));
6483 fprintf(fff, " %s is alive\n",
6484 (r_name + r_ptr->name));
6491 /* Free the "who" array */
6492 C_KILL(who, max_r_idx, s16b);
6494 /* Close the file */
6497 /* Display the file contents */
6499 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6501 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6505 /* Remove the file */
6512 * Display dead uniques
6514 static void do_cmd_knowledge_uniques_dead(void)
6522 char file_name[1024];
6524 /* Open a new file */
6525 fff = my_fopen_temp(file_name, 1024);
6529 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6531 msg_format("Failed to create temporary file %s.", file_name);
6537 /* Allocate the "who" array */
6538 C_MAKE(who, max_r_idx, s16b);
6540 /* Scan the monsters */
6541 for (i = 1; i < max_r_idx; i++)
6543 monster_race *r_ptr = &r_info[i];
6545 /* Use that monster */
6546 if (r_ptr->name) who[n++] = i;
6549 /* Select the sort method */
6550 ang_sort_comp = ang_sort_comp_hook;
6551 ang_sort_swap = ang_sort_swap_hook;
6553 /* Sort the array by dungeon depth of monsters */
6554 ang_sort(who, &why, n);
6556 /* Scan the monster races */
6557 for (k = 0; k < n; k++)
6559 monster_race *r_ptr = &r_info[who[k]];
6561 /* Only print Uniques */
6562 if (r_ptr->flags1 & (RF1_UNIQUE))
6564 bool dead = (r_ptr->max_num == 0);
6566 if (!dead) continue;
6568 /* Only display "known" uniques */
6569 if (dead || cheat_know || r_ptr->r_sights)
6571 /* Print a message */
6573 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
6574 (r_name + r_ptr->name));
6576 fprintf(fff, " %s is dead\n",
6577 (r_name + r_ptr->name));
6584 /* Free the "who" array */
6585 C_KILL(who, max_r_idx, s16b);
6587 /* Close the file */
6590 /* Display the file contents */
6592 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6594 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
6598 /* Remove the file */
6605 * Display weapon-exp
6607 static void do_cmd_knowledge_weapon_exp(void)
6609 int i,j, num, shougou;
6613 char file_name[1024];
6616 /* Open a new file */
6617 fff = my_fopen_temp(file_name, 1024);
6620 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6622 msg_format("Failed to create temporary file %s.", file_name);
6628 for(i = 0; i < 5; i++)
6630 for (num = 0; num < 64; num++)
6632 for (j = 0; j < max_k_idx; j++)
6634 object_kind *k_ptr = &k_info[j];
6636 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6638 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6640 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6641 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6642 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6643 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6646 fprintf(fff,"%-25s ",tmp);
6647 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6648 else fprintf(fff," ");
6649 fprintf(fff,"%s",shougou_moji[shougou]);
6650 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6658 /* Close the file */
6661 /* Display the file contents */
6663 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6665 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6669 /* Remove the file */
6677 static void do_cmd_knowledge_spell_exp(void)
6684 char file_name[1024];
6686 /* Open a new file */
6687 fff = my_fopen_temp(file_name, 1024);
6690 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6692 msg_format("Failed to create temporary file %s.", file_name);
6698 if(p_ptr->realm1 != REALM_NONE)
6701 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6703 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6705 for (i = 0; i < 32; i++)
6707 if (!is_magic(p_ptr->realm1))
6709 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6713 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6715 if(s_ptr->slevel == 99) continue;
6716 if(p_ptr->spell_exp[i]<900) shougou=0;
6717 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6718 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6719 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6721 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6722 if (p_ptr->realm1 == REALM_HISSATSU)
6723 fprintf(fff,"[--]");
6726 if (shougou == 4) fprintf(fff,"!");
6727 else fprintf(fff," ");
6728 fprintf(fff,"%s",shougou_moji[shougou]);
6730 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6735 if(p_ptr->realm2 != REALM_NONE)
6737 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6738 for (i = 0; i < 32; i++)
6740 if (!is_magic(p_ptr->realm1))
6742 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6746 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6748 if(s_ptr->slevel == 99) continue;
6750 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6751 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6752 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6754 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6755 if (shougou == 3) fprintf(fff,"!");
6756 else fprintf(fff," ");
6757 fprintf(fff,"%s",shougou_moji[shougou]);
6758 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6763 /* Close the file */
6766 /* Display the file contents */
6768 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6770 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6774 /* Remove the file */
6782 static void do_cmd_knowledge_skill_exp(void)
6788 char file_name[1024];
6790 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6792 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6795 /* Open a new file */
6796 fff = my_fopen_temp(file_name, 1024);
6799 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6801 msg_format("Failed to create temporary file %s.", file_name);
6807 for (i = 0; i < 3; i++)
6809 if(i == GINOU_RIDING)
6811 if(p_ptr->skill_exp[i]<500) shougou=0;
6812 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6813 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6814 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6819 if(p_ptr->skill_exp[i]<4000) shougou=0;
6820 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6821 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6822 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6825 fprintf(fff,"%-20s ",skill_name[i]);
6826 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6827 else fprintf(fff," ");
6828 fprintf(fff,"%s",shougou_moji[shougou]);
6829 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6833 /* Close the file */
6836 /* Display the file contents */
6838 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6840 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6844 /* Remove the file */
6850 * Pluralize a monster name
6852 void plural_aux(char *Name)
6854 int NameLen = strlen(Name);
6856 if (strstr(Name, "Disembodied hand"))
6858 strcpy(Name, "Disembodied hands that strangled people");
6860 else if (strstr(Name, "Colour out of space"))
6862 strcpy(Name, "Colours out of space");
6864 else if (strstr(Name, "stairway to hell"))
6866 strcpy(Name, "stairways to hell");
6868 else if (strstr(Name, "Dweller on the threshold"))
6870 strcpy(Name, "Dwellers on the threshold");
6872 else if (strstr(Name, " of "))
6874 cptr aider = strstr(Name, " of ");
6885 if (dummy[i-1] == 's')
6887 strcpy(&(dummy[i]), "es");
6892 strcpy(&(dummy[i]), "s");
6895 strcpy(&(dummy[i+1]), aider);
6896 strcpy(Name, dummy);
6898 else if (strstr(Name, "coins"))
6901 strcpy(dummy, "piles of ");
6902 strcat(dummy, Name);
6903 strcpy(Name, dummy);
6906 else if (strstr(Name, "Manes"))
6910 else if (streq(&(Name[NameLen - 2]), "ey"))
6912 strcpy(&(Name[NameLen - 2]), "eys");
6914 else if (Name[NameLen - 1] == 'y')
6916 strcpy(&(Name[NameLen - 1]), "ies");
6918 else if (streq(&(Name[NameLen - 4]), "ouse"))
6920 strcpy(&(Name[NameLen - 4]), "ice");
6922 else if (streq(&(Name[NameLen - 2]), "us"))
6924 strcpy(&(Name[NameLen - 2]), "i");
6926 else if (streq(&(Name[NameLen - 6]), "kelman"))
6928 strcpy(&(Name[NameLen - 6]), "kelmen");
6930 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6932 strcpy(&(Name[NameLen - 8]), "wordsmen");
6934 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6936 strcpy(&(Name[NameLen - 7]), "oodsmen");
6938 else if (streq(&(Name[NameLen - 7]), "eastman"))
6940 strcpy(&(Name[NameLen - 7]), "eastmen");
6942 else if (streq(&(Name[NameLen - 8]), "izardman"))
6944 strcpy(&(Name[NameLen - 8]), "izardmen");
6946 else if (streq(&(Name[NameLen - 5]), "geist"))
6948 strcpy(&(Name[NameLen - 5]), "geister");
6950 else if (streq(&(Name[NameLen - 2]), "ex"))
6952 strcpy(&(Name[NameLen - 2]), "ices");
6954 else if (streq(&(Name[NameLen - 2]), "lf"))
6956 strcpy(&(Name[NameLen - 2]), "lves");
6958 else if (suffix(Name, "ch") ||
6959 suffix(Name, "sh") ||
6960 suffix(Name, "nx") ||
6961 suffix(Name, "s") ||
6964 strcpy(&(Name[NameLen]), "es");
6968 strcpy(&(Name[NameLen]), "s");
6973 * Display current pets
6975 static void do_cmd_knowledge_pets(void)
6979 monster_type *m_ptr;
6981 int show_upkeep = 0;
6982 char file_name[1024];
6985 /* Open a new file */
6986 fff = my_fopen_temp(file_name, 1024);
6989 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6991 msg_format("Failed to create temporary file %s.", file_name);
6997 /* Process the monsters (backwards) */
6998 for (i = m_max - 1; i >= 1; i--)
7000 monster_race *r_ptr;
7001 /* Access the monster */
7004 /* Ignore "dead" monsters */
7005 if (!m_ptr->r_idx) continue;
7006 r_ptr = &r_info[m_ptr->r_idx];
7008 /* Calculate "upkeep" for pets */
7013 monster_desc(pet_name, m_ptr, 0x88);
7014 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i, 0x00));
7015 if (p_ptr->riding == i)
7017 fprintf(fff, " ¾èÇÏÃæ");
7019 fprintf(fff, " Riding");
7025 show_upkeep = calculate_upkeep();
7027 fprintf(fff, "----------------------------------------------\n");
7029 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
7030 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
7032 fprintf(fff, " Total: %d pet%s.\n",
7033 t_friends, (t_friends == 1 ? "" : "s"));
7034 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
7039 /* Close the file */
7042 /* Display the file contents */
7044 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
7046 show_file(TRUE, file_name, "Current Pets", 0, 0);
7050 /* Remove the file */
7058 * Note that the player ghosts are ignored. XXX XXX XXX
7060 static void do_cmd_knowledge_kill_count(void)
7068 char file_name[1024];
7073 /* Open a new file */
7074 fff = my_fopen_temp(file_name, 1024);
7078 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7080 msg_format("Failed to create temporary file %s.", file_name);
7086 /* Allocate the "who" array */
7087 C_MAKE(who, max_r_idx, s16b);
7090 /* Monsters slain */
7093 for (kk = 1; kk < max_r_idx; kk++)
7095 monster_race *r_ptr = &r_info[kk];
7097 if (r_ptr->flags1 & (RF1_UNIQUE))
7099 bool dead = (r_ptr->max_num == 0);
7108 s16b This = r_ptr->r_pkills;
7119 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
7121 fprintf(fff,"You have defeated no enemies yet.\n\n");
7124 else if (Total == 1)
7126 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
7128 fprintf(fff,"You have defeated one enemy.\n\n");
7133 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
7135 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
7142 /* Scan the monsters */
7143 for (i = 1; i < max_r_idx; i++)
7145 monster_race *r_ptr = &r_info[i];
7147 /* Use that monster */
7148 if (r_ptr->name) who[n++] = i;
7151 /* Select the sort method */
7152 ang_sort_comp = ang_sort_comp_hook;
7153 ang_sort_swap = ang_sort_swap_hook;
7155 /* Sort the array by dungeon depth of monsters */
7156 ang_sort(who, &why, n);
7158 /* Scan the monster races */
7159 for (k = 0; k < n; k++)
7161 monster_race *r_ptr = &r_info[who[k]];
7163 if (r_ptr->flags1 & (RF1_UNIQUE))
7165 bool dead = (r_ptr->max_num == 0);
7169 /* Print a message */
7170 fprintf(fff, " %s\n",
7171 (r_name + r_ptr->name));
7177 s16b This = r_ptr->r_pkills;
7182 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
7183 if(strchr("pt",r_ptr->d_char))
7184 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
7186 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
7190 if (strstr(r_name + r_ptr->name, "coins"))
7192 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
7196 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
7202 strcpy(ToPlural, (r_name + r_ptr->name));
7203 plural_aux(ToPlural);
7204 fprintf(fff, " %d %s\n", This, ToPlural);
7214 fprintf(fff,"----------------------------------------------\n");
7216 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
7218 fprintf(fff," Total: %lu creature%s killed.\n",
7219 Total, (Total == 1 ? "" : "s"));
7223 /* Free the "who" array */
7224 C_KILL(who, max_r_idx, s16b);
7226 /* Close the file */
7229 /* Display the file contents */
7231 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
7233 show_file(TRUE, file_name, "Kill Count", 0, 0);
7237 /* Remove the file */
7244 * Display the object groups.
7246 static void display_group_list(int col, int row, int wid, int per_page,
7247 int grp_idx[], cptr group_text[], int grp_cur, int grp_top)
7251 /* Display lines until done */
7252 for (i = 0; i < per_page && (grp_idx[i] >= 0); i++)
7254 /* Get the group index */
7255 int grp = grp_idx[grp_top + i];
7257 /* Choose a color */
7258 byte attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
7260 /* Erase the entire line */
7261 Term_erase(col, row + i, wid);
7263 /* Display the group label */
7264 c_put_str(attr, group_text[grp], row + i, col);
7271 * Move the cursor in a browser window
7273 static void browser_cursor(char ch, int *column, int *grp_cur, int grp_cnt,
7274 int *list_cur, int list_cnt)
7279 int list = *list_cur;
7281 /* Extract direction */
7282 d = get_keymap_dir(ch);
7286 /* Diagonals - hack */
7287 if ((ddx[d] > 0) && ddy[d])
7289 /* Browse group list */
7294 /* Move up or down */
7295 grp += ddy[d] * BROWSER_ROWS;
7298 if (grp >= grp_cnt) grp = grp_cnt - 1;
7299 if (grp < 0) grp = 0;
7300 if (grp != old_grp) list = 0;
7303 /* Browse sub-list list */
7306 /* Move up or down */
7307 list += ddy[d] * BROWSER_ROWS;
7310 if (list >= list_cnt) list = list_cnt - 1;
7311 if (list < 0) list = 0;
7323 if (col < 0) col = 0;
7324 if (col > 1) col = 1;
7331 /* Browse group list */
7336 /* Move up or down */
7340 if (grp >= grp_cnt) grp = grp_cnt - 1;
7341 if (grp < 0) grp = 0;
7342 if (grp != old_grp) list = 0;
7345 /* Browse sub-list list */
7348 /* Move up or down */
7352 if (list >= list_cnt) list = list_cnt - 1;
7353 if (list < 0) list = 0;
7363 * Display the monsters in a group.
7365 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
7366 int mon_cur, int mon_top)
7370 /* Display lines until done */
7371 for (i = 0; i < per_page && mon_idx[i]; i++)
7375 /* Get the race index */
7376 int r_idx = mon_idx[mon_top + i] ;
7378 /* Access the race */
7379 monster_race *r_ptr = &r_info[r_idx];
7381 /* Is this a unique? */
7382 bool unique = (bool)(r_ptr->flags1 & (RF1_UNIQUE)) ;
7384 /* Choose a color */
7385 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
7387 /* Display the name */
7388 c_prt(attr, (r_name + r_ptr->name), row + i, col);
7392 c_prt(attr, format ("%d", r_idx), row + i, 60);
7395 /* Display symbol */
7396 Term_putch(70, row + i, r_ptr->x_attr, r_ptr->x_char);
7399 if (!unique) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
7401 else put_str(format("%s", (r_ptr->max_num == 0) ? "»àË´" : "À¸Â¸"), row + i, 73);
7403 else put_str(format("%s", (r_ptr->max_num == 0) ? "dead" : "alive"), row + i, 73);
7408 /* Clear remaining lines */
7409 for (; i < per_page; i++)
7411 Term_erase(col, row + i, 255);
7416 * Display known monsters.
7418 static void do_cmd_knowledge_monsters(void)
7421 int grp_cur, grp_top;
7422 int mon_cur, mon_top;
7423 int grp_cnt, grp_idx[100];
7431 /* Allocate the "mon_idx" array */
7432 C_MAKE(mon_idx, max_r_idx, s16b);
7437 /* Check every group */
7438 for (i = 0; monster_group_text[i] != NULL; i++)
7440 /* Measure the label */
7441 len = strlen(monster_group_text[i]);
7443 /* Save the maximum length */
7444 if (len > max) max = len;
7446 /* See if any monsters are known */
7447 if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, 0x01))
7449 /* Build a list of groups with known monsters */
7450 grp_idx[grp_cnt++] = i;
7454 /* Terminate the list */
7455 grp_idx[grp_cnt] = -1;
7457 grp_cur = grp_top = 0;
7458 mon_cur = mon_top = 0;
7472 prt("Ãμ± - ¥â¥ó¥¹¥¿¡¼", 2, 0);
7473 prt("¥°¥ë¡¼¥×", 4, 0);
7474 prt("̾Á°", 4, max + 3);
7475 if (p_ptr->wizard) prt("Idx", 4, 60);
7476 prt("ʸ»ú »¦³²¿ô", 4, 67);
7478 prt("Knowledge - Monsters", 2, 0);
7480 prt("Name", 4, max + 3);
7481 if (p_ptr->wizard) prt("Idx", 4, 60);
7482 prt("Sym Kills", 4, 67);
7485 for (i = 0; i < 78; i++)
7487 Term_putch(i, 5, TERM_WHITE, '=');
7490 for (i = 0; i < BROWSER_ROWS; i++)
7492 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7498 /* Scroll group list */
7499 if (grp_cur < grp_top) grp_top = grp_cur;
7500 if (grp_cur >= grp_top + BROWSER_ROWS) grp_top = grp_cur - BROWSER_ROWS + 1;
7502 /* Display a list of monster groups */
7503 display_group_list(0, 6, max, BROWSER_ROWS, grp_idx, monster_group_text, grp_cur, grp_top);
7505 /* Get a list of monsters in the current group */
7506 mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, 0x00);
7508 /* Scroll monster list */
7509 while (mon_cur < mon_top)
7510 mon_top = MAX(0, mon_top - BROWSER_ROWS/2);
7511 while (mon_cur >= mon_top + BROWSER_ROWS)
7512 mon_top = MIN(mon_cnt - BROWSER_ROWS, mon_top + BROWSER_ROWS/2);
7514 /* Display a list of monsters in the current group */
7515 display_monster_list(max + 3, 6, BROWSER_ROWS, mon_idx, mon_cur, mon_top);
7519 prt("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë, ESC", 23, 0);
7521 prt("<dir>, 'r' to recall, ESC", 23, 0);
7524 /* Mega Hack -- track this monster race */
7525 if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
7527 /* Hack -- handle stuff */
7532 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7536 Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
7552 /* Recall on screen */
7553 if (mon_idx[mon_cur])
7555 screen_roff(mon_idx[mon_cur], 0);
7566 /* Move the cursor */
7567 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
7574 /* XXX XXX Free the "mon_idx" array */
7575 C_KILL(mon_idx, max_r_idx, s16b);
7581 * Display the objects in a group.
7583 static void display_object_list(int col, int row, int per_page, int object_idx[],
7584 int object_cur, int object_top)
7588 /* Display lines until done */
7589 for (i = 0; i < per_page && object_idx[i]; i++)
7591 /* Get the object index */
7592 int k_idx = object_idx[object_top + i];
7594 /* Access the object */
7595 object_kind *k_ptr = &k_info[k_idx];
7597 /* Choose a color */
7598 byte attr = ((k_ptr->aware) ? TERM_WHITE : TERM_SLATE);
7599 byte cursor = ((k_ptr->aware) ? TERM_L_BLUE : TERM_BLUE);
7600 attr = ((i + object_top == object_cur) ? cursor : attr);
7602 /* Display the name */
7603 c_prt(attr, k_name + k_ptr->name, row + i, col);
7605 if (p_ptr->wizard) c_prt(attr, format ("%d", k_idx), row + i, 70);
7609 byte a = misc_to_attr[k_ptr->flavor];
7610 byte c = misc_to_char[k_ptr->flavor];
7612 /* Display symbol */
7613 Term_putch(76, row + i, a, c);
7617 /* Clear remaining lines */
7618 for (; i < per_page; i++)
7620 Term_erase(col, row + i, 255);
7625 * Describe fake object
7627 static void desc_obj_fake(int k_idx)
7630 object_type object_type_body;
7632 /* Get local object */
7633 o_ptr = &object_type_body;
7635 /* Wipe the object */
7638 /* Create the artifact */
7639 object_prep(o_ptr, k_idx);
7641 /* It's fully know */
7642 o_ptr->ident |= IDENT_KNOWN;
7644 /* Track the object */
7645 /* object_actual_track(o_ptr); */
7647 /* Hack - mark as fake */
7648 /* term_obj_real = FALSE; */
7650 /* Hack -- Handle stuff */
7653 /* screen_object(o_ptr, FALSE); */
7654 if (!identify_fully_aux(o_ptr)) msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£");
7660 * Display known objects
7662 static void do_cmd_knowledge_objects(void)
7665 int grp_cur, grp_top;
7666 int object_old, object_cur, object_top;
7667 int grp_cnt, grp_idx[100];
7675 /* Allocate the "object_idx" array */
7676 C_MAKE(object_idx, max_k_idx, int);
7681 /* Check every group */
7682 for (i = 0; object_group_text[i] != NULL; i++)
7684 /* Measure the label */
7685 len = strlen(object_group_text[i]);
7687 /* Save the maximum length */
7688 if (len > max) max = len;
7690 /* See if any monsters are known */
7691 if (collect_objects(i, object_idx))
7693 /* Build a list of groups with known monsters */
7694 grp_idx[grp_cnt++] = i;
7698 /* Terminate the list */
7699 grp_idx[grp_cnt] = -1;
7701 grp_cur = grp_top = 0;
7702 object_cur = object_top = 0;
7717 prt("Ãμ± - ¥¢¥¤¥Æ¥à", 2, 0);
7718 prt("¥°¥ë¡¼¥×", 4, 0);
7719 prt("̾Á°", 4, max + 3);
7720 if (p_ptr->wizard) prt("Idx", 4, 70);
7723 prt("Knowledge - objects", 2, 0);
7725 prt("Name", 4, max + 3);
7726 if (p_ptr->wizard) prt("Idx", 4, 70);
7730 for (i = 0; i < 78; i++)
7732 Term_putch(i, 5, TERM_WHITE, '=');
7735 for (i = 0; i < BROWSER_ROWS; i++)
7737 Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
7743 /* Scroll group list */
7744 if (grp_cur < grp_top) grp_top = grp_cur;
7745 if (grp_cur >= grp_top + BROWSER_ROWS) grp_top = grp_cur - BROWSER_ROWS + 1;
7747 /* Display a list of object groups */
7748 display_group_list(0, 6, max, BROWSER_ROWS, grp_idx, object_group_text, grp_cur, grp_top);
7750 /* Get a list of objects in the current group */
7751 object_cnt = collect_objects(grp_idx[grp_cur], object_idx);
7753 /* Scroll monster list */
7754 while (object_cur < object_top)
7755 object_top = MAX(0, object_top - BROWSER_ROWS/2);
7756 while (object_cur >= object_top + BROWSER_ROWS)
7757 object_top = MIN(object_cnt - BROWSER_ROWS, object_top + BROWSER_ROWS/2);
7759 /* Display a list of objects in the current group */
7760 display_object_list(max + 3, 6, BROWSER_ROWS, object_idx, object_cur, object_top);
7764 prt("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë, ESC", 23, 0);
7766 prt("<dir>, 'r' to recall, ESC", 23, 0);
7769 /* Mega Hack -- track this monster race */
7770 if (object_cnt) object_kind_track(object_idx[object_cur]);
7772 /* The "current" object changed */
7773 if (object_old != object_idx[object_cur])
7775 /* Hack -- handle stuff */
7778 /* Remember the "current" object */
7779 object_old = object_idx[object_cur];
7784 Term_gotoxy(0, 6 + (grp_cur - grp_top));
7788 Term_gotoxy(max + 3, 6 + (object_cur - object_top));
7804 /* Recall on screen */
7806 desc_obj_fake(object_idx[object_cur]);
7814 /* Move the cursor */
7815 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
7821 /* XXX XXX Free the "object_idx" array */
7822 C_KILL(object_idx, max_k_idx, int);
7828 * List virtues & status
7831 static void do_cmd_knowledge_kubi(void)
7836 char file_name[1024];
7839 /* Open a new file */
7840 fff = my_fopen_temp(file_name, 1024);
7843 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7845 msg_format("Failed to create temporary file %s.", file_name);
7854 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
7856 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
7858 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
7860 fprintf(fff, "List of wanted monsters\n");
7862 for (i = 0; i < MAX_KUBI; i++)
7864 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
7865 if (kubi_r_idx[i] > 10000)
7867 fprintf(fff, "ºÑ\n");
7869 fprintf(fff, "done\n");
7872 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
7876 /* Close the file */
7879 /* Display the file contents */
7881 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
7883 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
7887 /* Remove the file */
7892 * List virtues & status
7895 static void do_cmd_knowledge_virtues(void)
7899 char file_name[1024];
7902 /* Open a new file */
7903 fff = my_fopen_temp(file_name, 1024);
7906 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7908 msg_format("Failed to create temporary file %s.", file_name);
7917 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
7919 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
7924 /* Close the file */
7927 /* Display the file contents */
7929 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
7931 show_file(TRUE, file_name, "Virtues", 0, 0);
7935 /* Remove the file */
7943 static void do_cmd_knowledge_dungeon(void)
7947 char file_name[1024];
7951 /* Open a new file */
7952 fff = my_fopen_temp(file_name, 1024);
7955 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7957 msg_format("Failed to create temporary file %s.", file_name);
7965 for (i = 1; i < max_d_idx; i++)
7969 if (!d_info[i].maxdepth) continue;
7970 if (!max_dlv[i]) continue;
7971 if (d_info[i].final_guardian)
7973 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
7975 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
7977 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
7979 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
7984 /* Close the file */
7987 /* Display the file contents */
7989 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
7991 show_file(TRUE, file_name, "Dungeon", 0, 0);
7995 /* Remove the file */
8000 * List virtues & status
8003 static void do_cmd_knowledge_stat(void)
8007 char file_name[1024];
8010 /* Open a new file */
8011 fff = my_fopen_temp(file_name, 1024);
8014 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8016 msg_format("Failed to create temporary file %s.", file_name);
8024 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
8025 (2 * p_ptr->hitdie +
8026 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
8029 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
8030 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
8031 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
8033 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
8034 else fprintf(fff, "Your current Life Rating is ???.\n\n");
8035 fprintf(fff, "Limits of maximum stats\n\n");
8037 for (v_nr = 0; v_nr < 6; v_nr++)
8039 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);
8040 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
8046 /* Close the file */
8049 /* Display the file contents */
8051 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
8053 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
8057 /* Remove the file */
8062 * Print quest status of all active quests
8064 static void do_cmd_knowledge_quests(void)
8067 char file_name[1024];
8069 char rand_tmp_str[120] = "\0";
8071 monster_race *r_ptr;
8073 int rand_level = 100;
8076 /* Open a new file */
8077 fff = my_fopen_temp(file_name, 1024);
8080 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8082 msg_format("Failed to create temporary file %s.", file_name);
8089 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
8091 fprintf(fff, "< Current Quest >\n");
8094 for (i = 1; i < max_quests; i++)
8096 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
8101 /* Clear the text */
8102 for (j = 0; j < 10; j++)
8104 quest_text[j][0] = '\0';
8107 quest_text_line = 0;
8109 /* Set the quest number temporary */
8110 old_quest = p_ptr->inside_quest;
8111 p_ptr->inside_quest = i;
8113 /* Get the quest text */
8114 init_flags = INIT_SHOW_TEXT;
8116 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8118 /* Reset the old quest number */
8119 p_ptr->inside_quest = old_quest;
8121 /* No info from "silent" quests */
8122 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8126 if (quest[i].type != QUEST_TYPE_RANDOM)
8128 char note[80] = "\0";
8130 if (quest[i].status == QUEST_STATUS_TAKEN)
8132 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
8134 r_ptr = &r_info[quest[i].r_idx];
8135 strcpy(name, r_name + r_ptr->name);
8136 if (quest[i].max_num > 1)
8139 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8142 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
8147 sprintf(note," - %s¤òÅݤ¹¡£",name);
8149 sprintf(note," - kill %s.",name);
8152 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
8155 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
8157 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
8160 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
8162 strcpy(name, a_name + a_info[quest[i].k_idx].name);
8164 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
8166 sprintf(note," - Find out %s.", name);
8169 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
8171 sprintf(note," - õº÷¤¹¤ë¡£");
8173 sprintf(note," - Search.");
8175 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
8177 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
8179 sprintf(note," - Kill all monsters.");
8183 /* Print the quest info */
8185 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
8187 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
8190 quest[i].name, quest[i].level, note);
8192 fprintf(fff, tmp_str);
8194 if (quest[i].status == QUEST_STATUS_COMPLETED)
8197 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
8199 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
8203 fprintf(fff, tmp_str);
8209 while (quest_text[j][0] && j < 10)
8211 fprintf(fff, " %s\n", quest_text[j]);
8216 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
8217 (quest[i].level < rand_level))
8220 rand_level = quest[i].level;
8222 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
8224 /* Print the quest info */
8225 r_ptr = &r_info[quest[i].r_idx];
8226 strcpy(name, r_name + r_ptr->name);
8228 if (quest[i].max_num > 1)
8231 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
8232 quest[i].name, quest[i].level,
8233 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
8237 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
8238 quest[i].name, quest[i].level,
8239 quest[i].max_num, name, quest[i].cur_num);
8246 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
8248 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
8251 quest[i].name, quest[i].level, name);
8258 /* Print the current random quest */
8259 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
8262 if (!total) fprintf(fff, "¤Ê¤·\n");
8264 if (!total) fprintf(fff, "Nothing.\n");
8268 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8270 fprintf(fff, "\n< Completed Quest >\n");
8273 for (i = 1; i < max_quests; i++)
8275 if (quest[i].status == QUEST_STATUS_FINISHED)
8277 if (i < MIN_RANDOM_QUEST)
8281 /* Set the quest number temporary */
8282 old_quest = p_ptr->inside_quest;
8283 p_ptr->inside_quest = i;
8286 init_flags = INIT_ASSIGN;
8288 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8290 /* Reset the old quest number */
8291 p_ptr->inside_quest = old_quest;
8293 /* No info from "silent" quests */
8294 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8299 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8301 /* Print the quest info */
8303 if (quest[i].complev == 0)
8307 "%s (%d³¬) - ÉÔÀᄀ\n",
8309 "%s (Dungeon level: %d) - (Cancelled)\n",
8311 r_name+r_info[quest[i].r_idx].name,
8318 "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8320 "%s (Dungeon level: %d) - level %d\n",
8322 r_name+r_info[quest[i].r_idx].name,
8329 /* Print the quest info */
8331 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8333 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8336 quest[i].name, quest[i].level, quest[i].complev);
8339 fprintf(fff, tmp_str);
8343 if (!total) fprintf(fff, "¤Ê¤·\n");
8345 if (!total) fprintf(fff, "Nothing.\n");
8349 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
8351 fprintf(fff, "\n< Failed Quest >\n");
8354 for (i = 1; i < max_quests; i++)
8356 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
8358 if (i < MIN_RANDOM_QUEST)
8362 /* Set the quest number temporary */
8363 old_quest = p_ptr->inside_quest;
8364 p_ptr->inside_quest = i;
8366 /* Get the quest text */
8367 init_flags = INIT_ASSIGN;
8369 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
8371 /* Reset the old quest number */
8372 p_ptr->inside_quest = old_quest;
8374 /* No info from "silent" quests */
8375 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8380 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
8382 /* Print the quest info */
8384 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
8386 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
8389 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
8393 /* Print the quest info */
8395 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
8397 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
8400 quest[i].name, quest[i].level, quest[i].complev);
8402 fprintf(fff, tmp_str);
8406 if (!total) fprintf(fff, "¤Ê¤·\n");
8408 if (!total) fprintf(fff, "Nothing.\n");
8411 if (p_ptr->wizard) {
8413 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
8415 fprintf(fff, "\n< Remaining Random Quest >\n");
8418 for (i = 1; i < max_quests; i++)
8420 /* No info from "silent" quests */
8421 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
8423 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
8427 /* Print the quest info */
8429 sprintf(tmp_str, "%s (%d³¬, %s)\n",
8431 sprintf(tmp_str, "%s (%d, %s)\n",
8434 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
8435 fprintf(fff, tmp_str);
8439 if (!total) fprintf(fff, "¤Ê¤·\n");
8441 if (!total) fprintf(fff, "Nothing.\n");
8445 /* Close the file */
8448 /* Display the file contents */
8450 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
8452 show_file(TRUE, file_name, "Quest status", 0, 0);
8456 /* Remove the file */
8466 static void do_cmd_knowledge_home(void)
8471 char file_name[1024];
8473 char o_name[MAX_NLEN];
8476 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
8478 /* Open a new file */
8479 fff = my_fopen_temp(file_name, 1024);
8482 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8484 msg_format("Failed to create temporary file %s.", file_name);
8492 /* Print all homes in the different towns */
8493 st_ptr = &town[1].store[STORE_HOME];
8495 /* Home -- if anything there */
8496 if (st_ptr->stock_num)
8498 /* Header with name of the town */
8500 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
8502 fprintf(fff, " [Home Inventory]\n");
8506 /* Dump all available items */
8507 for (i = 0; i < st_ptr->stock_num; i++)
8510 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
8511 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
8512 if (strlen(o_name) <= 80-3)
8514 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8520 for (n = 0, t = o_name; n < 80-3; n++, t++)
8521 if(iskanji(*t)) {t++; n++;}
8522 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
8524 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
8525 fprintf(fff, " %.77s\n", o_name+n);
8528 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
8529 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
8534 /* Add an empty line */
8535 fprintf(fff, "\n\n");
8539 /* Close the file */
8542 /* Display the file contents */
8544 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
8546 show_file(TRUE, file_name, "Home Inventory", 0, 0);
8550 /* Remove the file */
8556 * Check the status of "autopick"
8558 static void do_cmd_knowledge_autopick(void)
8562 char file_name[1024];
8564 /* Open a new file */
8565 fff = my_fopen_temp(file_name, 1024);
8570 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
8572 msg_format("Failed to create temporary file %s.", file_name);
8581 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
8583 fprintf(fff, "No preference for auto picker/destroyer.");
8589 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
8591 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
8595 for (k = 0; k < max_autopick; k++)
8598 byte act = autopick_list[k].action;
8599 if (act & DONT_AUTOPICK)
8607 else if (act & DO_AUTODESTROY)
8615 else if (act & DO_AUTOPICK)
8623 else /* if (act & DO_QUERY_AUTOPICK) */ /* Obvious */
8632 if (act & DO_DISPLAY)
8633 fprintf(fff, "%11s", format("[%s]", tmp));
8635 fprintf(fff, "%11s", format("(%s)", tmp));
8637 tmp = autopick_line_from_entry(&autopick_list[k]);
8638 fprintf(fff, " %s", tmp);
8642 /* Close the file */
8644 /* Display the file contents */
8646 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
8648 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
8651 /* Remove the file */
8657 * Interact with "knowledge"
8659 void do_cmd_knowledge(void)
8662 /* File type is "TEXT" */
8663 FILE_TYPE(FILE_TYPE_TEXT);
8664 /* Save the screen */
8666 /* Interact until done */
8671 /* Ask for a choice */
8673 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
8674 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
8676 prt(format("page %d/2", (p+1)), 2, 65);
8677 prt("Display current knowledge", 3, 0);
8680 /* Give some choices */
8683 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
8684 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
8685 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
8686 prt("(4) ´ûÃΤΥâ¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
8687 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
8688 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
8689 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
8690 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
8691 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
8693 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
8694 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
8695 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
8696 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
8697 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
8698 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
8699 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
8700 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
8701 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
8705 prt("(1) Display known artifacts", 6, 5);
8706 prt("(2) Display known objects", 7, 5);
8707 prt("(3) Display remaining uniques", 8, 5);
8708 prt("(4) Display known monster", 9, 5);
8709 prt("(5) Display kill count", 10, 5);
8710 prt("(6) Display wanted monsters", 11, 5);
8711 prt("(7) Display current pets", 12, 5);
8712 prt("(8) Display home inventory", 13, 5);
8713 prt("(9) Display *identified* equip.", 14, 5);
8715 prt("(a) Display about yourself", 6, 5);
8716 prt("(b) Display mutations", 7, 5);
8717 prt("(c) Display weapon proficiency", 8, 5);
8718 prt("(d) Display spell proficiency", 9, 5);
8719 prt("(e) Display misc. proficiency", 10, 5);
8720 prt("(f) Display virtues", 11, 5);
8721 prt("(g) Display dungeons", 12, 5);
8722 prt("(h) Display current quests", 13, 5);
8723 prt("(i) Display auto pick/destroy", 14, 5);
8728 prt("-³¤¯-", 16, 8);
8729 prt("ESC) È´¤±¤ë", 21, 1);
8730 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
8731 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
8732 prt("¥³¥Þ¥ó¥É:", 20, 0);
8734 prt("-more-", 16, 8);
8735 prt("ESC) Exit menu", 21, 1);
8736 prt("SPACE) Next page", 21, 30);
8737 /*prt("-) Previous page", 21, 60);*/
8738 prt("Command: ", 20, 0);
8744 if (i == ESCAPE) break;
8747 case ' ': /* Page change */
8751 case '1': /* Artifacts */
8752 do_cmd_knowledge_artifacts();
8754 case '2': /* Objects */
8755 do_cmd_knowledge_objects();
8757 case '3': /* Uniques */
8758 do_cmd_knowledge_uniques();
8760 case '4': /* Monsters */
8761 do_cmd_knowledge_monsters();
8763 case '5': /* Kill count */
8764 do_cmd_knowledge_kill_count();
8766 case '6': /* wanted */
8767 do_cmd_knowledge_kubi();
8769 case '7': /* Pets */
8770 do_cmd_knowledge_pets();
8772 case '8': /* Home */
8773 do_cmd_knowledge_home();
8775 case '9': /* Resist list */
8776 do_cmd_knowledge_inven();
8779 case 'a': /* Max stat */
8780 do_cmd_knowledge_stat();
8782 case 'b': /* Mutations */
8783 do_cmd_knowledge_mutations();
8785 case 'c': /* weapon-exp */
8786 do_cmd_knowledge_weapon_exp();
8788 case 'd': /* spell-exp */
8789 do_cmd_knowledge_spell_exp();
8791 case 'e': /* skill-exp */
8792 do_cmd_knowledge_skill_exp();
8794 case 'f': /* Virtues */
8795 do_cmd_knowledge_virtues();
8797 case 'g': /* Dungeon */
8798 do_cmd_knowledge_dungeon();
8800 case 'h': /* Quests */
8801 do_cmd_knowledge_quests();
8803 case 'i': /* Autopick */
8804 do_cmd_knowledge_autopick();
8806 default: /* Unknown option */
8809 /* Flush messages */
8812 /* Restore the screen */
8818 * Check on the status of an active quest
8820 void do_cmd_checkquest(void)
8822 /* File type is "TEXT" */
8823 FILE_TYPE(FILE_TYPE_TEXT);
8825 /* Save the screen */
8829 do_cmd_knowledge_quests();
8831 /* Restore the screen */
8837 * Display the time and date
8839 void do_cmd_time(void)
8841 int day, hour, min, full, start, end, num;
8848 extract_day_hour_min(&day, &hour, &min);
8850 full = hour * 100 + min;
8858 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
8860 strcpy(desc, "It is a strange time.");
8866 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
8868 msg_format("This is day %d. The time is %d:%02d %s.",
8871 day, (hour % 12 == 0) ? 12 : (hour % 12),
8872 min, (hour < 12) ? "AM" : "PM");
8875 if (!randint0(10) || p_ptr->image)
8878 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
8880 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
8887 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
8889 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
8894 /* Open this file */
8895 fff = my_fopen(buf, "rt");
8900 /* Find this time */
8901 while (!my_fgets(fff, buf, sizeof(buf)))
8903 /* Ignore comments */
8904 if (!buf[0] || (buf[0] == '#')) continue;
8906 /* Ignore invalid lines */
8907 if (buf[1] != ':') continue;
8909 /* Process 'Start' */
8912 /* Extract the starting time */
8913 start = atoi(buf + 2);
8915 /* Assume valid for an hour */
8925 /* Extract the ending time */
8926 end = atoi(buf + 2);
8932 /* Ignore incorrect range */
8933 if ((start > full) || (full > end)) continue;
8935 /* Process 'Description' */
8940 /* Apply the randomizer */
8941 if (!randint0(num)) strcpy(desc, buf + 2);
8951 /* Close the file */