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, 1024))
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 fd_copy(tmp_file, orig_file);
128 * Open file to append auto dump.
130 static FILE *open_auto_dump(cptr buf, cptr mark, int *line)
134 char header_mark_str[80];
136 sprintf(header_mark_str, auto_dump_header, mark);
138 /* Remove old macro dumps */
139 remove_auto_dump(buf, mark);
141 /* Append to the file */
142 fff = my_fopen(buf, "a");
147 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
149 msg_format("Failed to open %s.", buf);
156 fprintf(fff, "%s\n", header_mark_str);
159 fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
160 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
162 fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
163 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
171 * Append foot part and close auto dump.
173 static void close_auto_dump(FILE *fff, cptr mark, int line_num)
175 char footer_mark_str[80];
177 sprintf(footer_mark_str, auto_dump_footer, mark);
181 fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
182 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
184 fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
185 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
189 fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
198 * Take note to the dialy.
201 errr do_cmd_write_nikki(int type, int num, cptr note)
207 cptr note_level = "";
208 bool do_level = TRUE;
210 s32b len = 20L * TOWN_DAWN;
211 s32b tick = turn % len + len / 4;
213 static bool disable_nikki = FALSE;
215 if (disable_nikki) return(-1);
217 if ((p_ptr->prace == RACE_VAMPIRE) ||
218 (p_ptr->prace == RACE_SKELETON) ||
219 (p_ptr->prace == RACE_ZOMBIE) ||
220 (p_ptr->prace == RACE_SPECTRE))
221 day = (turn - (15L * TOWN_DAWN))/ len + 1;
223 day = (turn + (5L * TOWN_DAWN))/ len + 1;
225 hour = (24 * tick / len) % 24;
226 min = (1440 * tick / len) % 60;
228 if (type == NIKKI_FIX_QUEST_C ||
229 type == NIKKI_FIX_QUEST_F ||
230 type == NIKKI_RAND_QUEST_C ||
231 type == NIKKI_RAND_QUEST_F ||
232 type == NIKKI_TO_QUEST)
236 old_quest = p_ptr->inside_quest;
237 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
239 /* Get the quest text */
240 init_flags = INIT_ASSIGN;
242 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
244 /* Reset the old quest number */
245 p_ptr->inside_quest = old_quest;
249 sprintf(file_name,"playrecord-%s.txt",savefile_base);
251 /* different filne name to avoid mixing */
252 sprintf(file_name,"playrec-%s.txt",savefile_base);
255 /* Build the filename */
256 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
258 /* File type is "TEXT" */
259 FILE_TYPE(FILE_TYPE_TEXT);
261 fff = my_fopen(buf, "a");
266 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
268 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
277 if (p_ptr->inside_arena)
279 note_level = "¥¢¥ê¡¼¥Ê:";
281 note_level = "Arane:";
285 note_level = "ÃϾå:";
287 note_level = "Surface:";
289 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)))
291 note_level = "¥¯¥¨¥¹¥È:";
293 note_level = "Quest:";
297 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
299 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
308 fprintf(fff, "%dÆüÌÜ\n",day);
310 fprintf(fff, "Day %d\n",day);
319 fprintf(fff, "%s\n",note);
323 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
329 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
331 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
338 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
340 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
344 case NIKKI_FIX_QUEST_C:
346 if (quest[num].flags & QUEST_FLAG_SILENT) break;
348 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
350 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
354 case NIKKI_FIX_QUEST_F:
356 if (quest[num].flags & QUEST_FLAG_SILENT) break;
358 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
360 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
364 case NIKKI_RAND_QUEST_C:
367 strcpy(name, r_name+r_info[quest[num].r_idx].name);
369 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
371 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
375 case NIKKI_RAND_QUEST_F:
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 ran away from quest '%s'.\n", hour, min, note_level, name);
386 case NIKKI_MAXDEAPTH:
389 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
391 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);
398 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
400 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);
407 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
418 if (!(dun_level+num)) to = "ÃϾå";
419 else to = format("%d³¬", dun_level+num);
421 if (!(dun_level+num)) to = "the surfice";
422 else to = format("level %d", dun_level+num);
427 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
429 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
437 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
439 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);
443 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
445 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
451 if (quest[num].flags & QUEST_FLAG_SILENT) break;
453 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
455 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
470 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)))
481 if (!(dun_level+num)) to = "ÃϾå";
482 else to = format("%d³¬", dun_level+num);
484 if (!(dun_level+num)) to = "surface";
485 else to = format("level %d", dun_level+num);
490 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
492 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
499 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
501 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
508 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
510 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
517 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
519 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);
521 if (num == MAX_ARENA_MONS)
524 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
526 fprintf(fff, " win all fight to become a Chanpion.\n");
535 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
537 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
552 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
554 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
558 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
560 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
567 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
569 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
573 case NIKKI_GAMESTART:
575 time_t ct = time((time_t*)0);
579 fprintf(fff, "%s %s",note, ctime(&ct));
582 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
585 case NIKKI_NAMED_PET:
587 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
592 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
594 fprintf(fff, "decide to travel together with %s.\n", note);
599 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
601 fprintf(fff, "unname %s.\n", note);
606 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
608 fprintf(fff, "dismiss %s.\n", note);
613 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
615 fprintf(fff, "%s die.\n", note);
620 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
622 fprintf(fff, "move to other map leaving %s behind.\n", note);
627 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
629 fprintf(fff, "lose sight of %s.\n", note);
634 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
636 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
641 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
643 fprintf(fff, "%s is crushed by falling rocks.\n", note);
658 if (do_level) write_level = FALSE;
664 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
666 static void do_cmd_disp_nikki(void)
668 char nikki_title[256];
673 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
674 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
685 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
686 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
687 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
688 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
693 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
702 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
704 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
705 "Attack is the best form of defence.",
707 "An unexpected windfall",
708 "A drowning man will catch at a straw",
709 "Don't count your chickens before they are hatched.",
710 "It is no use crying over spilt milk.",
711 "Seeing is believing.",
712 "Strike the iron while it is hot.",
713 "I don't care what follows.",
714 "To dig a well to put out a house on fire.",
715 "Tomorrow is another day.",
716 "Easy come, easy go.",
717 "The more haste, the less speed.",
718 "Where there is life, there is hope.",
719 "There is no royal road to *WINNER*.",
720 "Danger past, God forgotten.",
721 "The best thing to do now is to run away.",
722 "Life is but an empty dream.",
723 "Dead men tell no tales.",
724 "A book that remains shut is but a block.",
725 "Misfortunes never come singly.",
726 "A little knowledge is a dangerous thing.",
727 "History repeats itself.",
728 "*WINNER* was not built in a day.",
729 "Ignorance is bliss.",
730 "To lose is to win?",
731 "No medicine can cure folly.",
732 "All good things come to an end.",
733 "M$ Empire strikes back.",
734 "To see is to believe",
736 "Quest of The World's Greatest Brain"};
739 sprintf(file_name,"playrecord-%s.txt",savefile_base);
741 sprintf(file_name,"playrec-%s.txt",savefile_base);
744 /* Build the filename */
745 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
747 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
748 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)]);
749 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
750 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)+1]);
751 else strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-2)+1]);
754 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
755 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
757 sprintf(nikki_title, "Legend of %s %s '%s'",
758 ap_ptr->title, player_name, tmp);
761 /* Display the file contents */
762 show_file(FALSE, buf, nikki_title, -1, 0);
765 static void do_cmd_bunshou(void)
768 char bunshou[80] = "\0";
771 if (get_string("ÆâÍÆ: ", tmp, 79))
773 if (get_string("diary note: ", tmp, 79))
776 strcpy(bunshou, tmp);
778 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
782 static void do_cmd_last_get(void)
787 if (record_o_name[0] == '\0') return;
790 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
792 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
794 if (!get_check(buf)) return;
799 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
801 sprintf(buf,"descover %s.", record_o_name);
803 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
807 static void do_cmd_erase_nikki(void)
814 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
816 if (!get_check("Do you really want to delete all your record? ")) return;
820 sprintf(file_name,"playrecord-%s.txt",savefile_base);
822 sprintf(file_name,"playrec-%s.txt",savefile_base);
825 /* Build the filename */
826 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
828 /* Remove the file */
831 fff = my_fopen(buf, "w");
835 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
837 msg_format("deleted record.");
841 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
843 msg_format("failed to delete %s.", buf);
852 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
858 void do_cmd_nikki(void)
862 /* File type is "TEXT" */
863 FILE_TYPE(FILE_TYPE_TEXT);
865 /* Save the screen */
868 /* Interact until done */
874 /* Ask for a choice */
876 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
878 prt("[ Play Record ]", 2, 0);
882 /* Give some choices */
884 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
885 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
886 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
887 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
889 prt("(1) Display your record", 4, 5);
890 prt("(2) Add record", 5, 5);
891 prt("(3) Record item you last get/identify", 6, 5);
892 prt("(4) Delete your record", 7, 5);
898 prt("¥³¥Þ¥ó¥É:", 18, 0);
900 prt("Command: ", 18, 0);
908 if (i == ESCAPE) break;
922 do_cmd_erase_nikki();
929 default: /* Unknown option */
937 /* Restore the screen */
942 * Hack -- redraw the screen
944 * This command performs various low level updates, clears all the "extra"
945 * windows, does a total redraw of the main window, and requests all of the
946 * interesting updates and redraws that I can think of.
948 * This command is also used to "instantiate" the results of the user
949 * selecting various things, such as graphics mode, so it must call
950 * the "TERM_XTRA_REACT" hook before redrawing the windows.
952 void do_cmd_redraw(void)
959 /* Hack -- react to changes */
960 Term_xtra(TERM_XTRA_REACT, 0);
963 /* Combine and Reorder the pack (later) */
964 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
968 p_ptr->update |= (PU_TORCH);
971 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
973 /* Forget lite/view */
974 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
976 /* Update lite/view */
977 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
979 /* Update monsters */
980 p_ptr->update |= (PU_MONSTERS);
982 /* Redraw everything */
983 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
986 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
989 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
996 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
999 /* Redraw every window */
1000 for (j = 0; j < 8; j++)
1003 if (!angband_term[j]) continue;
1006 Term_activate(angband_term[j]);
1021 * Hack -- change name
1023 void do_cmd_change_name(void)
1032 /* Save the screen */
1040 /* Display the player */
1041 display_player(mode);
1046 display_player(mode);
1051 Term_putstr(2, 23, -1, TERM_WHITE,
1052 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1054 Term_putstr(2, 23, -1, TERM_WHITE,
1055 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1063 if (c == ESCAPE) break;
1074 sprintf(tmp, "%s.txt", player_base);
1076 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1078 if (get_string("File name: ", tmp, 80))
1082 if (tmp[0] && (tmp[0] != ' '))
1084 file_character(tmp, TRUE);
1101 /* Flush messages */
1105 /* Restore the screen */
1108 /* Redraw everything */
1109 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1116 * Recall the most recent message
1118 void do_cmd_message_one(void)
1120 /* Recall one message XXX XXX XXX */
1121 prt(format("> %s", message_str(0)), 0, 0);
1126 * Show previous messages to the user -BEN-
1128 * The screen format uses line 0 and 23 for headers and prompts,
1129 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1131 * This command shows you which commands you are viewing, and allows
1132 * you to "search" for strings in the recall.
1134 * Note that messages may be longer than 80 characters, but they are
1135 * displayed using "infinite" length, with a special sub-command to
1136 * "slide" the virtual display to the left or right.
1138 * Attempt to only hilite the matching portions of the string.
1140 void do_cmd_messages(int num_now)
1156 /* Total messages */
1159 /* Start on first message */
1162 /* Start at leftmost edge */
1165 /* Save the screen */
1168 /* Process requests until done */
1174 /* Dump up to 20 lines of messages */
1175 for (j = 0; (j < 20) && (i + j < n); j++)
1177 cptr msg = message_str(i+j);
1179 /* Apply horizontal scroll */
1180 msg = (strlen(msg) >= q) ? (msg + q) : "";
1182 /* Dump the messages, bottom to top */
1183 Term_putstr(0, 21-j, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1185 /* Hilite "shower" */
1190 /* Display matches */
1191 while ((str = strstr(str, shower)) != NULL)
1193 int len = strlen(shower);
1195 /* Display the match */
1196 Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
1204 /* Display header XXX XXX XXX */
1207 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1208 i, i+j-1, n, q), 0, 0);
1210 prt(format("Message Recall (%d-%d of %d), Offset %d",
1211 i, i+j-1, n, q), 0, 0);
1215 /* Display prompt (not very informative) */
1217 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", 23, 0);
1219 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0);
1226 /* Exit on Escape */
1227 if (k == ESCAPE) break;
1229 /* Hack -- Save the old index */
1232 /* Horizontal scroll */
1236 q = (q >= 40) ? (q - 40) : 0;
1242 /* Horizontal scroll */
1252 /* Hack -- handle show */
1257 prt("¶¯Ä´: ", 23, 0);
1259 prt("Show: ", 23, 0);
1263 /* Get a "shower" string, or continue */
1264 if (!askfor_aux(shower, 80)) continue;
1270 /* Hack -- handle find */
1277 prt("¸¡º÷: ", 23, 0);
1279 prt("Find: ", 23, 0);
1283 /* Get a "finder" string, or continue */
1284 if (!askfor_aux(finder, 80)) continue;
1287 strcpy(shower, finder);
1290 for (z = i + 1; z < n; z++)
1292 cptr msg = message_str(z);
1295 if (strstr(msg, finder))
1306 /* Recall 1 older message */
1307 if ((k == '8') || (k == '\n') || (k == '\r'))
1309 /* Go newer if legal */
1310 if (i + 1 < n) i += 1;
1313 /* Recall 10 older messages */
1316 /* Go older if legal */
1317 if (i + 10 < n) i += 10;
1320 /* Recall 20 older messages */
1321 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1323 /* Go older if legal */
1324 if (i + 20 < n) i += 20;
1327 /* Recall 20 newer messages */
1328 if ((k == 'n') || (k == KTRL('N')))
1330 /* Go newer (if able) */
1331 i = (i >= 20) ? (i - 20) : 0;
1334 /* Recall 10 newer messages */
1337 /* Go newer (if able) */
1338 i = (i >= 20) ? (i - 20) : 0;
1341 /* Recall 1 newer messages */
1344 /* Go newer (if able) */
1345 i = (i >= 1) ? (i - 1) : 0;
1348 /* Hack -- Error of some kind */
1352 /* Restore the screen */
1359 * Number of cheating options
1366 static option_type cheat_info[CHEAT_MAX] =
1368 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1370 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1372 "cheat_peek", "Peek into object creation" },
1376 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1378 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1380 "cheat_hear", "Peek into monster creation" },
1384 { &cheat_room, FALSE, 255, 0x04, 0x00,
1386 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1388 "cheat_room", "Peek into dungeon creation" },
1392 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1394 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1396 "cheat_xtra", "Peek into something else" },
1400 { &cheat_know, FALSE, 255, 0x10, 0x00,
1402 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1404 "cheat_know", "Know complete monster info" },
1408 { &cheat_live, FALSE, 255, 0x20, 0x00,
1410 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1412 "cheat_live", "Allow player to avoid death" }
1418 * Interact with some options for cheating
1420 static void do_cmd_options_cheat(cptr info)
1424 int i, k = 0, n = CHEAT_MAX;
1432 /* Interact with the player */
1435 /* Prompt XXX XXX XXX */
1437 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1439 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1445 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1446 prt(" << Ãí°Õ >>", 11, 0);
1447 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1448 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1449 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1451 /* Display the options */
1452 for (i = 0; i < n; i++)
1454 byte a = TERM_WHITE;
1456 /* Color current option */
1457 if (i == k) a = TERM_L_BLUE;
1459 /* Display the option text */
1460 sprintf(buf, "%-48s: %s (%s)",
1461 cheat_info[i].o_desc,
1463 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1465 (*cheat_info[i].o_var ? "yes" : "no "),
1468 cheat_info[i].o_text);
1469 c_prt(a, buf, i + 2, 0);
1472 /* Hilite current option */
1473 move_cursor(k + 2, 50);
1489 k = (n + k - 1) % n;
1508 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1510 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1512 noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1513 (*cheat_info[k].o_var) = TRUE;
1522 (*cheat_info[k].o_var) = FALSE;
1537 static option_type autosave_info[2] =
1539 { &autosave_l, FALSE, 255, 0x01, 0x00,
1541 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1543 "autosave_l", "Autosave when entering new levels" },
1547 { &autosave_t, FALSE, 255, 0x02, 0x00,
1549 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1551 "autosave_t", "Timed autosave" },
1557 static s16b toggle_frequency(s16b current)
1559 if (current == 0) return 50;
1560 if (current == 50) return 100;
1561 if (current == 100) return 250;
1562 if (current == 250) return 500;
1563 if (current == 500) return 1000;
1564 if (current == 1000) return 2500;
1565 if (current == 2500) return 5000;
1566 if (current == 5000) return 10000;
1567 if (current == 10000) return 25000;
1574 * Interact with some options for cheating
1576 static void do_cmd_options_autosave(cptr info)
1580 int i, k = 0, n = 2;
1588 /* Interact with the player */
1591 /* Prompt XXX XXX XXX */
1593 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1595 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1600 /* Display the options */
1601 for (i = 0; i < n; i++)
1603 byte a = TERM_WHITE;
1605 /* Color current option */
1606 if (i == k) a = TERM_L_BLUE;
1608 /* Display the option text */
1609 sprintf(buf, "%-48s: %s (%s)",
1610 autosave_info[i].o_desc,
1612 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1614 (*autosave_info[i].o_var ? "yes" : "no "),
1617 autosave_info[i].o_text);
1618 c_prt(a, buf, i + 2, 0);
1622 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1624 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1629 /* Hilite current option */
1630 move_cursor(k + 2, 50);
1646 k = (n + k - 1) % n;
1664 (*autosave_info[k].o_var) = TRUE;
1673 (*autosave_info[k].o_var) = FALSE;
1681 autosave_freq = toggle_frequency(autosave_freq);
1683 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1685 prt(format("Timed autosave frequency: every %d turns",
1688 autosave_freq), 5, 0);
1701 #define PAGE_AUTODESTROY 7
1704 * Interact with some options
1706 void do_cmd_options_aux(int page, cptr info)
1709 int i, k = 0, n = 0, l;
1714 /* Lookup the options */
1715 for (i = 0; i < 24; i++) opt[i] = 0;
1717 /* Scan the options */
1718 for (i = 0; option_info[i].o_desc; i++)
1720 /* Notice options on this "page" */
1721 if (option_info[i].o_page == page) opt[n++] = i;
1729 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
1731 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
1734 /* Interact with the player */
1737 /* Prompt XXX XXX XXX */
1739 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1741 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1746 /* Display the options */
1747 for (i = 0; i < n; i++)
1749 byte a = TERM_WHITE;
1751 /* Color current option */
1752 if (i == k) a = TERM_L_BLUE;
1754 /* Display the option text */
1755 sprintf(buf, "%-48s: %s (%.19s)",
1756 option_info[opt[i]].o_desc,
1758 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1760 (*option_info[opt[i]].o_var ? "yes" : "no "),
1763 option_info[opt[i]].o_text);
1764 if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
1765 else c_prt(a, buf, i + 2, 0);
1768 if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
1770 /* Hilite current option */
1771 move_cursor(k + 2 + l, 50);
1789 k = (n + k - 1) % n;
1810 (*option_info[opt[k]].o_var) = TRUE;
1821 (*option_info[opt[k]].o_var) = FALSE;
1829 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1844 * Modify the "window" options
1846 static void do_cmd_options_win(void)
1860 /* Memorize old flags */
1861 for (j = 0; j < 8; j++)
1863 /* Acquire current flags */
1864 old_flag[j] = window_flag[j];
1874 /* Prompt XXX XXX XXX */
1876 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1878 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1882 /* Display the windows */
1883 for (j = 0; j < 8; j++)
1885 byte a = TERM_WHITE;
1887 cptr s = angband_term_name[j];
1890 if (j == x) a = TERM_L_BLUE;
1892 /* Window name, staggered, centered */
1893 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1896 /* Display the options */
1897 for (i = 0; i < 16; i++)
1899 byte a = TERM_WHITE;
1901 cptr str = window_flag_desc[i];
1904 if (i == y) a = TERM_L_BLUE;
1908 if (!str) str = "(̤»ÈÍÑ)";
1910 if (!str) str = "(Unused option)";
1915 Term_putstr(0, i + 5, -1, a, str);
1917 /* Display the windows */
1918 for (j = 0; j < 8; j++)
1920 byte a = TERM_WHITE;
1925 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1928 if (window_flag[j] & (1L << i)) c = 'X';
1931 Term_putch(35 + j * 5, i + 5, a, c);
1936 Term_gotoxy(35 + x * 5, y + 5);
1954 for (j = 0; j < 8; j++)
1956 window_flag[j] &= ~(1L << y);
1960 for (i = 0; i < 16; i++)
1962 window_flag[x] &= ~(1L << i);
1975 window_flag[x] |= (1L << y);
1983 window_flag[x] &= ~(1L << y);
1989 d = get_keymap_dir(ch);
1991 x = (x + ddx[d] + 8) % 8;
1992 y = (y + ddy[d] + 16) % 16;
1999 /* Notice changes */
2000 for (j = 0; j < 8; j++)
2005 if (!angband_term[j]) continue;
2007 /* Ignore non-changes */
2008 if (window_flag[j] == old_flag[j]) continue;
2011 Term_activate(angband_term[j]);
2028 * Set or unset various options.
2030 * The user must use the "Ctrl-R" command to "adapt" to changes
2031 * in any options which control "visual" aspects of the game.
2033 void do_cmd_options(void)
2038 /* Save the screen */
2048 /* Why are we here */
2050 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2052 prt("Options", 2, 0);
2056 /* Give some choices */
2058 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2059 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2060 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2061 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2062 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2063 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2064 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2065 /* Special choices */
2066 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2067 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2068 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2070 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2072 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2074 prt("(1) Input Options", 4, 5);
2075 prt("(2) Output Options", 5, 5);
2076 prt("(3) Game-Play Options", 6, 5);
2077 prt("(4) Disturbance Options", 7, 5);
2078 prt("(5) Efficiency Options", 8, 5);
2079 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2080 prt("(R) Play-record Options", 10, 5);
2082 /* Special choices */
2083 prt("(D) Base Delay Factor", 12, 5);
2084 prt("(H) Hitpoint Warning", 13, 5);
2085 prt("(A) Autosave Options", 14, 5);
2089 prt("(W) Window Flags", 15, 5);
2092 prt("(C) Cheating Options", 16, 5);
2098 prt("¥³¥Þ¥ó¥É:", 18, 0);
2100 prt("Command: ", 18, 0);
2108 if (k == ESCAPE) break;
2113 /* General Options */
2116 /* Process the general options */
2118 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2120 do_cmd_options_aux(1, "Input Options");
2126 /* General Options */
2129 /* Process the general options */
2131 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2133 do_cmd_options_aux(2, "Output Options");
2139 /* Inventory Options */
2144 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2146 do_cmd_options_aux(3, "Game-Play Options");
2152 /* Disturbance Options */
2157 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2159 do_cmd_options_aux(4, "Disturbance Options");
2165 /* Efficiency Options */
2170 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2172 do_cmd_options_aux(5, "Efficiency Options");
2178 /* Object auto-destruction Options */
2183 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2185 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2190 /* Play-record Options */
2196 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2198 do_cmd_options_aux(10, "Play-record Option");
2203 /* Cheating Options */
2208 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2210 do_cmd_options_cheat("Cheaters never win");
2220 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2222 do_cmd_options_autosave("Autosave");
2233 do_cmd_options_win();
2234 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2235 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2236 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2237 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2241 /* Hack -- Delay Speed */
2247 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2249 prt("Command: Base Delay Factor", 18, 0);
2253 /* Get a new value */
2256 int msec = delay_factor * delay_factor * delay_factor;
2258 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2260 prt(format("Current base delay factor: %d (%d msec)",
2263 delay_factor, msec), 22, 0);
2265 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2267 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2271 if (k == ESCAPE) break;
2272 if (isdigit(k)) delay_factor = D2I(k);
2279 /* Hack -- hitpoint warning factor */
2285 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2287 prt("Command: Hitpoint Warning", 18, 0);
2291 /* Get a new value */
2295 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2296 hitpoint_warn), 22, 0);
2298 prt(format("Current hitpoint warning: %d0%%",
2299 hitpoint_warn), 22, 0);
2303 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2305 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2309 if (k == ESCAPE) break;
2310 if (isdigit(k)) hitpoint_warn = D2I(k);
2317 /* Unknown option */
2326 /* Flush messages */
2331 /* Restore the screen */
2334 /* Hack - Redraw equippy chars */
2335 p_ptr->redraw |= (PR_EQUIPPY);
2341 * Ask for a "user pref line" and process it
2343 * XXX XXX XXX Allow absolute file names?
2345 void do_cmd_pref(void)
2352 /* Ask for a "user pref command" */
2354 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2356 if (!get_string("Pref: ", buf, 80)) return;
2360 /* Process that pref command */
2361 (void)process_pref_file_command(buf);
2364 void do_cmd_pickpref(void)
2371 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2373 if(!get_check("Reload auto-pick preference file? ")) return;
2375 /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
2376 for( i = 0; i < max_autopick; i++){
2377 string_free(autopick_name[i]);
2378 string_free(autopick_insc[i]);
2382 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2384 sprintf(buf, "picktype-%s.prf", player_name);
2386 sprintf(buf, "pickpref-%s.prf", player_name);
2388 if( process_pickpref_file(buf) == 0 ){
2391 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2393 msg_format("loaded '%s'.", buf);
2397 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2399 if( process_pickpref_file("picktype.prf") == 0 )
2401 if( process_pickpref_file("pickpref.prf") == 0 )
2406 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2408 msg_print("loaded 'pickpref.prf'.");
2413 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2415 if(err) msg_print("Failed to reload autopick preference.");
2422 * Hack -- append all current macros to the given file
2424 static errr macro_dump(cptr fname)
2426 static cptr mark = "Macro Dump";
2434 /* Build the filename */
2435 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2437 /* File type is "TEXT" */
2438 FILE_TYPE(FILE_TYPE_TEXT);
2440 /* Append to the file */
2441 fff = open_auto_dump(buf, mark, &line_num);
2442 if (!fff) return (-1);
2446 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2448 fprintf(fff, "\n# Automatic macro dump\n\n");
2453 for (i = 0; i < macro__num; i++)
2455 /* Extract the action */
2456 ascii_to_text(buf, macro__act[i]);
2458 /* Dump the macro */
2459 fprintf(fff, "A:%s\n", buf);
2461 /* Extract the action */
2462 ascii_to_text(buf, macro__pat[i]);
2464 /* Dump normal macros */
2465 fprintf(fff, "P:%s\n", buf);
2470 /* count number of lines */
2475 close_auto_dump(fff, mark, line_num);
2483 * Hack -- ask for a "trigger" (see below)
2485 * Note the complex use of the "inkey()" function from "util.c".
2487 * Note that both "flush()" calls are extremely important.
2489 static void do_cmd_macro_aux(char *buf)
2499 /* Do not process macros */
2505 /* Read the pattern */
2511 /* Do not process macros */
2514 /* Do not wait for keys */
2517 /* Attempt to read a key */
2528 /* Convert the trigger */
2529 ascii_to_text(tmp, buf);
2531 /* Hack -- display the trigger */
2532 Term_addstr(-1, TERM_WHITE, tmp);
2539 * Hack -- ask for a keymap "trigger" (see below)
2541 * Note that both "flush()" calls are extremely important. This may
2542 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2544 static void do_cmd_macro_aux_keymap(char *buf)
2558 /* Convert to ascii */
2559 ascii_to_text(tmp, buf);
2561 /* Hack -- display the trigger */
2562 Term_addstr(-1, TERM_WHITE, tmp);
2571 * Hack -- append all keymaps to the given file
2573 static errr keymap_dump(cptr fname)
2575 static cptr mark = "Keymap Dump";
2587 if (rogue_like_commands)
2589 mode = KEYMAP_MODE_ROGUE;
2595 mode = KEYMAP_MODE_ORIG;
2599 /* Build the filename */
2600 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2602 /* File type is "TEXT" */
2603 FILE_TYPE(FILE_TYPE_TEXT);
2605 /* Append to the file */
2606 fff = open_auto_dump(buf, mark, &line_num);
2607 if (!fff) return -1;
2611 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2613 fprintf(fff, "\n# Automatic keymap dump\n\n");
2618 for (i = 0; i < 256; i++)
2622 /* Loop up the keymap */
2623 act = keymap_act[mode][i];
2625 /* Skip empty keymaps */
2628 /* Encode the key */
2631 ascii_to_text(key, buf);
2633 /* Encode the action */
2634 ascii_to_text(buf, act);
2636 /* Dump the macro */
2637 fprintf(fff, "A:%s\n", buf);
2638 fprintf(fff, "C:%d:%s\n", mode, key);
2643 close_auto_dump(fff, mark, line_num);
2652 * Interact with "macros"
2654 * Note that the macro "action" must be defined before the trigger.
2656 * Could use some helpful instructions on this page. XXX XXX XXX
2658 void do_cmd_macros(void)
2670 if (rogue_like_commands)
2672 mode = KEYMAP_MODE_ROGUE;
2678 mode = KEYMAP_MODE_ORIG;
2681 /* File type is "TEXT" */
2682 FILE_TYPE(FILE_TYPE_TEXT);
2689 /* Process requests until done */
2697 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2699 prt("Interact with Macros", 2, 0);
2704 /* Describe that action */
2706 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2708 prt("Current action (if any) shown below:", 20, 0);
2712 /* Analyze the current action */
2713 ascii_to_text(buf, macro__buf);
2715 /* Display the current action */
2721 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2723 prt("(1) Load a user pref file", 4, 5);
2728 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2729 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2730 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2731 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2732 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2733 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2734 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2735 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2736 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2738 prt("(2) Append macros to a file", 5, 5);
2739 prt("(3) Query a macro", 6, 5);
2740 prt("(4) Create a macro", 7, 5);
2741 prt("(5) Remove a macro", 8, 5);
2742 prt("(6) Append keymaps to a file", 9, 5);
2743 prt("(7) Query a keymap", 10, 5);
2744 prt("(8) Create a keymap", 11, 5);
2745 prt("(9) Remove a keymap", 12, 5);
2746 prt("(0) Enter a new action", 13, 5);
2749 #endif /* ALLOW_MACROS */
2753 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2755 prt("Command: ", 16, 0);
2763 if (i == ESCAPE) break;
2765 /* Load a 'macro' file */
2770 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2772 prt("Command: Load a user pref file", 16, 0);
2778 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2780 prt("File: ", 18, 0);
2784 /* Default filename */
2785 sprintf(tmp, "%s.prf", player_name);
2787 /* Ask for a file */
2788 if (!askfor_aux(tmp, 80)) continue;
2790 /* Process the given filename */
2791 if (0 != process_pref_file(tmp))
2795 msg_print("¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤á¤Þ¤»¤ó¤Ç¤·¤¿¡ª");
2797 msg_print("Could not load file!");
2810 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2812 prt("Command: Append macros to a file", 16, 0);
2818 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2820 prt("File: ", 18, 0);
2824 /* Default filename */
2825 sprintf(tmp, "%s.prf", player_name);
2827 /* Ask for a file */
2828 if (!askfor_aux(tmp, 80)) continue;
2833 /* Dump the macros */
2834 (void)macro_dump(tmp);
2841 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2843 msg_print("Appended macros.");
2855 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2857 prt("Command: Query a macro", 16, 0);
2863 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2865 prt("Trigger: ", 18, 0);
2869 /* Get a macro trigger */
2870 do_cmd_macro_aux(buf);
2872 /* Acquire action */
2873 k = macro_find_exact(buf);
2880 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2882 msg_print("Found no macro.");
2890 /* Obtain the action */
2891 strcpy(macro__buf, macro__act[k]);
2893 /* Analyze the current action */
2894 ascii_to_text(buf, macro__buf);
2896 /* Display the current action */
2901 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2903 msg_print("Found a macro.");
2909 /* Create a macro */
2914 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2916 prt("Command: Create a macro", 16, 0);
2922 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2924 prt("Trigger: ", 18, 0);
2928 /* Get a macro trigger */
2929 do_cmd_macro_aux(buf);
2936 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
2938 prt("Action: ", 20, 0);
2942 /* Convert to text */
2943 ascii_to_text(tmp, macro__buf);
2945 /* Get an encoded action */
2946 if (askfor_aux(tmp, 80))
2948 /* Convert to ascii */
2949 text_to_ascii(macro__buf, tmp);
2951 /* Link the macro */
2952 macro_add(buf, macro__buf);
2956 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2958 msg_print("Added a macro.");
2964 /* Remove a macro */
2969 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
2971 prt("Command: Remove a macro", 16, 0);
2977 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2979 prt("Trigger: ", 18, 0);
2983 /* Get a macro trigger */
2984 do_cmd_macro_aux(buf);
2986 /* Link the macro */
2987 macro_add(buf, buf);
2991 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
2993 msg_print("Removed a macro.");
3003 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3005 prt("Command: Append keymaps to a file", 16, 0);
3011 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3013 prt("File: ", 18, 0);
3017 /* Default filename */
3018 sprintf(tmp, "%s.prf", player_name);
3020 /* Ask for a file */
3021 if (!askfor_aux(tmp, 80)) continue;
3026 /* Dump the macros */
3027 (void)keymap_dump(tmp);
3034 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3036 msg_print("Appended keymaps.");
3041 /* Query a keymap */
3048 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3050 prt("Command: Query a keymap", 16, 0);
3056 prt("²¡¤¹¥¡¼: ", 18, 0);
3058 prt("Keypress: ", 18, 0);
3062 /* Get a keymap trigger */
3063 do_cmd_macro_aux_keymap(buf);
3065 /* Look up the keymap */
3066 act = keymap_act[mode][(byte)(buf[0])];
3073 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3075 msg_print("Found no keymap.");
3083 /* Obtain the action */
3084 strcpy(macro__buf, act);
3086 /* Analyze the current action */
3087 ascii_to_text(buf, macro__buf);
3089 /* Display the current action */
3094 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3096 msg_print("Found a keymap.");
3102 /* Create a keymap */
3107 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3109 prt("Command: Create a keymap", 16, 0);
3115 prt("²¡¤¹¥¡¼: ", 18, 0);
3117 prt("Keypress: ", 18, 0);
3121 /* Get a keymap trigger */
3122 do_cmd_macro_aux_keymap(buf);
3129 prt("¹ÔÆ°: ", 20, 0);
3131 prt("Action: ", 20, 0);
3135 /* Convert to text */
3136 ascii_to_text(tmp, macro__buf);
3138 /* Get an encoded action */
3139 if (askfor_aux(tmp, 80))
3141 /* Convert to ascii */
3142 text_to_ascii(macro__buf, tmp);
3144 /* Free old keymap */
3145 string_free(keymap_act[mode][(byte)(buf[0])]);
3147 /* Make new keymap */
3148 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3152 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3154 msg_print("Added a keymap.");
3160 /* Remove a keymap */
3165 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3167 prt("Command: Remove a keymap", 16, 0);
3173 prt("²¡¤¹¥¡¼: ", 18, 0);
3175 prt("Keypress: ", 18, 0);
3179 /* Get a keymap trigger */
3180 do_cmd_macro_aux_keymap(buf);
3182 /* Free old keymap */
3183 string_free(keymap_act[mode][(byte)(buf[0])]);
3185 /* Make new keymap */
3186 keymap_act[mode][(byte)(buf[0])] = NULL;
3190 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3192 msg_print("Removed a keymap.");
3197 /* Enter a new action */
3202 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3204 prt("Command: Enter a new action", 16, 0);
3208 /* Go to the correct location */
3211 /* Hack -- limit the value */
3214 /* Get an encoded action */
3215 if (!askfor_aux(buf, 80)) continue;
3217 /* Extract an action */
3218 text_to_ascii(macro__buf, buf);
3221 #endif /* ALLOW_MACROS */
3230 /* Flush messages */
3240 * Interact with "visuals"
3242 void do_cmd_visuals(void)
3253 /* File type is "TEXT" */
3254 FILE_TYPE(FILE_TYPE_TEXT);
3257 /* Save the screen */
3261 /* Interact until done */
3267 /* Ask for a choice */
3269 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3271 prt("Interact with Visuals", 2, 0);
3275 /* Give some choices */
3277 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3279 prt("(1) Load a user pref file", 4, 5);
3282 #ifdef ALLOW_VISUALS
3284 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3285 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3286 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3287 prt("(5) (̤»ÈÍÑ)", 8, 5);
3288 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3289 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3290 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3291 prt("(9) (̤»ÈÍÑ)", 12, 5);
3293 prt("(2) Dump monster attr/chars", 5, 5);
3294 prt("(3) Dump object attr/chars", 6, 5);
3295 prt("(4) Dump feature attr/chars", 7, 5);
3296 prt("(5) (unused)", 8, 5);
3297 prt("(6) Change monster attr/chars", 9, 5);
3298 prt("(7) Change object attr/chars", 10, 5);
3299 prt("(8) Change feature attr/chars", 11, 5);
3300 prt("(9) (unused)", 12, 5);
3305 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3307 prt("(0) Reset visuals", 13, 5);
3313 prt("¥³¥Þ¥ó¥É:", 18, 0);
3315 prt("Command: ", 15, 0);
3323 if (i == ESCAPE) break;
3325 /* Load a 'pref' file */
3330 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3332 prt("Command: Load a user pref file", 15, 0);
3338 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3340 prt("File: ", 17, 0);
3344 /* Default filename */
3345 sprintf(tmp, "%s.prf", player_name);
3348 if (!askfor_aux(tmp, 70)) continue;
3350 /* Process the given filename */
3351 (void)process_pref_file(tmp);
3354 #ifdef ALLOW_VISUALS
3356 /* Dump monster attr/chars */
3359 static cptr mark = "Monster attr/chars";
3364 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3366 prt("Command: Dump monster attr/chars", 15, 0);
3372 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3374 prt("File: ", 17, 0);
3378 /* Default filename */
3379 sprintf(tmp, "%s.prf", player_name);
3381 /* Get a filename */
3382 if (!askfor_aux(tmp, 70)) continue;
3384 /* Build the filename */
3385 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3390 /* Append to the file */
3391 fff = open_auto_dump(buf, mark, &line_num);
3399 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3401 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3406 for (i = 0; i < max_r_idx; i++)
3408 monster_race *r_ptr = &r_info[i];
3410 /* Skip non-entries */
3411 if (!r_ptr->name) continue;
3413 /* Dump a comment */
3414 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3417 /* Dump the monster attr/char info */
3418 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3419 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3424 close_auto_dump(fff, mark, line_num);
3428 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3430 msg_print("Dumped monster attr/chars.");
3435 /* Dump object attr/chars */
3438 static cptr mark = "Object attr/chars";
3443 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3445 prt("Command: Dump object attr/chars", 15, 0);
3451 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3453 prt("File: ", 17, 0);
3457 /* Default filename */
3458 sprintf(tmp, "%s.prf", player_name);
3460 /* Get a filename */
3461 if (!askfor_aux(tmp, 70)) continue;
3463 /* Build the filename */
3464 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3469 /* Append to the file */
3470 fff = open_auto_dump(buf, mark, &line_num);
3478 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3480 fprintf(fff, "\n# Object attr/char definitions\n\n");
3485 for (i = 0; i < max_k_idx; i++)
3487 object_kind *k_ptr = &k_info[i];
3489 /* Skip non-entries */
3490 if (!k_ptr->name) continue;
3492 /* Dump a comment */
3493 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3496 /* Dump the object attr/char info */
3497 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3498 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3503 close_auto_dump(fff, mark, line_num);
3507 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3509 msg_print("Dumped object attr/chars.");
3514 /* Dump feature attr/chars */
3517 static cptr mark = "Feature attr/chars";
3522 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3524 prt("Command: Dump feature attr/chars", 15, 0);
3530 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3532 prt("File: ", 17, 0);
3536 /* Default filename */
3537 sprintf(tmp, "%s.prf", player_name);
3539 /* Get a filename */
3540 if (!askfor_aux(tmp, 70)) continue;
3542 /* Build the filename */
3543 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3548 /* Append to the file */
3549 fff = open_auto_dump(buf, mark, &line_num);
3557 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3559 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3564 for (i = 0; i < max_f_idx; i++)
3566 feature_type *f_ptr = &f_info[i];
3568 /* Skip non-entries */
3569 if (!f_ptr->name) continue;
3571 /* Dump a comment */
3572 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3575 /* Dump the feature attr/char info */
3576 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3577 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3582 close_auto_dump(fff, mark, line_num);
3586 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3588 msg_print("Dumped feature attr/chars.");
3593 /* Modify monster attr/chars */
3600 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3602 prt("Command: Change monster attr/chars", 15, 0);
3606 /* Hack -- query until done */
3609 monster_race *r_ptr = &r_info[r];
3611 byte da = (r_ptr->d_attr);
3612 byte dc = (r_ptr->d_char);
3613 byte ca = (r_ptr->x_attr);
3614 byte cc = (r_ptr->x_char);
3616 /* Label the object */
3618 Term_putstr(5, 17, -1, TERM_WHITE,
3619 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3620 r, (r_name + r_ptr->name)));
3622 Term_putstr(5, 17, -1, TERM_WHITE,
3623 format("Monster = %d, Name = %-40.40s",
3624 r, (r_name + r_ptr->name)));
3628 /* Label the Default values */
3630 Term_putstr(10, 19, -1, TERM_WHITE,
3631 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3633 Term_putstr(10, 19, -1, TERM_WHITE,
3634 format("Default attr/char = %3u / %3u", da, dc));
3637 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3638 Term_putch(43, 19, da, dc);
3640 /* Label the Current values */
3642 Term_putstr(10, 20, -1, TERM_WHITE,
3643 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3645 Term_putstr(10, 20, -1, TERM_WHITE,
3646 format("Current attr/char = %3u / %3u", ca, cc));
3649 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3650 Term_putch(43, 20, ca, cc);
3654 Term_putstr(0, 22, -1, TERM_WHITE,
3655 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3657 Term_putstr(0, 22, -1, TERM_WHITE,
3658 "Command (n/N/a/A/c/C): ");
3666 if (i == ESCAPE) break;
3669 if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx;
3670 if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx;
3671 if (i == 'a') r_ptr->x_attr = (byte)(ca + 1);
3672 if (i == 'A') r_ptr->x_attr = (byte)(ca - 1);
3673 if (i == 'c') r_ptr->x_char = (byte)(cc + 1);
3674 if (i == 'C') r_ptr->x_char = (byte)(cc - 1);
3678 /* Modify object attr/chars */
3685 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3687 prt("Command: Change object attr/chars", 15, 0);
3691 /* Hack -- query until done */
3694 object_kind *k_ptr = &k_info[k];
3696 byte da = (byte)k_ptr->d_attr;
3697 byte dc = (byte)k_ptr->d_char;
3698 byte ca = (byte)k_ptr->x_attr;
3699 byte cc = (byte)k_ptr->x_char;
3701 /* Label the object */
3703 Term_putstr(5, 17, -1, TERM_WHITE,
3704 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3705 k, (k_name + k_ptr->name)));
3707 Term_putstr(5, 17, -1, TERM_WHITE,
3708 format("Object = %d, Name = %-40.40s",
3709 k, (k_name + k_ptr->name)));
3713 /* Label the Default values */
3715 Term_putstr(10, 19, -1, TERM_WHITE,
3716 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3718 Term_putstr(10, 19, -1, TERM_WHITE,
3719 format("Default attr/char = %3d / %3d", da, dc));
3722 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3723 Term_putch(43, 19, da, dc);
3725 /* Label the Current values */
3727 Term_putstr(10, 20, -1, TERM_WHITE,
3728 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3730 Term_putstr(10, 20, -1, TERM_WHITE,
3731 format("Current attr/char = %3d / %3d", ca, cc));
3734 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3735 Term_putch(43, 20, ca, cc);
3739 Term_putstr(0, 22, -1, TERM_WHITE,
3740 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3742 Term_putstr(0, 22, -1, TERM_WHITE,
3743 "Command (n/N/a/A/c/C): ");
3751 if (i == ESCAPE) break;
3754 if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx;
3755 if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx;
3756 if (i == 'a') k_info[k].x_attr = (byte)(ca + 1);
3757 if (i == 'A') k_info[k].x_attr = (byte)(ca - 1);
3758 if (i == 'c') k_info[k].x_char = (byte)(cc + 1);
3759 if (i == 'C') k_info[k].x_char = (byte)(cc - 1);
3763 /* Modify feature attr/chars */
3770 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3772 prt("Command: Change feature attr/chars", 15, 0);
3776 /* Hack -- query until done */
3779 feature_type *f_ptr = &f_info[f];
3781 byte da = (byte)f_ptr->d_attr;
3782 byte dc = (byte)f_ptr->d_char;
3783 byte ca = (byte)f_ptr->x_attr;
3784 byte cc = (byte)f_ptr->x_char;
3786 /* Label the object */
3788 Term_putstr(5, 17, -1, TERM_WHITE,
3789 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3790 f, (f_name + f_ptr->name)));
3792 Term_putstr(5, 17, -1, TERM_WHITE,
3793 format("Terrain = %d, Name = %-40.40s",
3794 f, (f_name + f_ptr->name)));
3798 /* Label the Default values */
3800 Term_putstr(10, 19, -1, TERM_WHITE,
3801 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3803 Term_putstr(10, 19, -1, TERM_WHITE,
3804 format("Default attr/char = %3d / %3d", da, dc));
3807 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3808 Term_putch(43, 19, da, dc);
3810 /* Label the Current values */
3812 Term_putstr(10, 20, -1, TERM_WHITE,
3813 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3815 Term_putstr(10, 20, -1, TERM_WHITE,
3816 format("Current attr/char = %3d / %3d", ca, cc));
3819 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3820 Term_putch(43, 20, ca, cc);
3824 Term_putstr(0, 22, -1, TERM_WHITE,
3825 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3827 Term_putstr(0, 22, -1, TERM_WHITE,
3828 "Command (n/N/a/A/c/C): ");
3836 if (i == ESCAPE) break;
3839 if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx;
3840 if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx;
3841 if (i == 'a') f_info[f].x_attr = (byte)(ca + 1);
3842 if (i == 'A') f_info[f].x_attr = (byte)(ca - 1);
3843 if (i == 'c') f_info[f].x_char = (byte)(cc + 1);
3844 if (i == 'C') f_info[f].x_char = (byte)(cc - 1);
3858 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
3860 msg_print("Visual attr/char tables reset.");
3865 /* Unknown option */
3871 /* Flush messages */
3876 /* Restore the screen */
3882 * Interact with "colors"
3884 void do_cmd_colors(void)
3895 /* File type is "TEXT" */
3896 FILE_TYPE(FILE_TYPE_TEXT);
3899 /* Save the screen */
3903 /* Interact until done */
3909 /* Ask for a choice */
3911 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
3913 prt("Interact with Colors", 2, 0);
3917 /* Give some choices */
3919 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3921 prt("(1) Load a user pref file", 4, 5);
3926 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3927 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
3929 prt("(2) Dump colors", 5, 5);
3930 prt("(3) Modify colors", 6, 5);
3937 prt("¥³¥Þ¥ó¥É: ", 8, 0);
3939 prt("Command: ", 8, 0);
3947 if (i == ESCAPE) break;
3949 /* Load a 'pref' file */
3954 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
3956 prt("Command: Load a user pref file", 8, 0);
3962 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
3964 prt("File: ", 10, 0);
3969 sprintf(tmp, "%s.prf", player_name);
3972 if (!askfor_aux(tmp, 70)) continue;
3974 /* Process the given filename */
3975 (void)process_pref_file(tmp);
3977 /* Mega-Hack -- react to changes */
3978 Term_xtra(TERM_XTRA_REACT, 0);
3980 /* Mega-Hack -- redraw */
3989 static cptr mark = "Colors";
3994 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
3996 prt("Command: Dump colors", 8, 0);
4002 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4004 prt("File: ", 10, 0);
4008 /* Default filename */
4009 sprintf(tmp, "%s.prf", player_name);
4011 /* Get a filename */
4012 if (!askfor_aux(tmp, 70)) continue;
4014 /* Build the filename */
4015 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
4020 /* Append to the file */
4021 fff = open_auto_dump(buf, mark, &line_num);
4029 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4031 fprintf(fff, "\n# Color redefinitions\n\n");
4036 for (i = 0; i < 256; i++)
4038 int kv = angband_color_table[i][0];
4039 int rv = angband_color_table[i][1];
4040 int gv = angband_color_table[i][2];
4041 int bv = angband_color_table[i][3];
4046 cptr name = "unknown";
4050 /* Skip non-entries */
4051 if (!kv && !rv && !gv && !bv) continue;
4053 /* Extract the color name */
4054 if (i < 16) name = color_names[i];
4056 /* Dump a comment */
4058 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4060 fprintf(fff, "# Color '%s'\n", name);
4064 /* Dump the monster attr/char info */
4065 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4071 close_auto_dump(fff, mark, line_num);
4075 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4077 msg_print("Dumped color redefinitions.");
4089 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4091 prt("Command: Modify colors", 8, 0);
4095 /* Hack -- query until done */
4104 /* Exhibit the normal colors */
4105 for (j = 0; j < 16; j++)
4107 /* Exhibit this color */
4108 Term_putstr(j*4, 20, -1, a, "###");
4110 /* Exhibit all colors */
4111 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4114 /* Describe the color */
4116 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4118 name = ((a < 16) ? color_names[a] : "undefined");
4122 /* Describe the color */
4124 Term_putstr(5, 10, -1, TERM_WHITE,
4125 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4127 Term_putstr(5, 10, -1, TERM_WHITE,
4128 format("Color = %d, Name = %s", a, name));
4132 /* Label the Current values */
4133 Term_putstr(5, 12, -1, TERM_WHITE,
4134 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4135 angband_color_table[a][0],
4136 angband_color_table[a][1],
4137 angband_color_table[a][2],
4138 angband_color_table[a][3]));
4142 Term_putstr(0, 14, -1, TERM_WHITE,
4143 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4145 Term_putstr(0, 14, -1, TERM_WHITE,
4146 "Command (n/N/k/K/r/R/g/G/b/B): ");
4154 if (i == ESCAPE) break;
4157 if (i == 'n') a = (byte)(a + 1);
4158 if (i == 'N') a = (byte)(a - 1);
4159 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4160 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4161 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4162 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4163 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4164 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4165 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4166 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4168 /* Hack -- react to changes */
4169 Term_xtra(TERM_XTRA_REACT, 0);
4171 /* Hack -- redraw */
4178 /* Unknown option */
4184 /* Flush messages */
4189 /* Restore the screen */
4195 * Note something in the message recall
4197 void do_cmd_note(void)
4206 if (!get_string("¥á¥â: ", buf, 60)) return;
4208 if (!get_string("Note: ", buf, 60)) return;
4212 /* Ignore empty notes */
4213 if (!buf[0] || (buf[0] == ' ')) return;
4215 /* Add the note to the message recall */
4217 msg_format("¥á¥â: %s", buf);
4219 msg_format("Note: %s", buf);
4226 * Mention the current version
4228 void do_cmd_version(void)
4232 #ifndef FAKE_VERSION
4233 msg_format("You are playing Angband %d.%d.%d.",
4234 VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
4237 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4238 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4240 msg_format("You are playing Hengband %d.%d.%d.",
4241 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4251 * Array of feeling strings
4253 static cptr do_cmd_feeling_text[11] =
4256 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4258 "Looks like any other level.",
4262 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4264 "You feel there is something special about this level.",
4268 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4270 "You nearly faint as horrible visions of death fill your mind!",
4274 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4276 "This level looks very dangerous.",
4280 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4282 "You have a very bad feeling...",
4286 "°¤¤Í½´¶¤¬¤¹¤ë...",
4288 "You have a bad feeling...",
4294 "You feel nervous.",
4298 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4300 "You feel your luck is turning...",
4304 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4306 "You don't like the look of this place.",
4310 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4312 "This level looks reasonably safe.",
4316 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4318 "What a boring place..."
4323 static cptr do_cmd_feeling_text_combat[11] =
4326 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4328 "Looks like any other level.",
4332 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4334 "You feel there is something special about this level.",
4338 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4340 "You nearly faint as horrible visions of death fill your mind!",
4344 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4346 "This level looks very dangerous.",
4350 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4352 "You have a very bad feeling...",
4356 "°¤¤Í½´¶¤¬¤¹¤ë...",
4358 "You have a bad feeling...",
4364 "You feel nervous.",
4368 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4370 "You feel your luck is turning...",
4374 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4376 "You don't like the look of this place.",
4380 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4382 "This level looks reasonably safe.",
4386 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4388 "What a boring place..."
4393 static cptr do_cmd_feeling_text_lucky[11] =
4396 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4397 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4398 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4399 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4400 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4401 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4402 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4403 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4404 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4405 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4406 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4408 "Looks like any other level.",
4409 "You feel there is something special about this level.",
4410 "You have a superb feeling about this level.",
4411 "You have an excellent feeling...",
4412 "You have a very good feeling...",
4413 "You have a good feeling...",
4414 "You feel strangely lucky...",
4415 "You feel your luck is turning...",
4416 "You like the look of this place...",
4417 "This level can't be all bad...",
4418 "What a boring place..."
4424 * Note that "feeling" is set to zero unless some time has passed.
4425 * Note that this is done when the level is GENERATED, not entered.
4427 void do_cmd_feeling(void)
4429 /* Verify the feeling */
4430 if (feeling > 10) feeling = 10;
4433 if (cmd_feeling_callback(feeling)) return;
4434 #endif /* USE_SCRIPT */
4436 /* No useful feeling in quests */
4437 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4440 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4442 msg_print("Looks like a typical quest level.");
4448 /* No useful feeling in town */
4449 else if (p_ptr->town_num && !dun_level)
4452 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4454 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4458 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4460 msg_print("Looks like a strange wilderness.");
4468 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4470 msg_print("Looks like a typical town.");
4477 /* No useful feeling in the wilderness */
4478 else if (!dun_level)
4481 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4483 msg_print("Looks like a typical wilderness.");
4489 /* Display the feeling */
4490 if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
4492 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4494 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4495 msg_print(do_cmd_feeling_text_combat[feeling]);
4497 msg_print(do_cmd_feeling_text[feeling]);
4502 msg_print(do_cmd_feeling_text[0]);
4511 * Encode the screen colors
4513 static char hack[17] = "dwsorgbuDWvyRGBU";
4516 static errr photo_fgets(FILE *fff, char *buf, huge n)
4525 if (fgets(tmp, 1024, fff))
4527 /* Convert weirdness */
4528 for (s = tmp; *s; s++)
4530 /* Handle newline */
4541 else if (*s == '\t')
4543 /* Hack -- require room */
4544 if (i + 8 >= n) break;
4546 /* Append a space */
4549 /* Append some more spaces */
4550 while (!(i % 8)) buf[i++] = ' ';
4554 else if (iskanji(*s))
4561 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4562 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4569 /* Handle printables */
4590 * Hack -- load a screen dump from a file
4592 void do_cmd_load_screen(void)
4606 /* Build the filename */
4607 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4609 /* Append to the file */
4610 fff = my_fopen(buf, "r");
4615 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4617 msg_format("Failed to open %s.", buf);
4624 /* Save the screen */
4627 /* Clear the screen */
4631 /* Load the screen */
4632 for (y = 0; okay && (y < 24); y++)
4634 /* Get a line of data */
4635 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4638 for (x = 0; x < 79; x++)
4640 /* Put the attr/char */
4641 Term_draw(x, y, TERM_WHITE, buf[x]);
4645 /* Get the blank line */
4646 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4649 /* Dump the screen */
4650 for (y = 0; okay && (y < 24); y++)
4652 /* Get a line of data */
4653 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4656 for (x = 0; x < 79; x++)
4658 /* Get the attr/char */
4659 (void)(Term_what(x, y, &a, &c));
4661 /* Look up the attr */
4662 for (i = 0; i < 16; i++)
4664 /* Use attr matches */
4665 if (hack[i] == buf[x]) a = i;
4668 /* Put the attr/char */
4669 Term_draw(x, y, a, c);
4674 /* Get the blank line */
4675 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4684 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4686 msg_print("Screen dump loaded.");
4693 /* Restore the screen */
4700 cptr inven_res_label =
4702 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4704 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4707 /* XTRA HACK RESLIST */
4708 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4709 int *j, byte tval, char *where)
4711 char o_name[MAX_NLEN];
4714 if (!o_ptr->k_idx)return;
4715 if (o_ptr->tval != tval)return;
4718 * HACK:Ring of Lordly protection and Dragon shield/helm
4719 * have random resistances.
4721 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4722 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4723 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4724 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4725 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4726 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4727 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4730 object_desc(o_name, o_ptr, TRUE, 0);
4732 while ( o_name[i] && i < 26 ){
4734 if (iskanji(o_name[i])) i++;
4738 if(i<28) while(i<28){o_name[i]=' ';i++;}
4741 fprintf(fff,"%s %s", where, o_name);
4743 if (!(o_ptr->ident & (IDENT_MENTAL)))
4746 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4748 fprintf(fff, "-------unknown------------ -------unknown------\n");
4752 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4755 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4756 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4757 else fprintf(fff,"¡¦");
4759 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4760 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4761 else fprintf(fff,"¡¦");
4763 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4764 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4765 else fprintf(fff,"¡¦");
4767 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4768 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4769 else fprintf(fff,"¡¦");
4771 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4772 else fprintf(fff,"¡¦");
4774 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4775 else fprintf(fff,"¡¦");
4777 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4778 else fprintf(fff,"¡¦");
4780 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4781 else fprintf(fff,"¡¦");
4783 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4784 else fprintf(fff,"¡¦");
4786 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4787 else fprintf(fff,"¡¦");
4789 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4790 else fprintf(fff,"¡¦");
4792 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4793 else fprintf(fff,"¡¦");
4795 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4796 else fprintf(fff,"¡¦");
4800 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4801 else fprintf(fff,"¡¦");
4803 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4804 else fprintf(fff,"¡¦");
4806 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4807 else fprintf(fff,"¡¦");
4809 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4810 else fprintf(fff,"¡¦");
4812 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4813 else fprintf(fff,"¡¦");
4815 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4816 else fprintf(fff,"¡¦");
4818 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4819 else fprintf(fff,"¡¦");
4821 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4822 else fprintf(fff,"¡¦");
4825 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4826 else fprintf(fff,"¡¦");
4828 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4829 else fprintf(fff,"¡¦");
4831 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4832 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4833 else fprintf(fff,". ");
4835 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4836 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4837 else fprintf(fff,". ");
4839 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4840 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4841 else fprintf(fff,". ");
4843 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4844 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4845 else fprintf(fff,". ");
4847 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4848 else fprintf(fff,". ");
4850 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4851 else fprintf(fff,". ");
4853 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
4854 else fprintf(fff,". ");
4856 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
4857 else fprintf(fff,". ");
4859 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
4860 else fprintf(fff,". ");
4862 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
4863 else fprintf(fff,". ");
4865 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
4866 else fprintf(fff,". ");
4868 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
4869 else fprintf(fff,". ");
4871 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
4872 else fprintf(fff,". ");
4876 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
4877 else fprintf(fff,". ");
4879 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
4880 else fprintf(fff,". ");
4882 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
4883 else fprintf(fff,". ");
4885 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
4886 else fprintf(fff,". ");
4888 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
4889 else fprintf(fff,". ");
4891 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
4892 else fprintf(fff,". ");
4894 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
4895 else fprintf(fff,". ");
4897 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
4898 else fprintf(fff,". ");
4901 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
4902 else fprintf(fff,". ");
4904 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
4905 else fprintf(fff,". ");
4913 fprintf(fff,"%s\n", inven_res_label);
4919 * Display *ID* ed weapons/armors's resistances
4921 static void do_cmd_knowledge_inven(void)
4926 char file_name[1024];
4937 /* Open a new file */
4938 fff = my_fopen_temp(file_name, 1024);
4941 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
4943 msg_format("Failed to create temporally file %s.", file_name);
4948 fprintf(fff,"%s\n",inven_res_label);
4950 for (tval=TV_BOW; tval <= TV_RING; tval++){
4953 for (;j<9;j++) fprintf(fff, "\n");
4955 fprintf(fff,"%s\n",inven_res_label);
4959 strcpy(where, "Áõ");
4961 strcpy(where, "E ");
4963 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4965 o_ptr = &inventory[i];
4966 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4970 strcpy(where, "»ý");
4972 strcpy(where, "I ");
4974 for (i = 0; i < INVEN_PACK; i++)
4976 o_ptr = &inventory[i];
4977 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4981 /* Print all homes in the different towns */
4982 st_ptr = &town[1].store[STORE_HOME];
4984 strcpy(where, "²È");
4986 strcpy(where, "H ");/*nanka*/
4989 /* Dump all available items */
4990 for (i = 0; i < st_ptr->stock_num; i++)
4992 o_ptr = &st_ptr->stock[i];
4993 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4997 /* Close the file */
5000 /* Display the file contents */
5002 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5004 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5007 /* Remove the file */
5012 void do_cmd_save_screen_html_aux(char *filename, int message)
5016 byte a = 0, old_a = 0;
5030 char *html_head[] = {
5031 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5035 char *html_foot[] = {
5037 "</body>\n</html>\n",
5041 /* File type is "TEXT" */
5042 FILE_TYPE(FILE_TYPE_TEXT);
5044 /* Hack -- drop permissions */
5047 /* Append to the file */
5048 fff = my_fopen(filename, "w");
5050 /* Hack -- grab permissions */
5057 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5059 msg_format("Failed to open file %s.", filename);
5066 /* Save the screen */
5070 /* Build the filename */
5071 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
5072 tmpfff = my_fopen(buf, "r");
5074 for (i = 0; html_head[i]; i++)
5075 fprintf(fff, html_head[i]);
5079 while (!my_fgets(tmpfff, buf, 1024)) {
5081 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5085 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5087 fprintf(fff, "%s\n", buf);
5092 /* Dump the screen */
5093 for (y = 0; y < 24; y++)
5100 for (x = 0; x < 79; x++)
5104 /* Get the attr/char */
5105 (void)(Term_what(x, y, &a, &c));
5109 case '&': cc = "&"; break;
5110 case '<': cc = "<"; break;
5111 case '>': cc = ">"; break;
5113 case 0x1f: c = '.'; break;
5114 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5119 if ((y == 0 && x == 0) || a != old_a) {
5120 rv = angband_color_table[a][1];
5121 gv = angband_color_table[a][2];
5122 bv = angband_color_table[a][3];
5123 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5124 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5128 fprintf(fff, "%s", cc);
5130 fprintf(fff, "%c", c);
5133 fprintf(fff, "</font>");
5136 for (i = 0; html_foot[i]; i++)
5137 fprintf(fff, html_foot[i]);
5142 while (!my_fgets(tmpfff, buf, 1024)) {
5144 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5148 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5150 fprintf(fff, "%s\n", buf);
5165 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5167 msg_print("Screen dump saved.");
5172 /* Restore the screen */
5178 * Hack -- save a screen dump to a file
5180 void do_cmd_save_screen_html(void)
5182 char buf[1024], tmp[256] = "screen.html";
5185 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5187 if (!get_string("File name: ", tmp, 80))
5191 /* Build the filename */
5192 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5196 do_cmd_save_screen_html_aux(buf, 1);
5201 * Redefinable "save_screen" action
5203 void (*screendump_aux)(void) = NULL;
5207 * Hack -- save a screen dump to a file
5209 void do_cmd_save_screen(void)
5212 if (get_check("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©"))
5214 if (get_check("Save screen dump as HTML? "))
5217 do_cmd_save_screen_html();
5221 /* Do we use a special screendump function ? */
5224 /* Dump the screen to a graphics file */
5225 (*screendump_aux)();
5227 else /* Dump the screen as text */
5239 /* Build the filename */
5240 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5242 /* File type is "TEXT" */
5243 FILE_TYPE(FILE_TYPE_TEXT);
5245 /* Hack -- drop permissions */
5248 /* Append to the file */
5249 fff = my_fopen(buf, "w");
5251 /* Hack -- grab permissions */
5257 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5259 msg_format("Failed to open file %s.", buf);
5266 /* Save the screen */
5270 /* Dump the screen */
5271 for (y = 0; y < 24; y++)
5274 for (x = 0; x < 79; x++)
5276 /* Get the attr/char */
5277 (void)(Term_what(x, y, &a, &c));
5287 fprintf(fff, "%s\n", buf);
5294 /* Dump the screen */
5295 for (y = 0; y < 24; y++)
5298 for (x = 0; x < 79; x++)
5300 /* Get the attr/char */
5301 (void)(Term_what(x, y, &a, &c));
5304 buf[x] = hack[a&0x0F];
5311 fprintf(fff, "%s\n", buf);
5324 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5326 msg_print("Screen dump saved.");
5332 /* Restore the screen */
5339 * Sorting hook -- Comp function -- see below
5341 * We use "u" to point to array of monster indexes,
5342 * and "v" to select the type of sorting to perform on "u".
5344 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5346 u16b *who = (u16b*)(u);
5348 u16b *why = (u16b*)(v);
5356 /* Sort by total kills */
5359 /* Extract total kills */
5360 z1 = a_info[w1].tval;
5361 z2 = a_info[w2].tval;
5363 /* Compare total kills */
5364 if (z1 < z2) return (TRUE);
5365 if (z1 > z2) return (FALSE);
5369 /* Sort by monster level */
5372 /* Extract levels */
5373 z1 = a_info[w1].sval;
5374 z2 = a_info[w2].sval;
5376 /* Compare levels */
5377 if (z1 < z2) return (TRUE);
5378 if (z1 > z2) return (FALSE);
5382 /* Sort by monster experience */
5385 /* Extract experience */
5386 z1 = a_info[w1].level;
5387 z2 = a_info[w2].level;
5389 /* Compare experience */
5390 if (z1 < z2) return (TRUE);
5391 if (z1 > z2) return (FALSE);
5395 /* Compare indexes */
5401 * Sorting hook -- Swap function -- see below
5403 * We use "u" to point to array of monster indexes,
5404 * and "v" to select the type of sorting to perform.
5406 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5408 u16b *who = (u16b*)(u);
5420 * Check the status of "artifacts"
5422 void do_cmd_knowledge_artifacts(void)
5424 int i, k, z, x, y, n = 0;
5430 char file_name[1024];
5432 char base_name[MAX_NLEN];
5436 /* Open a new file */
5437 fff = my_fopen_temp(file_name, 1024);
5441 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5443 msg_format("Failed to create temporary file %s.", file_name);
5449 /* Allocate the "who" array */
5450 C_MAKE(who, max_r_idx, s16b);
5452 /* Allocate the "okay" array */
5453 C_MAKE(okay, max_a_idx, bool);
5455 /* Scan the artifacts */
5456 for (k = 0; k < max_a_idx; k++)
5458 artifact_type *a_ptr = &a_info[k];
5463 /* Skip "empty" artifacts */
5464 if (!a_ptr->name) continue;
5466 /* Skip "uncreated" artifacts */
5467 if (!a_ptr->cur_num) continue;
5473 /* Check the dungeon */
5474 for (y = 0; y < cur_hgt; y++)
5476 for (x = 0; x < cur_wid; x++)
5478 cave_type *c_ptr = &cave[y][x];
5480 s16b this_o_idx, next_o_idx = 0;
5482 /* Scan all objects in the grid */
5483 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5487 /* Acquire object */
5488 o_ptr = &o_list[this_o_idx];
5490 /* Acquire next object */
5491 next_o_idx = o_ptr->next_o_idx;
5493 /* Ignore non-artifacts */
5494 if (!artifact_p(o_ptr)) continue;
5496 /* Ignore known items */
5497 if (object_known_p(o_ptr)) continue;
5499 /* Note the artifact */
5500 okay[o_ptr->name1] = FALSE;
5505 /* Check the inventory and equipment */
5506 for (i = 0; i < INVEN_TOTAL; i++)
5508 object_type *o_ptr = &inventory[i];
5510 /* Ignore non-objects */
5511 if (!o_ptr->k_idx) continue;
5513 /* Ignore non-artifacts */
5514 if (!artifact_p(o_ptr)) continue;
5516 /* Ignore known items */
5517 if (object_known_p(o_ptr)) continue;
5519 /* Note the artifact */
5520 okay[o_ptr->name1] = FALSE;
5523 for (k = 0; k < max_a_idx; k++)
5525 if (okay[k]) who[n++] = k;
5528 /* Select the sort method */
5529 ang_sort_comp = ang_sort_art_comp;
5530 ang_sort_swap = ang_sort_art_swap;
5532 /* Sort the array by dungeon depth of monsters */
5533 ang_sort(who, &why, n);
5535 /* Scan the artifacts */
5536 for (k = 0; k < n; k++)
5538 artifact_type *a_ptr = &a_info[who[k]];
5542 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5544 strcpy(base_name, "Unknown Artifact");
5548 /* Obtain the base object type */
5549 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5557 /* Get local object */
5560 /* Create fake object */
5561 object_prep(q_ptr, z);
5563 /* Make it an artifact */
5564 q_ptr->name1 = (byte)who[k];
5566 /* Describe the artifact */
5567 object_desc_store(base_name, q_ptr, FALSE, 0);
5570 /* Hack -- Build the artifact name */
5572 fprintf(fff, " %s\n", base_name);
5574 fprintf(fff, " The %s\n", base_name);
5579 /* Free the "who" array */
5580 C_KILL(who, max_r_idx, s16b);
5582 /* Free the "okay" array */
5583 C_KILL(okay, max_a_idx, bool);
5585 /* Close the file */
5588 /* Display the file contents */
5590 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5592 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5596 /* Remove the file */
5602 * Display known uniques
5604 static void do_cmd_knowledge_uniques(void)
5612 char file_name[1024];
5614 /* Open a new file */
5615 fff = my_fopen_temp(file_name, 1024);
5619 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5621 msg_format("Failed to create temporary file %s.", file_name);
5627 /* Allocate the "who" array */
5628 C_MAKE(who, max_r_idx, s16b);
5630 /* Scan the monsters */
5631 for (i = 1; i < max_r_idx; i++)
5633 monster_race *r_ptr = &r_info[i];
5635 /* Use that monster */
5636 if (r_ptr->name) who[n++] = i;
5639 /* Select the sort method */
5640 ang_sort_comp = ang_sort_comp_hook;
5641 ang_sort_swap = ang_sort_swap_hook;
5643 /* Sort the array by dungeon depth of monsters */
5644 ang_sort(who, &why, n);
5646 /* Scan the monster races */
5647 for (k = 0; k < n; k++)
5649 monster_race *r_ptr = &r_info[who[k]];
5651 /* Only print Uniques */
5652 if (r_ptr->flags1 & (RF1_UNIQUE))
5654 bool dead = (r_ptr->max_num == 0);
5658 /* Only display "known" uniques */
5659 if (dead || cheat_know || r_ptr->r_sights)
5661 /* Print a message */
5663 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5664 (r_name + r_ptr->name));
5666 fprintf(fff, " %s is alive\n",
5667 (r_name + r_ptr->name));
5674 /* Free the "who" array */
5675 C_KILL(who, max_r_idx, s16b);
5677 /* Close the file */
5680 /* Display the file contents */
5682 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5684 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5688 /* Remove the file */
5694 * Display dead uniques
5696 static void do_cmd_knowledge_uniques_dead(void)
5704 char file_name[1024];
5706 /* Open a new file */
5707 fff = my_fopen_temp(file_name, 1024);
5711 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5713 msg_format("Failed to create temporary file %s.", file_name);
5719 /* Allocate the "who" array */
5720 C_MAKE(who, max_r_idx, s16b);
5722 /* Scan the monsters */
5723 for (i = 1; i < max_r_idx; i++)
5725 monster_race *r_ptr = &r_info[i];
5727 /* Use that monster */
5728 if (r_ptr->name) who[n++] = i;
5731 /* Select the sort method */
5732 ang_sort_comp = ang_sort_comp_hook;
5733 ang_sort_swap = ang_sort_swap_hook;
5735 /* Sort the array by dungeon depth of monsters */
5736 ang_sort(who, &why, n);
5738 /* Scan the monster races */
5739 for (k = 0; k < n; k++)
5741 monster_race *r_ptr = &r_info[who[k]];
5743 /* Only print Uniques */
5744 if (r_ptr->flags1 & (RF1_UNIQUE))
5746 bool dead = (r_ptr->max_num == 0);
5748 if (!dead) continue;
5750 /* Only display "known" uniques */
5751 if (dead || cheat_know || r_ptr->r_sights)
5753 /* Print a message */
5755 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5756 (r_name + r_ptr->name));
5758 fprintf(fff, " %s is dead\n",
5759 (r_name + r_ptr->name));
5766 /* Free the "who" array */
5767 C_KILL(who, max_r_idx, s16b);
5769 /* Close the file */
5772 /* Display the file contents */
5774 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5776 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5780 /* Remove the file */
5786 * Display weapon-exp
5788 static void do_cmd_knowledge_weapon_exp(void)
5790 int i,j, num, shougou;
5794 char file_name[1024];
5797 /* Open a new file */
5798 fff = my_fopen_temp(file_name, 1024);
5801 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5803 msg_format("Failed to create temporary file %s.", file_name);
5809 for(i = 0; i < 5; i++)
5811 for (num = 0; num < 64; num++)
5813 for (j = 0; j < max_k_idx; j++)
5815 object_kind *k_ptr = &k_info[j];
5817 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
5819 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
5821 if(weapon_exp[4-i][num]<4000) shougou=0;
5822 else if(weapon_exp[4-i][num]<6000) shougou=1;
5823 else if(weapon_exp[4-i][num]<7000) shougou=2;
5824 else if(weapon_exp[4-i][num]<8000) shougou=3;
5827 fprintf(fff,"%-25s ",tmp);
5828 if (weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
5829 else fprintf(fff," ");
5830 fprintf(fff,"%s",shougou_moji[shougou]);
5831 if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
5839 /* Close the file */
5842 /* Display the file contents */
5844 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
5846 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
5850 /* Remove the file */
5858 static void do_cmd_knowledge_spell_exp(void)
5865 char file_name[1024];
5867 /* Open a new file */
5868 fff = my_fopen_temp(file_name, 1024);
5871 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5873 msg_format("Failed to create temporary file %s.", file_name);
5879 if(p_ptr->realm1 != REALM_NONE)
5882 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
5884 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
5886 for (i = 0; i < 32; i++)
5888 if (!is_magic(p_ptr->realm1))
5890 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC - 1][i];
5894 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5896 if(s_ptr->slevel == 99) continue;
5897 if(spell_exp[i]<900) shougou=0;
5898 else if(spell_exp[i]<1200) shougou=1;
5899 else if(spell_exp[i]<1400) shougou=2;
5900 else if(spell_exp[i]<1600) shougou=3;
5902 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
5903 if (p_ptr->realm1 == REALM_HISSATSU)
5904 fprintf(fff,"[--]");
5907 if (shougou == 4) fprintf(fff,"!");
5908 else fprintf(fff," ");
5909 fprintf(fff,"%s",shougou_moji[shougou]);
5911 if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
5916 if(p_ptr->realm2 != REALM_NONE)
5918 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
5919 for (i = 0; i < 32; i++)
5921 if (!is_magic(p_ptr->realm1))
5923 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC - 1][i];
5927 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5929 if(s_ptr->slevel == 99) continue;
5931 if(spell_exp[i+32]<900) shougou=0;
5932 else if(spell_exp[i+32]<1200) shougou=1;
5933 else if(spell_exp[i+32]<1400) shougou=2;
5935 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
5936 if (shougou == 3) fprintf(fff,"!");
5937 else fprintf(fff," ");
5938 fprintf(fff,"%s",shougou_moji[shougou]);
5939 if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
5944 /* Close the file */
5947 /* Display the file contents */
5949 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
5951 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
5955 /* Remove the file */
5963 static void do_cmd_knowledge_skill_exp(void)
5969 char file_name[1024];
5971 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
5973 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
5976 /* Open a new file */
5977 fff = my_fopen_temp(file_name, 1024);
5980 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5982 msg_format("Failed to create temporary file %s.", file_name);
5988 for (i = 0; i < 3; i++)
5990 if(i == GINOU_RIDING)
5992 if(skill_exp[i]<500) shougou=0;
5993 else if(skill_exp[i]<2000) shougou=1;
5994 else if(skill_exp[i]<5000) shougou=2;
5995 else if(skill_exp[i]<8000) shougou=3;
6000 if(skill_exp[i]<4000) shougou=0;
6001 else if(skill_exp[i]<6000) shougou=1;
6002 else if(skill_exp[i]<7000) shougou=2;
6003 else if(skill_exp[i]<8000) shougou=3;
6006 fprintf(fff,"%-20s ",skill_name[i]);
6007 if (skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6008 else fprintf(fff," ");
6009 fprintf(fff,"%s",shougou_moji[shougou]);
6010 if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
6014 /* Close the file */
6017 /* Display the file contents */
6019 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6021 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6025 /* Remove the file */
6031 * Pluralize a monster name
6033 void plural_aux(char *Name)
6035 int NameLen = strlen(Name);
6037 if (strstr(Name, "Disembodied hand"))
6039 strcpy(Name, "Disembodied hands that strangled people");
6041 else if (strstr(Name, "Colour out of space"))
6043 strcpy(Name, "Colours out of space");
6045 else if (strstr(Name, "stairway to hell"))
6047 strcpy(Name, "stairways to hell");
6049 else if (strstr(Name, "Dweller on the threshold"))
6051 strcpy(Name, "Dwellers on the threshold");
6053 else if (strstr(Name, " of "))
6055 cptr aider = strstr(Name, " of ");
6066 if (dummy[i-1] == 's')
6068 strcpy(&(dummy[i]), "es");
6073 strcpy(&(dummy[i]), "s");
6076 strcpy(&(dummy[i+1]), aider);
6077 strcpy(Name, dummy);
6079 else if (strstr(Name, "coins"))
6082 strcpy(dummy, "piles of ");
6083 strcat(dummy, Name);
6084 strcpy(Name, dummy);
6087 else if (strstr(Name, "Manes"))
6091 else if (streq(&(Name[NameLen - 2]), "ey"))
6093 strcpy(&(Name[NameLen - 2]), "eys");
6095 else if (Name[NameLen - 1] == 'y')
6097 strcpy(&(Name[NameLen - 1]), "ies");
6099 else if (streq(&(Name[NameLen - 4]), "ouse"))
6101 strcpy(&(Name[NameLen - 4]), "ice");
6103 else if (streq(&(Name[NameLen - 2]), "us"))
6105 strcpy(&(Name[NameLen - 2]), "i");
6107 else if (streq(&(Name[NameLen - 6]), "kelman"))
6109 strcpy(&(Name[NameLen - 6]), "kelmen");
6111 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6113 strcpy(&(Name[NameLen - 8]), "wordsmen");
6115 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6117 strcpy(&(Name[NameLen - 7]), "oodsmen");
6119 else if (streq(&(Name[NameLen - 7]), "eastman"))
6121 strcpy(&(Name[NameLen - 7]), "eastmen");
6123 else if (streq(&(Name[NameLen - 8]), "izardman"))
6125 strcpy(&(Name[NameLen - 8]), "izardmen");
6127 else if (streq(&(Name[NameLen - 5]), "geist"))
6129 strcpy(&(Name[NameLen - 5]), "geister");
6131 else if (streq(&(Name[NameLen - 2]), "ex"))
6133 strcpy(&(Name[NameLen - 2]), "ices");
6135 else if (streq(&(Name[NameLen - 2]), "lf"))
6137 strcpy(&(Name[NameLen - 2]), "lves");
6139 else if (suffix(Name, "ch") ||
6140 suffix(Name, "sh") ||
6141 suffix(Name, "nx") ||
6142 suffix(Name, "s") ||
6145 strcpy(&(Name[NameLen]), "es");
6149 strcpy(&(Name[NameLen]), "s");
6154 * Display current pets
6156 static void do_cmd_knowledge_pets(void)
6160 monster_type *m_ptr;
6162 int show_upkeep = 0;
6163 char file_name[1024];
6166 /* Open a new file */
6167 fff = my_fopen_temp(file_name, 1024);
6170 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6172 msg_format("Failed to create temporary file %s.", file_name);
6178 /* Process the monsters (backwards) */
6179 for (i = m_max - 1; i >= 1; i--)
6181 monster_race *r_ptr;
6182 /* Access the monster */
6185 /* Ignore "dead" monsters */
6186 if (!m_ptr->r_idx) continue;
6187 r_ptr = &r_info[m_ptr->r_idx];
6189 /* Calculate "upkeep" for pets */
6194 monster_desc(pet_name, m_ptr, 0x88);
6195 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6196 if (p_ptr->riding == i)
6198 fprintf(fff, " ¾èÇÏÃæ");
6200 fprintf(fff, " Riding");
6206 show_upkeep = calculate_upkeep();
6208 fprintf(fff, "----------------------------------------------\n");
6210 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6211 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6213 fprintf(fff, " Total: %d pet%s.\n",
6214 t_friends, (t_friends == 1 ? "" : "s"));
6215 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6220 /* Close the file */
6223 /* Display the file contents */
6225 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6227 show_file(TRUE, file_name, "Current Pets", 0, 0);
6231 /* Remove the file */
6239 * Note that the player ghosts are ignored. XXX XXX XXX
6241 static void do_cmd_knowledge_kill_count(void)
6249 char file_name[1024];
6254 /* Open a new file */
6255 fff = my_fopen_temp(file_name, 1024);
6259 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6261 msg_format("Failed to create temporary file %s.", file_name);
6267 /* Allocate the "who" array */
6268 C_MAKE(who, max_r_idx, s16b);
6271 /* Monsters slain */
6274 for (kk = 1; kk < max_r_idx; kk++)
6276 monster_race *r_ptr = &r_info[kk];
6278 if (r_ptr->flags1 & (RF1_UNIQUE))
6280 bool dead = (r_ptr->max_num == 0);
6289 s16b This = r_ptr->r_pkills;
6300 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6302 fprintf(fff,"You have defeated no enemies yet.\n\n");
6305 else if (Total == 1)
6307 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6309 fprintf(fff,"You have defeated one enemy.\n\n");
6314 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6316 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6323 /* Scan the monsters */
6324 for (i = 1; i < max_r_idx; i++)
6326 monster_race *r_ptr = &r_info[i];
6328 /* Use that monster */
6329 if (r_ptr->name) who[n++] = i;
6332 /* Select the sort method */
6333 ang_sort_comp = ang_sort_comp_hook;
6334 ang_sort_swap = ang_sort_swap_hook;
6336 /* Sort the array by dungeon depth of monsters */
6337 ang_sort(who, &why, n);
6339 /* Scan the monster races */
6340 for (k = 0; k < n; k++)
6342 monster_race *r_ptr = &r_info[who[k]];
6344 if (r_ptr->flags1 & (RF1_UNIQUE))
6346 bool dead = (r_ptr->max_num == 0);
6350 /* Print a message */
6351 fprintf(fff, " %s\n",
6352 (r_name + r_ptr->name));
6358 s16b This = r_ptr->r_pkills;
6363 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6364 if(strchr("pt",r_ptr->d_char))
6365 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6367 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6371 if (strstr(r_name + r_ptr->name, "coins"))
6373 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6377 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6383 strcpy(ToPlural, (r_name + r_ptr->name));
6384 plural_aux(ToPlural);
6385 fprintf(fff, " %d %s\n", This, ToPlural);
6395 fprintf(fff,"----------------------------------------------\n");
6397 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6399 fprintf(fff," Total: %lu creature%s killed.\n",
6400 Total, (Total == 1 ? "" : "s"));
6404 /* Free the "who" array */
6405 C_KILL(who, max_r_idx, s16b);
6407 /* Close the file */
6410 /* Display the file contents */
6412 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6414 show_file(TRUE, file_name, "Kill Count", 0, 0);
6418 /* Remove the file */
6424 * Display known objects
6426 static void do_cmd_knowledge_objects(void)
6432 char o_name[MAX_NLEN];
6434 char file_name[1024];
6437 /* Open a new file */
6438 fff = my_fopen_temp(file_name, 1024);
6441 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6443 msg_format("Failed to create temporary file %s.", file_name);
6449 /* Scan the object kinds */
6450 for (k = 1; k < max_k_idx; k++)
6452 object_kind *k_ptr = &k_info[k];
6454 /* Hack -- skip artifacts */
6455 if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
6457 /* List known flavored objects */
6458 if (k_ptr->flavor && k_ptr->aware)
6461 object_type object_type_body;
6463 /* Get local object */
6464 i_ptr = &object_type_body;
6466 /* Create fake object */
6467 object_prep(i_ptr, k);
6469 /* Describe the object */
6470 object_desc_store(o_name, i_ptr, FALSE, 0);
6472 /* Print a message */
6473 fprintf(fff, " %s\n", o_name);
6477 /* Close the file */
6480 /* Display the file contents */
6482 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6484 show_file(TRUE, file_name, "Known Objects", 0, 0);
6488 /* Remove the file */
6494 * List virtues & status
6497 void do_cmd_knowledge_kubi(void)
6502 char file_name[1024];
6505 /* Open a new file */
6506 fff = my_fopen_temp(file_name, 1024);
6509 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6511 msg_format("Failed to create temporary file %s.", file_name);
6520 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6522 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6524 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6526 fprintf(fff, "List of wanted monsters\n");
6528 for (i = 0; i < MAX_KUBI; i++)
6530 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6531 if (kubi_r_idx[i] > 10000)
6533 fprintf(fff, "ºÑ\n");
6535 fprintf(fff, "done\n");
6538 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6542 /* Close the file */
6545 /* Display the file contents */
6547 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6549 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6553 /* Remove the file */
6558 * List virtues & status
6561 void do_cmd_knowledge_virtues(void)
6565 char file_name[1024];
6569 /* Open a new file */
6570 fff = my_fopen_temp(file_name, 1024);
6573 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6575 msg_format("Failed to create temporary file %s.", file_name);
6584 if (p_ptr->align > 150) disp_align = "ÂçÁ±";
6585 else if (p_ptr->align > 50) disp_align = "ÃæÁ±";
6586 else if (p_ptr->align > 10) disp_align = "¾®Á±";
6587 else if (p_ptr->align > -11) disp_align = "ÃæΩ";
6588 else if (p_ptr->align > -51) disp_align = "¾®°";
6589 else if (p_ptr->align > -151) disp_align = "Ãæ°";
6590 else disp_align = "Âç°";
6591 fprintf(fff, "¸½ºß¤Î°À : %s\n", disp_align);
6594 if (p_ptr->align > 150) disp_align = "lawful";
6595 else if (p_ptr->align > 50) disp_align = "good";
6596 else if (p_ptr->align > 10) disp_align = "neutral good";
6597 else if (p_ptr->align > -11) disp_align = "neutral";
6598 else if (p_ptr->align > -51) disp_align = "neutral evil";
6599 else if (p_ptr->align > -151) disp_align = "evil";
6600 else disp_align = "chaotic";
6601 fprintf(fff, "Your alighnment : %s\n", disp_align);
6607 /* Close the file */
6610 /* Display the file contents */
6612 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6614 show_file(TRUE, file_name, "Virtues", 0, 0);
6618 /* Remove the file */
6626 void do_cmd_knowledge_dungeon(void)
6630 char file_name[1024];
6634 /* Open a new file */
6635 fff = my_fopen_temp(file_name, 1024);
6638 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6640 msg_format("Failed to create temporary file %s.", file_name);
6648 for (i = 1; i < max_d_idx; i++)
6652 if (!d_info[i].maxdepth) continue;
6653 if (!max_dlv[i]) continue;
6654 if (d_info[i].final_guardian)
6656 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6658 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6660 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6662 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6667 /* Close the file */
6670 /* Display the file contents */
6672 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6674 show_file(TRUE, file_name, "Dungeon", 0, 0);
6678 /* Remove the file */
6683 * List virtues & status
6686 static void do_cmd_knowledge_stat(void)
6690 char file_name[1024];
6693 /* Open a new file */
6694 fff = my_fopen_temp(file_name, 1024);
6697 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6699 msg_format("Failed to create temporary file %s.", file_name);
6707 percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
6708 (2 * p_ptr->hitdie +
6709 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6712 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6713 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6714 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6716 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6717 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6718 fprintf(fff, "Limits of maximum stats\n\n");
6720 for (v_nr = 0; v_nr < 6; v_nr++)
6722 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);
6723 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6729 /* Close the file */
6732 /* Display the file contents */
6734 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6736 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6740 /* Remove the file */
6745 * Print quest status of all active quests
6747 static void do_cmd_knowledge_quests(void)
6750 char file_name[1024];
6752 char rand_tmp_str[120] = "\0";
6754 monster_race *r_ptr;
6756 int rand_level = 100;
6759 /* Open a new file */
6760 fff = my_fopen_temp(file_name, 1024);
6763 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6765 msg_format("Failed to create temporary file %s.", file_name);
6772 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6774 fprintf(fff, "< Current Quest >\n");
6777 for (i = 1; i < max_quests; i++)
6779 /* No info from "silent" quests */
6780 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6782 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6787 /* Clear the text */
6788 for (j = 0; j < 10; j++)
6790 quest_text[j][0] = '\0';
6793 quest_text_line = 0;
6797 /* Set the quest number temporary */
6798 old_quest = p_ptr->inside_quest;
6799 p_ptr->inside_quest = i;
6801 /* Get the quest text */
6802 init_flags = INIT_SHOW_TEXT;
6804 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6806 /* Reset the old quest number */
6807 p_ptr->inside_quest = old_quest;
6809 if (quest[i].type != QUEST_TYPE_RANDOM)
6811 char note[80] = "\0";
6813 if (quest[i].status == QUEST_STATUS_TAKEN)
6815 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6817 r_ptr = &r_info[quest[i].r_idx];
6818 strcpy(name, r_name + r_ptr->name);
6819 if (quest[i].max_num > 1)
6822 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6825 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
6830 sprintf(note," - %s¤òÅݤ¹¡£",name);
6832 sprintf(note," - kill %s.",name);
6835 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
6838 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
6840 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
6843 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
6845 strcpy(name, a_name + a_info[quest[i].k_idx].name);
6847 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
6849 sprintf(note," - Find out %s.", name);
6852 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
6854 sprintf(note," - õº÷¤¹¤ë¡£");
6856 sprintf(note," - Search.");
6858 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
6860 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
6862 sprintf(note," - Kill all monsters.");
6866 /* Print the quest info */
6868 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
6870 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
6873 quest[i].name, quest[i].level, note);
6875 fprintf(fff, tmp_str);
6877 if (quest[i].status == QUEST_STATUS_COMPLETED)
6880 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
6882 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
6886 fprintf(fff, tmp_str);
6892 while (quest_text[j][0] && j < 10)
6894 fprintf(fff, " %s\n", quest_text[j]);
6899 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
6900 (quest[i].level < rand_level))
6903 rand_level = quest[i].level;
6905 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6907 /* Print the quest info */
6908 r_ptr = &r_info[quest[i].r_idx];
6909 strcpy(name, r_name + r_ptr->name);
6911 if (quest[i].max_num > 1)
6914 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
6915 quest[i].name, quest[i].level,
6916 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6920 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6921 quest[i].name, quest[i].level,
6922 quest[i].max_num, name, quest[i].cur_num);
6929 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
6931 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
6934 quest[i].name, quest[i].level, name);
6941 /* Print the current random quest */
6942 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
6945 if (!total) fprintf(fff, "¤Ê¤·\n");
6947 if (!total) fprintf(fff, "Nothing.\n");
6951 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
6953 fprintf(fff, "\n< Completed Quest >\n");
6956 for (i = 1; i < max_quests; i++)
6958 /* No info from "silent" quests */
6959 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6961 if (quest[i].status == QUEST_STATUS_FINISHED)
6967 if (i < MIN_RANDOM_QUEST)
6969 /* Set the quest number temporary */
6970 old_quest = p_ptr->inside_quest;
6971 p_ptr->inside_quest = i;
6974 init_flags = INIT_ASSIGN;
6976 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6978 /* Reset the old quest number */
6979 p_ptr->inside_quest = old_quest;
6982 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
6984 /* Print the quest info */
6986 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
6988 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
6991 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
6995 /* Print the quest info */
6997 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
6999 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7002 quest[i].name, quest[i].level, quest[i].complev);
7005 fprintf(fff, tmp_str);
7009 if (!total) fprintf(fff, "¤Ê¤·\n");
7011 if (!total) fprintf(fff, "Nothing.\n");
7015 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7017 fprintf(fff, "\n< Failed Quest >\n");
7020 for (i = 1; i < max_quests; i++)
7022 /* No info from "silent" quests */
7023 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7025 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7031 if (i < MIN_RANDOM_QUEST)
7033 /* Set the quest number temporary */
7034 old_quest = p_ptr->inside_quest;
7035 p_ptr->inside_quest = i;
7037 /* Get the quest text */
7038 init_flags = INIT_ASSIGN;
7040 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7042 /* Reset the old quest number */
7043 p_ptr->inside_quest = old_quest;
7046 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7048 /* Print the quest info */
7050 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7052 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7055 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7059 /* Print the quest info */
7061 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7063 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7066 quest[i].name, quest[i].level, quest[i].complev);
7068 fprintf(fff, tmp_str);
7072 if (!total) fprintf(fff, "¤Ê¤·\n");
7074 if (!total) fprintf(fff, "Nothing.\n");
7079 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7081 fprintf(fff, "\n< Remaining Random Quest >\n");
7084 for (i = 1; i < max_quests; i++)
7086 /* No info from "silent" quests */
7087 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7089 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7093 /* Print the quest info */
7095 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7097 sprintf(tmp_str, "%s (%d, %s)\n",
7100 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7101 fprintf(fff, tmp_str);
7105 if (!total) fprintf(fff, "¤Ê¤·\n");
7107 if (!total) fprintf(fff, "Nothing.\n");
7111 /* Close the file */
7114 /* Display the file contents */
7116 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7118 show_file(TRUE, file_name, "Quest status", 0, 0);
7122 /* Remove the file */
7132 void do_cmd_knowledge_home(void)
7137 char file_name[1024];
7139 char o_name[MAX_NLEN];
7142 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7144 /* Open a new file */
7145 fff = my_fopen_temp(file_name, 1024);
7148 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7150 msg_format("Failed to create temporary file %s.", file_name);
7158 /* Print all homes in the different towns */
7159 st_ptr = &town[1].store[STORE_HOME];
7161 /* Home -- if anything there */
7162 if (st_ptr->stock_num)
7164 /* Header with name of the town */
7166 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7168 fprintf(fff, " [Home Inventory]\n");
7172 /* Dump all available items */
7173 for (i = 0; i < st_ptr->stock_num; i++)
7176 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7177 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7178 if (strlen(o_name) <= 80-3)
7180 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7186 for (n = 0, t = o_name; n < 80-3; n++, t++)
7187 if(iskanji(*t)) {t++; n++;}
7188 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7190 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7191 fprintf(fff, " %.77s\n", o_name+n);
7194 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7195 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7200 /* Add an empty line */
7201 fprintf(fff, "\n\n");
7205 /* Close the file */
7208 /* Display the file contents */
7210 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7212 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7216 /* Remove the file */
7222 * Check the status of "autopick"
7224 static void do_cmd_knowledge_autopick(void)
7228 char file_name[1024];
7230 /* Open a new file */
7231 fff = my_fopen_temp(file_name, 1024);
7236 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7238 msg_format("Failed to create temporary file %s.", file_name);
7247 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7249 fprintf(fff, "No preference for auto picker/destroyer.");
7255 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7257 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7261 for (k = 0; k < max_autopick; k++)
7263 if (!(autopick_action[k] & DO_AUTOPICK))
7266 fprintf(fff, " [ÊüÃÖ]");
7268 fprintf(fff, " [Leave]");
7271 else if ((autopick_action[k] & DO_AUTODESTROY))
7274 fprintf(fff, " [Ç˲õ]");
7276 fprintf(fff, " [Destroy]");
7282 fprintf(fff, " [½¦¤¦]");
7284 fprintf(fff, " [Pickup]");
7288 fprintf(fff, " %s", autopick_name[k]);
7289 if(autopick_insc[k] != NULL)
7290 fprintf(fff, " {%s}", autopick_insc[k]);
7293 /* Close the file */
7295 /* Display the file contents */
7297 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7299 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7302 /* Remove the file */
7309 * Interact with "knowledge"
7311 void do_cmd_knowledge(void)
7314 /* File type is "TEXT" */
7315 FILE_TYPE(FILE_TYPE_TEXT);
7316 /* Save the screen */
7318 /* Interact until done */
7323 /* Ask for a choice */
7325 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7326 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7328 prt(format("page %d/2", (p+1)), 2, 65);
7329 prt("Display current knowledge", 3, 0);
7332 /* Give some choices */
7335 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7336 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7337 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7338 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7339 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7340 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7341 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7342 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7343 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7345 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7346 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7347 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7348 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7349 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7350 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7351 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7352 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7353 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7357 prt("(1) Display known artifacts", 6, 5);
7358 prt("(2) Display known objects", 7, 5);
7359 prt("(3) Display remaining uniques", 8, 5);
7360 prt("(4) Display dead uniques", 9, 5);
7361 prt("(5) Display kill count", 10, 5);
7362 prt("(6) Display wanted monsters", 11, 5);
7363 prt("(7) Display current pets", 12, 5);
7364 prt("(8) Display home inventory", 13, 5);
7365 prt("(9) Display *identified* equip.", 14, 5);
7367 prt("(a) Display about yourself", 6, 5);
7368 prt("(b) Display mutations", 7, 5);
7369 prt("(c) Display weapon proficiency", 8, 5);
7370 prt("(d) Display spell proficiency", 9, 5);
7371 prt("(e) Display misc. proficiency", 10, 5);
7372 prt("(f) Display virtues", 11, 5);
7373 prt("(g) Display dungeons", 12, 5);
7374 prt("(h) Display current quests", 13, 5);
7375 prt("(i) Display auto pick/destroy", 14, 5);
7380 prt("-³¤¯-", 16, 8);
7381 prt("ESC) È´¤±¤ë", 21, 1);
7382 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7383 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7384 prt("¥³¥Þ¥ó¥É:", 20, 0);
7386 prt("-more-", 16, 8);
7387 prt("ESC) Exit menu", 21, 1);
7388 prt("SPACE) Next page", 21, 30);
7389 /*prt("-) Previous page", 21, 60);*/
7390 prt("Command: ", 20, 0);
7396 if (i == ESCAPE) break;
7399 case ' ': /* Page change */
7403 case '1': /* Artifacts */
7404 do_cmd_knowledge_artifacts();
7406 case '2': /* Objects */
7407 do_cmd_knowledge_objects();
7409 case '3': /* Uniques */
7410 do_cmd_knowledge_uniques();
7412 case '4': /* Uniques */
7413 do_cmd_knowledge_uniques_dead();
7415 case '5': /* Kill count */
7416 do_cmd_knowledge_kill_count();
7418 case '6': /* wanted */
7419 do_cmd_knowledge_kubi();
7421 case '7': /* Pets */
7422 do_cmd_knowledge_pets();
7424 case '8': /* Home */
7425 do_cmd_knowledge_home();
7427 case '9': /* Resist list */
7428 do_cmd_knowledge_inven();
7431 case 'a': /* Max stat */
7432 do_cmd_knowledge_stat();
7434 case 'b': /* Mutations */
7435 do_cmd_knowledge_mutations();
7437 case 'c': /* weapon-exp */
7438 do_cmd_knowledge_weapon_exp();
7440 case 'd': /* spell-exp */
7441 do_cmd_knowledge_spell_exp();
7443 case 'e': /* skill-exp */
7444 do_cmd_knowledge_skill_exp();
7446 case 'f': /* Virtues */
7447 do_cmd_knowledge_virtues();
7449 case 'g': /* Dungeon */
7450 do_cmd_knowledge_dungeon();
7452 case 'h': /* Quests */
7453 do_cmd_knowledge_quests();
7455 case 'i': /* Autopick */
7456 do_cmd_knowledge_autopick();
7458 default: /* Unknown option */
7461 /* Flush messages */
7464 /* Restore the screen */
7470 * Check on the status of an active quest
7472 void do_cmd_checkquest(void)
7474 /* File type is "TEXT" */
7475 FILE_TYPE(FILE_TYPE_TEXT);
7477 /* Save the screen */
7481 do_cmd_knowledge_quests();
7483 /* Restore the screen */
7489 * Display the time and date
7491 void do_cmd_time(void)
7493 int day, hour, min, full, start, end, num;
7500 s32b len = 20L * TOWN_DAWN;
7501 s32b tick = turn % len + len / 4;
7503 if ((p_ptr->prace == RACE_VAMPIRE) ||
7504 (p_ptr->prace == RACE_SKELETON) ||
7505 (p_ptr->prace == RACE_ZOMBIE) ||
7506 (p_ptr->prace == RACE_SPECTRE))
7507 day = (turn - (15L * TOWN_DAWN))/ len + 1;
7509 day = (turn + (5L * TOWN_DAWN))/ len + 1;
7510 hour = (24 * tick / len) % 24;
7511 min = (1440 * tick / len) % 60;
7512 full = hour * 100 + min;
7520 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7522 strcpy(desc, "It is a strange time.");
7528 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7530 msg_format("This is day %d. The time is %d:%02d %s.",
7533 day, (hour % 12 == 0) ? 12 : (hour % 12),
7534 min, (hour < 12) ? "AM" : "PM");
7537 if (!rand_int(10) || p_ptr->image)
7540 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7542 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7549 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7551 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7556 /* Open this file */
7557 fff = my_fopen(buf, "rt");
7562 /* Find this time */
7563 while (!my_fgets(fff, buf, 1024))
7565 /* Ignore comments */
7566 if (!buf[0] || (buf[0] == '#')) continue;
7568 /* Ignore invalid lines */
7569 if (buf[1] != ':') continue;
7571 /* Process 'Start' */
7574 /* Extract the starting time */
7575 start = atoi(buf + 2);
7577 /* Assume valid for an hour */
7587 /* Extract the ending time */
7588 end = atoi(buf + 2);
7594 /* Ignore incorrect range */
7595 if ((start > full) || (full > end)) continue;
7597 /* Process 'Description' */
7602 /* Apply the randomizer */
7603 if (!rand_int(num)) strcpy(desc, buf + 2);
7613 /* Close the file */