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 tmp_fff = my_fopen(tmp_file, "r");
121 orig_fff = my_fopen(orig_file, "w");
123 while (!my_fgets(tmp_fff, buf, 1024))
124 fprintf(orig_fff, "%s\n", buf);
135 * Open file to append auto dump.
137 static FILE *open_auto_dump(cptr buf, cptr mark, int *line)
141 char header_mark_str[80];
146 sprintf(header_mark_str, auto_dump_header, mark);
148 /* Remove old macro dumps */
149 remove_auto_dump(buf, mark);
151 /* Append to the file */
152 fff = my_fopen(buf, "a");
157 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
159 msg_format("Failed to open %s.", buf);
170 fprintf(fff, "%s\n", header_mark_str);
173 fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
174 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
176 fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
177 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
185 * Append foot part and close auto dump.
187 static void close_auto_dump(FILE *fff, cptr mark, int line_num)
189 char footer_mark_str[80];
191 sprintf(footer_mark_str, auto_dump_footer, mark);
195 fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
196 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
198 fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
199 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
203 fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
215 * Take note to the dialy.
218 errr do_cmd_write_nikki(int type, int num, cptr note)
224 cptr note_level = "";
225 bool do_level = TRUE;
227 s32b len = 20L * TOWN_DAWN;
228 s32b tick = turn % len + len / 4;
230 static bool disable_nikki = FALSE;
232 if (disable_nikki) return(-1);
234 if ((p_ptr->prace == RACE_VAMPIRE) ||
235 (p_ptr->prace == RACE_SKELETON) ||
236 (p_ptr->prace == RACE_ZOMBIE) ||
237 (p_ptr->prace == RACE_SPECTRE))
238 day = (turn - (15L * TOWN_DAWN))/ len + 1;
240 day = (turn + (5L * TOWN_DAWN))/ len + 1;
242 hour = (24 * tick / len) % 24;
243 min = (1440 * tick / len) % 60;
245 if (type == NIKKI_FIX_QUEST_C ||
246 type == NIKKI_FIX_QUEST_F ||
247 type == NIKKI_RAND_QUEST_C ||
248 type == NIKKI_RAND_QUEST_F ||
249 type == NIKKI_TO_QUEST)
253 old_quest = p_ptr->inside_quest;
254 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
256 /* Get the quest text */
257 init_flags = INIT_ASSIGN;
259 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
261 /* Reset the old quest number */
262 p_ptr->inside_quest = old_quest;
266 sprintf(file_name,"playrecord-%s.txt",savefile_base);
268 /* different filne name to avoid mixing */
269 sprintf(file_name,"playrec-%s.txt",savefile_base);
272 /* Hack -- drop permissions */
275 /* Build the filename */
276 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
278 /* File type is "TEXT" */
279 FILE_TYPE(FILE_TYPE_TEXT);
281 fff = my_fopen(buf, "a");
286 /* Hack -- grab permissions */
289 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
291 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
300 if (p_ptr->inside_arena)
302 note_level = "¥¢¥ê¡¼¥Ê:";
304 note_level = "Arane:";
308 note_level = "ÃϾå:";
310 note_level = "Surface:";
312 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)))
314 note_level = "¥¯¥¨¥¹¥È:";
316 note_level = "Quest:";
320 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
322 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
331 fprintf(fff, "%dÆüÌÜ\n",day);
333 fprintf(fff, "Day %d\n",day);
342 fprintf(fff, "%s\n",note);
346 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
352 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
354 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
361 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
363 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
367 case NIKKI_FIX_QUEST_C:
369 if (quest[num].flags & QUEST_FLAG_SILENT) break;
371 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
373 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
377 case NIKKI_FIX_QUEST_F:
379 if (quest[num].flags & QUEST_FLAG_SILENT) break;
381 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
383 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
387 case NIKKI_RAND_QUEST_C:
390 strcpy(name, r_name+r_info[quest[num].r_idx].name);
392 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
394 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
398 case NIKKI_RAND_QUEST_F:
401 strcpy(name, r_name+r_info[quest[num].r_idx].name);
403 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
405 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
409 case NIKKI_MAXDEAPTH:
412 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
414 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);
421 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
423 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);
430 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
441 if (!(dun_level+num)) to = "ÃϾå";
442 else to = format("%d³¬", dun_level+num);
444 if (!(dun_level+num)) to = "the surfice";
445 else to = format("level %d", dun_level+num);
450 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
452 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
460 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
462 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);
466 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
468 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
474 if (quest[num].flags & QUEST_FLAG_SILENT) break;
476 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
478 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
493 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)))
504 if (!(dun_level+num)) to = "ÃϾå";
505 else to = format("%d³¬", dun_level+num);
507 if (!(dun_level+num)) to = "surface";
508 else to = format("level %d", dun_level+num);
513 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
515 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
522 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
524 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
531 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
533 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
540 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
542 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);
544 if (num == MAX_ARENA_MONS)
547 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
549 fprintf(fff, " win all fight to become a Chanpion.\n");
558 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
560 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
575 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
577 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
581 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
583 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
590 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
592 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
596 case NIKKI_GAMESTART:
598 time_t ct = time((time_t*)0);
602 fprintf(fff, "%s %s",note, ctime(&ct));
605 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
608 case NIKKI_NAMED_PET:
610 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
615 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
617 fprintf(fff, "decide to travel together with %s.\n", note);
622 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
624 fprintf(fff, "unname %s.\n", note);
629 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
631 fprintf(fff, "dismiss %s.\n", note);
636 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
638 fprintf(fff, "%s die.\n", note);
643 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
645 fprintf(fff, "move to other map leaving %s behind.\n", note);
650 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
652 fprintf(fff, "lose sight of %s.\n", note);
657 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
659 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
664 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
666 fprintf(fff, "%s is crushed by falling rocks.\n", note);
681 /* Hack -- grab permissions */
684 if (do_level) write_level = FALSE;
690 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
692 static void do_cmd_disp_nikki(void)
694 char nikki_title[256];
699 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
700 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
711 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
712 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
713 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
714 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
719 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
728 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
730 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
731 "Attack is the best form of defence.",
733 "An unexpected windfall",
734 "A drowning man will catch at a straw",
735 "Don't count your chickens before they are hatched.",
736 "It is no use crying over spilt milk.",
737 "Seeing is believing.",
738 "Strike the iron while it is hot.",
739 "I don't care what follows.",
740 "To dig a well to put out a house on fire.",
741 "Tomorrow is another day.",
742 "Easy come, easy go.",
743 "The more haste, the less speed.",
744 "Where there is life, there is hope.",
745 "There is no royal road to *WINNER*.",
746 "Danger past, God forgotten.",
747 "The best thing to do now is to run away.",
748 "Life is but an empty dream.",
749 "Dead men tell no tales.",
750 "A book that remains shut is but a block.",
751 "Misfortunes never come singly.",
752 "A little knowledge is a dangerous thing.",
753 "History repeats itself.",
754 "*WINNER* was not built in a day.",
755 "Ignorance is bliss.",
756 "To lose is to win?",
757 "No medicine can cure folly.",
758 "All good things come to an end.",
759 "M$ Empire strikes back.",
760 "To see is to believe",
762 "Quest of The World's Greatest Brain"};
765 sprintf(file_name,"playrecord-%s.txt",savefile_base);
767 sprintf(file_name,"playrec-%s.txt",savefile_base);
770 /* Hack -- drop permissions */
773 /* Build the filename */
774 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
776 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
777 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
778 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
779 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
780 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
783 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
784 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
786 sprintf(nikki_title, "Legend of %s %s '%s'",
787 ap_ptr->title, player_name, tmp);
790 /* Display the file contents */
791 show_file(FALSE, buf, nikki_title, -1, 0);
793 /* Hack -- grab permissions */
797 static void do_cmd_bunshou(void)
800 char bunshou[80] = "\0";
803 if (get_string("ÆâÍÆ: ", tmp, 79))
805 if (get_string("diary note: ", tmp, 79))
808 strcpy(bunshou, tmp);
810 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
814 static void do_cmd_last_get(void)
819 if (record_o_name[0] == '\0') return;
822 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
824 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
826 if (!get_check(buf)) return;
831 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
833 sprintf(buf,"descover %s.", record_o_name);
835 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
839 static void do_cmd_erase_nikki(void)
846 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
848 if (!get_check("Do you really want to delete all your record? ")) return;
852 sprintf(file_name,"playrecord-%s.txt",savefile_base);
854 sprintf(file_name,"playrec-%s.txt",savefile_base);
857 /* Hack -- drop permissions */
860 /* Build the filename */
861 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
863 /* Remove the file */
866 fff = my_fopen(buf, "w");
870 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
872 msg_format("deleted record.");
876 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
878 msg_format("failed to delete %s.", buf);
883 /* Hack -- grab permissions */
890 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
896 void do_cmd_nikki(void)
900 /* File type is "TEXT" */
901 FILE_TYPE(FILE_TYPE_TEXT);
903 /* Save the screen */
906 /* Interact until done */
912 /* Ask for a choice */
914 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
916 prt("[ Play Record ]", 2, 0);
920 /* Give some choices */
922 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
923 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
924 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
925 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
927 prt("(1) Display your record", 4, 5);
928 prt("(2) Add record", 5, 5);
929 prt("(3) Record item you last get/identify", 6, 5);
930 prt("(4) Delete your record", 7, 5);
936 prt("¥³¥Þ¥ó¥É:", 18, 0);
938 prt("Command: ", 18, 0);
946 if (i == ESCAPE) break;
960 do_cmd_erase_nikki();
967 default: /* Unknown option */
975 /* Restore the screen */
980 * Hack -- redraw the screen
982 * This command performs various low level updates, clears all the "extra"
983 * windows, does a total redraw of the main window, and requests all of the
984 * interesting updates and redraws that I can think of.
986 * This command is also used to "instantiate" the results of the user
987 * selecting various things, such as graphics mode, so it must call
988 * the "TERM_XTRA_REACT" hook before redrawing the windows.
990 void do_cmd_redraw(void)
997 /* Hack -- react to changes */
998 Term_xtra(TERM_XTRA_REACT, 0);
1001 /* Combine and Reorder the pack (later) */
1002 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1006 p_ptr->update |= (PU_TORCH);
1009 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1011 /* Forget lite/view */
1012 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1014 /* Update lite/view */
1015 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1017 /* Update monsters */
1018 p_ptr->update |= (PU_MONSTERS);
1020 /* Redraw everything */
1021 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1024 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1027 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1031 /* Hack -- update */
1034 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1037 /* Redraw every window */
1038 for (j = 0; j < 8; j++)
1041 if (!angband_term[j]) continue;
1044 Term_activate(angband_term[j]);
1059 * Hack -- change name
1061 void do_cmd_change_name(void)
1070 /* Save the screen */
1078 /* Display the player */
1079 display_player(mode);
1084 display_player(mode);
1089 Term_putstr(2, 23, -1, TERM_WHITE,
1090 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1092 Term_putstr(2, 23, -1, TERM_WHITE,
1093 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1101 if (c == ESCAPE) break;
1112 sprintf(tmp, "%s.txt", player_base);
1114 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1116 if (get_string("File name: ", tmp, 80))
1120 if (tmp[0] && (tmp[0] != ' '))
1122 file_character(tmp, TRUE);
1139 /* Flush messages */
1143 /* Restore the screen */
1146 /* Redraw everything */
1147 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1154 * Recall the most recent message
1156 void do_cmd_message_one(void)
1158 /* Recall one message XXX XXX XXX */
1159 prt(format("> %s", message_str(0)), 0, 0);
1164 * Show previous messages to the user -BEN-
1166 * The screen format uses line 0 and 23 for headers and prompts,
1167 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1169 * This command shows you which commands you are viewing, and allows
1170 * you to "search" for strings in the recall.
1172 * Note that messages may be longer than 80 characters, but they are
1173 * displayed using "infinite" length, with a special sub-command to
1174 * "slide" the virtual display to the left or right.
1176 * Attempt to only hilite the matching portions of the string.
1178 void do_cmd_messages(int num_now)
1194 /* Total messages */
1197 /* Start on first message */
1200 /* Start at leftmost edge */
1203 /* Save the screen */
1206 /* Process requests until done */
1212 /* Dump up to 20 lines of messages */
1213 for (j = 0; (j < 20) && (i + j < n); j++)
1215 cptr msg = message_str(i+j);
1217 /* Apply horizontal scroll */
1218 msg = (strlen(msg) >= q) ? (msg + q) : "";
1220 /* Dump the messages, bottom to top */
1221 Term_putstr(0, 21-j, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1223 /* Hilite "shower" */
1228 /* Display matches */
1229 while ((str = strstr(str, shower)) != NULL)
1231 int len = strlen(shower);
1233 /* Display the match */
1234 Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
1242 /* Display header XXX XXX XXX */
1245 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1246 i, i+j-1, n, q), 0, 0);
1248 prt(format("Message Recall (%d-%d of %d), Offset %d",
1249 i, i+j-1, n, q), 0, 0);
1253 /* Display prompt (not very informative) */
1255 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", 23, 0);
1257 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0);
1264 /* Exit on Escape */
1265 if (k == ESCAPE) break;
1267 /* Hack -- Save the old index */
1270 /* Horizontal scroll */
1274 q = (q >= 40) ? (q - 40) : 0;
1280 /* Horizontal scroll */
1290 /* Hack -- handle show */
1295 prt("¶¯Ä´: ", 23, 0);
1297 prt("Show: ", 23, 0);
1301 /* Get a "shower" string, or continue */
1302 if (!askfor_aux(shower, 80)) continue;
1308 /* Hack -- handle find */
1315 prt("¸¡º÷: ", 23, 0);
1317 prt("Find: ", 23, 0);
1321 /* Get a "finder" string, or continue */
1322 if (!askfor_aux(finder, 80)) continue;
1325 strcpy(shower, finder);
1328 for (z = i + 1; z < n; z++)
1330 cptr msg = message_str(z);
1333 if (strstr(msg, finder))
1344 /* Recall 1 older message */
1345 if ((k == '8') || (k == '\n') || (k == '\r'))
1347 /* Go newer if legal */
1348 if (i + 1 < n) i += 1;
1351 /* Recall 10 older messages */
1354 /* Go older if legal */
1355 if (i + 10 < n) i += 10;
1358 /* Recall 20 older messages */
1359 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1361 /* Go older if legal */
1362 if (i + 20 < n) i += 20;
1365 /* Recall 20 newer messages */
1366 if ((k == 'n') || (k == KTRL('N')))
1368 /* Go newer (if able) */
1369 i = (i >= 20) ? (i - 20) : 0;
1372 /* Recall 10 newer messages */
1375 /* Go newer (if able) */
1376 i = (i >= 20) ? (i - 20) : 0;
1379 /* Recall 1 newer messages */
1382 /* Go newer (if able) */
1383 i = (i >= 1) ? (i - 1) : 0;
1386 /* Hack -- Error of some kind */
1390 /* Restore the screen */
1397 * Number of cheating options
1404 static option_type cheat_info[CHEAT_MAX] =
1406 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1408 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1410 "cheat_peek", "Peek into object creation" },
1414 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1416 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1418 "cheat_hear", "Peek into monster creation" },
1422 { &cheat_room, FALSE, 255, 0x04, 0x00,
1424 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1426 "cheat_room", "Peek into dungeon creation" },
1430 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1432 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1434 "cheat_xtra", "Peek into something else" },
1438 { &cheat_know, FALSE, 255, 0x10, 0x00,
1440 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1442 "cheat_know", "Know complete monster info" },
1446 { &cheat_live, FALSE, 255, 0x20, 0x00,
1448 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1450 "cheat_live", "Allow player to avoid death" }
1456 * Interact with some options for cheating
1458 static void do_cmd_options_cheat(cptr info)
1462 int i, k = 0, n = CHEAT_MAX;
1470 /* Interact with the player */
1473 /* Prompt XXX XXX XXX */
1475 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1477 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1483 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1484 prt(" << Ãí°Õ >>", 11, 0);
1485 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1486 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1487 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1489 /* Display the options */
1490 for (i = 0; i < n; i++)
1492 byte a = TERM_WHITE;
1494 /* Color current option */
1495 if (i == k) a = TERM_L_BLUE;
1497 /* Display the option text */
1498 sprintf(buf, "%-48s: %s (%s)",
1499 cheat_info[i].o_desc,
1501 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1503 (*cheat_info[i].o_var ? "yes" : "no "),
1506 cheat_info[i].o_text);
1507 c_prt(a, buf, i + 2, 0);
1510 /* Hilite current option */
1511 move_cursor(k + 2, 50);
1527 k = (n + k - 1) % n;
1546 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1548 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1550 noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1551 (*cheat_info[k].o_var) = TRUE;
1560 (*cheat_info[k].o_var) = FALSE;
1575 static option_type autosave_info[2] =
1577 { &autosave_l, FALSE, 255, 0x01, 0x00,
1579 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1581 "autosave_l", "Autosave when entering new levels" },
1585 { &autosave_t, FALSE, 255, 0x02, 0x00,
1587 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1589 "autosave_t", "Timed autosave" },
1595 static s16b toggle_frequency(s16b current)
1597 if (current == 0) return 50;
1598 if (current == 50) return 100;
1599 if (current == 100) return 250;
1600 if (current == 250) return 500;
1601 if (current == 500) return 1000;
1602 if (current == 1000) return 2500;
1603 if (current == 2500) return 5000;
1604 if (current == 5000) return 10000;
1605 if (current == 10000) return 25000;
1612 * Interact with some options for cheating
1614 static void do_cmd_options_autosave(cptr info)
1618 int i, k = 0, n = 2;
1626 /* Interact with the player */
1629 /* Prompt XXX XXX XXX */
1631 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1633 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1638 /* Display the options */
1639 for (i = 0; i < n; i++)
1641 byte a = TERM_WHITE;
1643 /* Color current option */
1644 if (i == k) a = TERM_L_BLUE;
1646 /* Display the option text */
1647 sprintf(buf, "%-48s: %s (%s)",
1648 autosave_info[i].o_desc,
1650 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1652 (*autosave_info[i].o_var ? "yes" : "no "),
1655 autosave_info[i].o_text);
1656 c_prt(a, buf, i + 2, 0);
1660 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1662 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1667 /* Hilite current option */
1668 move_cursor(k + 2, 50);
1684 k = (n + k - 1) % n;
1702 (*autosave_info[k].o_var) = TRUE;
1711 (*autosave_info[k].o_var) = FALSE;
1719 autosave_freq = toggle_frequency(autosave_freq);
1721 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1723 prt(format("Timed autosave frequency: every %d turns",
1726 autosave_freq), 5, 0);
1739 #define PAGE_AUTODESTROY 7
1742 * Interact with some options
1744 void do_cmd_options_aux(int page, cptr info)
1747 int i, k = 0, n = 0, l;
1752 /* Lookup the options */
1753 for (i = 0; i < 24; i++) opt[i] = 0;
1755 /* Scan the options */
1756 for (i = 0; option_info[i].o_desc; i++)
1758 /* Notice options on this "page" */
1759 if (option_info[i].o_page == page) opt[n++] = i;
1767 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
1769 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
1772 /* Interact with the player */
1775 /* Prompt XXX XXX XXX */
1777 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1779 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1784 /* Display the options */
1785 for (i = 0; i < n; i++)
1787 byte a = TERM_WHITE;
1789 /* Color current option */
1790 if (i == k) a = TERM_L_BLUE;
1792 /* Display the option text */
1793 sprintf(buf, "%-48s: %s (%.19s)",
1794 option_info[opt[i]].o_desc,
1796 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1798 (*option_info[opt[i]].o_var ? "yes" : "no "),
1801 option_info[opt[i]].o_text);
1802 if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
1803 else c_prt(a, buf, i + 2, 0);
1806 if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
1808 /* Hilite current option */
1809 move_cursor(k + 2 + l, 50);
1827 k = (n + k - 1) % n;
1848 (*option_info[opt[k]].o_var) = TRUE;
1859 (*option_info[opt[k]].o_var) = FALSE;
1867 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1882 * Modify the "window" options
1884 static void do_cmd_options_win(void)
1898 /* Memorize old flags */
1899 for (j = 0; j < 8; j++)
1901 /* Acquire current flags */
1902 old_flag[j] = window_flag[j];
1912 /* Prompt XXX XXX XXX */
1914 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1916 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1920 /* Display the windows */
1921 for (j = 0; j < 8; j++)
1923 byte a = TERM_WHITE;
1925 cptr s = angband_term_name[j];
1928 if (j == x) a = TERM_L_BLUE;
1930 /* Window name, staggered, centered */
1931 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1934 /* Display the options */
1935 for (i = 0; i < 16; i++)
1937 byte a = TERM_WHITE;
1939 cptr str = window_flag_desc[i];
1942 if (i == y) a = TERM_L_BLUE;
1946 if (!str) str = "(̤»ÈÍÑ)";
1948 if (!str) str = "(Unused option)";
1953 Term_putstr(0, i + 5, -1, a, str);
1955 /* Display the windows */
1956 for (j = 0; j < 8; j++)
1958 byte a = TERM_WHITE;
1963 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1966 if (window_flag[j] & (1L << i)) c = 'X';
1969 Term_putch(35 + j * 5, i + 5, a, c);
1974 Term_gotoxy(35 + x * 5, y + 5);
1992 for (j = 0; j < 8; j++)
1994 window_flag[j] &= ~(1L << y);
1998 for (i = 0; i < 16; i++)
2000 window_flag[x] &= ~(1L << i);
2013 window_flag[x] |= (1L << y);
2021 window_flag[x] &= ~(1L << y);
2027 d = get_keymap_dir(ch);
2029 x = (x + ddx[d] + 8) % 8;
2030 y = (y + ddy[d] + 16) % 16;
2037 /* Notice changes */
2038 for (j = 0; j < 8; j++)
2043 if (!angband_term[j]) continue;
2045 /* Ignore non-changes */
2046 if (window_flag[j] == old_flag[j]) continue;
2049 Term_activate(angband_term[j]);
2066 * Set or unset various options.
2068 * The user must use the "Ctrl-R" command to "adapt" to changes
2069 * in any options which control "visual" aspects of the game.
2071 void do_cmd_options(void)
2076 /* Save the screen */
2086 /* Why are we here */
2088 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2090 prt("Options", 2, 0);
2094 /* Give some choices */
2096 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2097 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2098 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2099 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2100 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2101 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2102 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2103 /* Special choices */
2104 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2105 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2106 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2108 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2110 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2112 prt("(1) Input Options", 4, 5);
2113 prt("(2) Output Options", 5, 5);
2114 prt("(3) Game-Play Options", 6, 5);
2115 prt("(4) Disturbance Options", 7, 5);
2116 prt("(5) Efficiency Options", 8, 5);
2117 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2118 prt("(R) Play-record Options", 10, 5);
2120 /* Special choices */
2121 prt("(D) Base Delay Factor", 12, 5);
2122 prt("(H) Hitpoint Warning", 13, 5);
2123 prt("(A) Autosave Options", 14, 5);
2127 prt("(W) Window Flags", 15, 5);
2130 prt("(C) Cheating Options", 16, 5);
2136 prt("¥³¥Þ¥ó¥É:", 18, 0);
2138 prt("Command: ", 18, 0);
2146 if (k == ESCAPE) break;
2151 /* General Options */
2154 /* Process the general options */
2156 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2158 do_cmd_options_aux(1, "Input Options");
2164 /* General Options */
2167 /* Process the general options */
2169 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2171 do_cmd_options_aux(2, "Output Options");
2177 /* Inventory Options */
2182 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2184 do_cmd_options_aux(3, "Game-Play Options");
2190 /* Disturbance Options */
2195 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2197 do_cmd_options_aux(4, "Disturbance Options");
2203 /* Efficiency Options */
2208 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2210 do_cmd_options_aux(5, "Efficiency Options");
2216 /* Object auto-destruction Options */
2221 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2223 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2228 /* Play-record Options */
2234 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2236 do_cmd_options_aux(10, "Play-record Option");
2241 /* Cheating Options */
2246 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2248 do_cmd_options_cheat("Cheaters never win");
2258 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2260 do_cmd_options_autosave("Autosave");
2271 do_cmd_options_win();
2272 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2273 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2274 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2275 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2279 /* Hack -- Delay Speed */
2285 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2287 prt("Command: Base Delay Factor", 18, 0);
2291 /* Get a new value */
2294 int msec = delay_factor * delay_factor * delay_factor;
2296 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2298 prt(format("Current base delay factor: %d (%d msec)",
2301 delay_factor, msec), 22, 0);
2303 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2305 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2309 if (k == ESCAPE) break;
2310 if (isdigit(k)) delay_factor = D2I(k);
2317 /* Hack -- hitpoint warning factor */
2323 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2325 prt("Command: Hitpoint Warning", 18, 0);
2329 /* Get a new value */
2333 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2334 hitpoint_warn), 22, 0);
2336 prt(format("Current hitpoint warning: %d0%%",
2337 hitpoint_warn), 22, 0);
2341 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2343 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2347 if (k == ESCAPE) break;
2348 if (isdigit(k)) hitpoint_warn = D2I(k);
2355 /* Unknown option */
2364 /* Flush messages */
2369 /* Restore the screen */
2372 /* Hack - Redraw equippy chars */
2373 p_ptr->redraw |= (PR_EQUIPPY);
2379 * Ask for a "user pref line" and process it
2381 * XXX XXX XXX Allow absolute file names?
2383 void do_cmd_pref(void)
2390 /* Ask for a "user pref command" */
2392 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2394 if (!get_string("Pref: ", buf, 80)) return;
2398 /* Process that pref command */
2399 (void)process_pref_file_command(buf);
2402 void do_cmd_pickpref(void)
2409 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2411 if(!get_check("Reload auto-pick preference file? ")) return;
2413 /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
2414 for( i = 0; i < max_autopick; i++){
2415 string_free(autopick_name[i]);
2416 string_free(autopick_insc[i]);
2420 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2422 sprintf(buf, "picktype-%s.prf", player_name);
2424 sprintf(buf, "pickpref-%s.prf", player_name);
2426 if( process_pickpref_file(buf) == 0 ){
2429 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2431 msg_format("loaded '%s'.", buf);
2435 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2437 if( process_pickpref_file("picktype.prf") == 0 )
2439 if( process_pickpref_file("pickpref.prf") == 0 )
2444 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2446 msg_print("loaded 'pickpref.prf'.");
2451 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2453 if(err) msg_print("Failed to reload autopick preference.");
2460 * Hack -- append all current macros to the given file
2462 static errr macro_dump(cptr fname)
2464 static cptr mark = "Macro Dump";
2472 /* Build the filename */
2473 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2475 /* File type is "TEXT" */
2476 FILE_TYPE(FILE_TYPE_TEXT);
2478 /* Append to the file */
2479 fff = open_auto_dump(buf, mark, &line_num);
2480 if (!fff) return (-1);
2484 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2486 fprintf(fff, "\n# Automatic macro dump\n\n");
2491 for (i = 0; i < macro__num; i++)
2493 /* Extract the action */
2494 ascii_to_text(buf, macro__act[i]);
2496 /* Dump the macro */
2497 fprintf(fff, "A:%s\n", buf);
2499 /* Extract the action */
2500 ascii_to_text(buf, macro__pat[i]);
2502 /* Dump normal macros */
2503 fprintf(fff, "P:%s\n", buf);
2508 /* count number of lines */
2513 close_auto_dump(fff, mark, line_num);
2521 * Hack -- ask for a "trigger" (see below)
2523 * Note the complex use of the "inkey()" function from "util.c".
2525 * Note that both "flush()" calls are extremely important.
2527 static void do_cmd_macro_aux(char *buf)
2537 /* Do not process macros */
2543 /* Read the pattern */
2549 /* Do not process macros */
2552 /* Do not wait for keys */
2555 /* Attempt to read a key */
2566 /* Convert the trigger */
2567 ascii_to_text(tmp, buf);
2569 /* Hack -- display the trigger */
2570 Term_addstr(-1, TERM_WHITE, tmp);
2577 * Hack -- ask for a keymap "trigger" (see below)
2579 * Note that both "flush()" calls are extremely important. This may
2580 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2582 static void do_cmd_macro_aux_keymap(char *buf)
2596 /* Convert to ascii */
2597 ascii_to_text(tmp, buf);
2599 /* Hack -- display the trigger */
2600 Term_addstr(-1, TERM_WHITE, tmp);
2609 * Hack -- append all keymaps to the given file
2611 static errr keymap_dump(cptr fname)
2613 static cptr mark = "Keymap Dump";
2625 if (rogue_like_commands)
2627 mode = KEYMAP_MODE_ROGUE;
2633 mode = KEYMAP_MODE_ORIG;
2637 /* Build the filename */
2638 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2640 /* File type is "TEXT" */
2641 FILE_TYPE(FILE_TYPE_TEXT);
2643 /* Append to the file */
2644 fff = open_auto_dump(buf, mark, &line_num);
2645 if (!fff) return -1;
2649 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2651 fprintf(fff, "\n# Automatic keymap dump\n\n");
2656 for (i = 0; i < 256; i++)
2660 /* Loop up the keymap */
2661 act = keymap_act[mode][i];
2663 /* Skip empty keymaps */
2666 /* Encode the key */
2669 ascii_to_text(key, buf);
2671 /* Encode the action */
2672 ascii_to_text(buf, act);
2674 /* Dump the macro */
2675 fprintf(fff, "A:%s\n", buf);
2676 fprintf(fff, "C:%d:%s\n", mode, key);
2681 close_auto_dump(fff, mark, line_num);
2690 * Interact with "macros"
2692 * Note that the macro "action" must be defined before the trigger.
2694 * Could use some helpful instructions on this page. XXX XXX XXX
2696 void do_cmd_macros(void)
2708 if (rogue_like_commands)
2710 mode = KEYMAP_MODE_ROGUE;
2716 mode = KEYMAP_MODE_ORIG;
2719 /* File type is "TEXT" */
2720 FILE_TYPE(FILE_TYPE_TEXT);
2727 /* Process requests until done */
2735 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2737 prt("Interact with Macros", 2, 0);
2742 /* Describe that action */
2744 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2746 prt("Current action (if any) shown below:", 20, 0);
2750 /* Analyze the current action */
2751 ascii_to_text(buf, macro__buf);
2753 /* Display the current action */
2759 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2761 prt("(1) Load a user pref file", 4, 5);
2766 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2767 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2768 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2769 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2770 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2771 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2772 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2773 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2774 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2776 prt("(2) Append macros to a file", 5, 5);
2777 prt("(3) Query a macro", 6, 5);
2778 prt("(4) Create a macro", 7, 5);
2779 prt("(5) Remove a macro", 8, 5);
2780 prt("(6) Append keymaps to a file", 9, 5);
2781 prt("(7) Query a keymap", 10, 5);
2782 prt("(8) Create a keymap", 11, 5);
2783 prt("(9) Remove a keymap", 12, 5);
2784 prt("(0) Enter a new action", 13, 5);
2787 #endif /* ALLOW_MACROS */
2791 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2793 prt("Command: ", 16, 0);
2801 if (i == ESCAPE) break;
2803 /* Load a 'macro' file */
2810 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2812 prt("Command: Load a user pref 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;
2830 /* Process the given filename */
2831 err = process_pref_file(tmp);
2835 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2837 msg_format("Loaded default '%s'.", tmp);
2844 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2846 msg_format("Failed to load '%s'!");
2852 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2854 msg_format("Loaded '%s'.", tmp);
2866 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2868 prt("Command: Append macros to a file", 16, 0);
2874 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2876 prt("File: ", 18, 0);
2880 /* Default filename */
2881 sprintf(tmp, "%s.prf", player_name);
2883 /* Ask for a file */
2884 if (!askfor_aux(tmp, 80)) continue;
2886 /* Dump the macros */
2887 (void)macro_dump(tmp);
2891 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2893 msg_print("Appended macros.");
2905 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2907 prt("Command: Query a macro", 16, 0);
2913 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2915 prt("Trigger: ", 18, 0);
2919 /* Get a macro trigger */
2920 do_cmd_macro_aux(buf);
2922 /* Acquire action */
2923 k = macro_find_exact(buf);
2930 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2932 msg_print("Found no macro.");
2940 /* Obtain the action */
2941 strcpy(macro__buf, macro__act[k]);
2943 /* Analyze the current action */
2944 ascii_to_text(buf, macro__buf);
2946 /* Display the current action */
2951 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2953 msg_print("Found a macro.");
2959 /* Create a macro */
2964 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2966 prt("Command: Create a macro", 16, 0);
2972 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2974 prt("Trigger: ", 18, 0);
2978 /* Get a macro trigger */
2979 do_cmd_macro_aux(buf);
2986 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
2988 prt("Action: ", 20, 0);
2992 /* Convert to text */
2993 ascii_to_text(tmp, macro__buf);
2995 /* Get an encoded action */
2996 if (askfor_aux(tmp, 80))
2998 /* Convert to ascii */
2999 text_to_ascii(macro__buf, tmp);
3001 /* Link the macro */
3002 macro_add(buf, macro__buf);
3006 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3008 msg_print("Added a macro.");
3014 /* Remove a macro */
3019 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3021 prt("Command: Remove a macro", 16, 0);
3027 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3029 prt("Trigger: ", 18, 0);
3033 /* Get a macro trigger */
3034 do_cmd_macro_aux(buf);
3036 /* Link the macro */
3037 macro_add(buf, buf);
3041 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3043 msg_print("Removed a macro.");
3053 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3055 prt("Command: Append keymaps to a file", 16, 0);
3061 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3063 prt("File: ", 18, 0);
3067 /* Default filename */
3068 sprintf(tmp, "%s.prf", player_name);
3070 /* Ask for a file */
3071 if (!askfor_aux(tmp, 80)) continue;
3073 /* Dump the macros */
3074 (void)keymap_dump(tmp);
3078 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3080 msg_print("Appended keymaps.");
3085 /* Query a keymap */
3092 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3094 prt("Command: Query a keymap", 16, 0);
3100 prt("²¡¤¹¥¡¼: ", 18, 0);
3102 prt("Keypress: ", 18, 0);
3106 /* Get a keymap trigger */
3107 do_cmd_macro_aux_keymap(buf);
3109 /* Look up the keymap */
3110 act = keymap_act[mode][(byte)(buf[0])];
3117 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3119 msg_print("Found no keymap.");
3127 /* Obtain the action */
3128 strcpy(macro__buf, act);
3130 /* Analyze the current action */
3131 ascii_to_text(buf, macro__buf);
3133 /* Display the current action */
3138 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3140 msg_print("Found a keymap.");
3146 /* Create a keymap */
3151 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3153 prt("Command: Create a keymap", 16, 0);
3159 prt("²¡¤¹¥¡¼: ", 18, 0);
3161 prt("Keypress: ", 18, 0);
3165 /* Get a keymap trigger */
3166 do_cmd_macro_aux_keymap(buf);
3173 prt("¹ÔÆ°: ", 20, 0);
3175 prt("Action: ", 20, 0);
3179 /* Convert to text */
3180 ascii_to_text(tmp, macro__buf);
3182 /* Get an encoded action */
3183 if (askfor_aux(tmp, 80))
3185 /* Convert to ascii */
3186 text_to_ascii(macro__buf, tmp);
3188 /* Free old keymap */
3189 string_free(keymap_act[mode][(byte)(buf[0])]);
3191 /* Make new keymap */
3192 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3196 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3198 msg_print("Added a keymap.");
3204 /* Remove a keymap */
3209 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3211 prt("Command: Remove a keymap", 16, 0);
3217 prt("²¡¤¹¥¡¼: ", 18, 0);
3219 prt("Keypress: ", 18, 0);
3223 /* Get a keymap trigger */
3224 do_cmd_macro_aux_keymap(buf);
3226 /* Free old keymap */
3227 string_free(keymap_act[mode][(byte)(buf[0])]);
3229 /* Make new keymap */
3230 keymap_act[mode][(byte)(buf[0])] = NULL;
3234 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3236 msg_print("Removed a keymap.");
3241 /* Enter a new action */
3246 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3248 prt("Command: Enter a new action", 16, 0);
3252 /* Go to the correct location */
3255 /* Hack -- limit the value */
3258 /* Get an encoded action */
3259 if (!askfor_aux(buf, 80)) continue;
3261 /* Extract an action */
3262 text_to_ascii(macro__buf, buf);
3265 #endif /* ALLOW_MACROS */
3274 /* Flush messages */
3284 * Interact with "visuals"
3286 void do_cmd_visuals(void)
3297 /* File type is "TEXT" */
3298 FILE_TYPE(FILE_TYPE_TEXT);
3301 /* Save the screen */
3305 /* Interact until done */
3311 /* Ask for a choice */
3313 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3315 prt("Interact with Visuals", 2, 0);
3319 /* Give some choices */
3321 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3323 prt("(1) Load a user pref file", 4, 5);
3326 #ifdef ALLOW_VISUALS
3328 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3329 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3330 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3331 prt("(5) (̤»ÈÍÑ)", 8, 5);
3332 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3333 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3334 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3335 prt("(9) (̤»ÈÍÑ)", 12, 5);
3337 prt("(2) Dump monster attr/chars", 5, 5);
3338 prt("(3) Dump object attr/chars", 6, 5);
3339 prt("(4) Dump feature attr/chars", 7, 5);
3340 prt("(5) (unused)", 8, 5);
3341 prt("(6) Change monster attr/chars", 9, 5);
3342 prt("(7) Change object attr/chars", 10, 5);
3343 prt("(8) Change feature attr/chars", 11, 5);
3344 prt("(9) (unused)", 12, 5);
3349 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3351 prt("(0) Reset visuals", 13, 5);
3357 prt("¥³¥Þ¥ó¥É:", 18, 0);
3359 prt("Command: ", 15, 0);
3367 if (i == ESCAPE) break;
3369 /* Load a 'pref' file */
3374 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3376 prt("Command: Load a user pref file", 15, 0);
3382 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3384 prt("File: ", 17, 0);
3388 /* Default filename */
3389 sprintf(tmp, "%s.prf", player_name);
3392 if (!askfor_aux(tmp, 70)) continue;
3394 /* Process the given filename */
3395 (void)process_pref_file(tmp);
3398 #ifdef ALLOW_VISUALS
3400 /* Dump monster attr/chars */
3403 static cptr mark = "Monster attr/chars";
3408 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3410 prt("Command: Dump monster attr/chars", 15, 0);
3416 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3418 prt("File: ", 17, 0);
3422 /* Default filename */
3423 sprintf(tmp, "%s.prf", player_name);
3425 /* Get a filename */
3426 if (!askfor_aux(tmp, 70)) continue;
3428 /* Build the filename */
3429 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3431 /* Append to the file */
3432 fff = open_auto_dump(buf, mark, &line_num);
3437 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3439 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3444 for (i = 0; i < max_r_idx; i++)
3446 monster_race *r_ptr = &r_info[i];
3448 /* Skip non-entries */
3449 if (!r_ptr->name) continue;
3451 /* Dump a comment */
3452 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3455 /* Dump the monster attr/char info */
3456 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3457 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3462 close_auto_dump(fff, mark, line_num);
3466 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3468 msg_print("Dumped monster attr/chars.");
3473 /* Dump object attr/chars */
3476 static cptr mark = "Object attr/chars";
3481 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3483 prt("Command: Dump object attr/chars", 15, 0);
3489 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3491 prt("File: ", 17, 0);
3495 /* Default filename */
3496 sprintf(tmp, "%s.prf", player_name);
3498 /* Get a filename */
3499 if (!askfor_aux(tmp, 70)) continue;
3501 /* Build the filename */
3502 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3504 /* Append to the file */
3505 fff = open_auto_dump(buf, mark, &line_num);
3510 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3512 fprintf(fff, "\n# Object attr/char definitions\n\n");
3517 for (i = 0; i < max_k_idx; i++)
3519 object_kind *k_ptr = &k_info[i];
3521 /* Skip non-entries */
3522 if (!k_ptr->name) continue;
3524 /* Dump a comment */
3525 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3528 /* Dump the object attr/char info */
3529 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3530 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3535 close_auto_dump(fff, mark, line_num);
3539 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3541 msg_print("Dumped object attr/chars.");
3546 /* Dump feature attr/chars */
3549 static cptr mark = "Feature attr/chars";
3554 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3556 prt("Command: Dump feature attr/chars", 15, 0);
3562 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3564 prt("File: ", 17, 0);
3568 /* Default filename */
3569 sprintf(tmp, "%s.prf", player_name);
3571 /* Get a filename */
3572 if (!askfor_aux(tmp, 70)) continue;
3574 /* Build the filename */
3575 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3577 /* Append to the file */
3578 fff = open_auto_dump(buf, mark, &line_num);
3583 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3585 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3590 for (i = 0; i < max_f_idx; i++)
3592 feature_type *f_ptr = &f_info[i];
3594 /* Skip non-entries */
3595 if (!f_ptr->name) continue;
3597 /* Dump a comment */
3598 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3601 /* Dump the feature attr/char info */
3602 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3603 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3608 close_auto_dump(fff, mark, line_num);
3612 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3614 msg_print("Dumped feature attr/chars.");
3619 /* Modify monster attr/chars */
3626 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3628 prt("Command: Change monster attr/chars", 15, 0);
3632 /* Hack -- query until done */
3635 monster_race *r_ptr = &r_info[r];
3637 byte da = (r_ptr->d_attr);
3638 byte dc = (r_ptr->d_char);
3639 byte ca = (r_ptr->x_attr);
3640 byte cc = (r_ptr->x_char);
3642 /* Label the object */
3644 Term_putstr(5, 17, -1, TERM_WHITE,
3645 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3646 r, (r_name + r_ptr->name)));
3648 Term_putstr(5, 17, -1, TERM_WHITE,
3649 format("Monster = %d, Name = %-40.40s",
3650 r, (r_name + r_ptr->name)));
3654 /* Label the Default values */
3656 Term_putstr(10, 19, -1, TERM_WHITE,
3657 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3659 Term_putstr(10, 19, -1, TERM_WHITE,
3660 format("Default attr/char = %3u / %3u", da, dc));
3663 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3664 Term_putch(43, 19, da, dc);
3666 /* Label the Current values */
3668 Term_putstr(10, 20, -1, TERM_WHITE,
3669 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3671 Term_putstr(10, 20, -1, TERM_WHITE,
3672 format("Current attr/char = %3u / %3u", ca, cc));
3675 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3676 Term_putch(43, 20, ca, cc);
3680 Term_putstr(0, 22, -1, TERM_WHITE,
3681 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3683 Term_putstr(0, 22, -1, TERM_WHITE,
3684 "Command (n/N/a/A/c/C): ");
3692 if (i == ESCAPE) break;
3695 if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx;
3696 if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx;
3697 if (i == 'a') r_ptr->x_attr = (byte)(ca + 1);
3698 if (i == 'A') r_ptr->x_attr = (byte)(ca - 1);
3699 if (i == 'c') r_ptr->x_char = (byte)(cc + 1);
3700 if (i == 'C') r_ptr->x_char = (byte)(cc - 1);
3704 /* Modify object attr/chars */
3711 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3713 prt("Command: Change object attr/chars", 15, 0);
3717 /* Hack -- query until done */
3720 object_kind *k_ptr = &k_info[k];
3722 byte da = (byte)k_ptr->d_attr;
3723 byte dc = (byte)k_ptr->d_char;
3724 byte ca = (byte)k_ptr->x_attr;
3725 byte cc = (byte)k_ptr->x_char;
3727 /* Label the object */
3729 Term_putstr(5, 17, -1, TERM_WHITE,
3730 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3731 k, (k_name + k_ptr->name)));
3733 Term_putstr(5, 17, -1, TERM_WHITE,
3734 format("Object = %d, Name = %-40.40s",
3735 k, (k_name + k_ptr->name)));
3739 /* Label the Default values */
3741 Term_putstr(10, 19, -1, TERM_WHITE,
3742 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3744 Term_putstr(10, 19, -1, TERM_WHITE,
3745 format("Default attr/char = %3d / %3d", da, dc));
3748 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3749 Term_putch(43, 19, da, dc);
3751 /* Label the Current values */
3753 Term_putstr(10, 20, -1, TERM_WHITE,
3754 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3756 Term_putstr(10, 20, -1, TERM_WHITE,
3757 format("Current attr/char = %3d / %3d", ca, cc));
3760 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3761 Term_putch(43, 20, ca, cc);
3765 Term_putstr(0, 22, -1, TERM_WHITE,
3766 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3768 Term_putstr(0, 22, -1, TERM_WHITE,
3769 "Command (n/N/a/A/c/C): ");
3777 if (i == ESCAPE) break;
3780 if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx;
3781 if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx;
3782 if (i == 'a') k_info[k].x_attr = (byte)(ca + 1);
3783 if (i == 'A') k_info[k].x_attr = (byte)(ca - 1);
3784 if (i == 'c') k_info[k].x_char = (byte)(cc + 1);
3785 if (i == 'C') k_info[k].x_char = (byte)(cc - 1);
3789 /* Modify feature attr/chars */
3796 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3798 prt("Command: Change feature attr/chars", 15, 0);
3802 /* Hack -- query until done */
3805 feature_type *f_ptr = &f_info[f];
3807 byte da = (byte)f_ptr->d_attr;
3808 byte dc = (byte)f_ptr->d_char;
3809 byte ca = (byte)f_ptr->x_attr;
3810 byte cc = (byte)f_ptr->x_char;
3812 /* Label the object */
3814 Term_putstr(5, 17, -1, TERM_WHITE,
3815 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3816 f, (f_name + f_ptr->name)));
3818 Term_putstr(5, 17, -1, TERM_WHITE,
3819 format("Terrain = %d, Name = %-40.40s",
3820 f, (f_name + f_ptr->name)));
3824 /* Label the Default values */
3826 Term_putstr(10, 19, -1, TERM_WHITE,
3827 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3829 Term_putstr(10, 19, -1, TERM_WHITE,
3830 format("Default attr/char = %3d / %3d", da, dc));
3833 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3834 Term_putch(43, 19, da, dc);
3836 /* Label the Current values */
3838 Term_putstr(10, 20, -1, TERM_WHITE,
3839 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3841 Term_putstr(10, 20, -1, TERM_WHITE,
3842 format("Current attr/char = %3d / %3d", ca, cc));
3845 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3846 Term_putch(43, 20, ca, cc);
3850 Term_putstr(0, 22, -1, TERM_WHITE,
3851 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3853 Term_putstr(0, 22, -1, TERM_WHITE,
3854 "Command (n/N/a/A/c/C): ");
3862 if (i == ESCAPE) break;
3865 if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx;
3866 if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx;
3867 if (i == 'a') f_info[f].x_attr = (byte)(ca + 1);
3868 if (i == 'A') f_info[f].x_attr = (byte)(ca - 1);
3869 if (i == 'c') f_info[f].x_char = (byte)(cc + 1);
3870 if (i == 'C') f_info[f].x_char = (byte)(cc - 1);
3884 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
3886 msg_print("Visual attr/char tables reset.");
3891 /* Unknown option */
3897 /* Flush messages */
3902 /* Restore the screen */
3908 * Interact with "colors"
3910 void do_cmd_colors(void)
3921 /* File type is "TEXT" */
3922 FILE_TYPE(FILE_TYPE_TEXT);
3925 /* Save the screen */
3929 /* Interact until done */
3935 /* Ask for a choice */
3937 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
3939 prt("Interact with Colors", 2, 0);
3943 /* Give some choices */
3945 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3947 prt("(1) Load a user pref file", 4, 5);
3952 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3953 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
3955 prt("(2) Dump colors", 5, 5);
3956 prt("(3) Modify colors", 6, 5);
3963 prt("¥³¥Þ¥ó¥É: ", 8, 0);
3965 prt("Command: ", 8, 0);
3973 if (i == ESCAPE) break;
3975 /* Load a 'pref' file */
3980 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
3982 prt("Command: Load a user pref file", 8, 0);
3988 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
3990 prt("File: ", 10, 0);
3995 sprintf(tmp, "%s.prf", player_name);
3998 if (!askfor_aux(tmp, 70)) continue;
4000 /* Process the given filename */
4001 (void)process_pref_file(tmp);
4003 /* Mega-Hack -- react to changes */
4004 Term_xtra(TERM_XTRA_REACT, 0);
4006 /* Mega-Hack -- redraw */
4015 static cptr mark = "Colors";
4020 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4022 prt("Command: Dump colors", 8, 0);
4028 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4030 prt("File: ", 10, 0);
4034 /* Default filename */
4035 sprintf(tmp, "%s.prf", player_name);
4037 /* Get a filename */
4038 if (!askfor_aux(tmp, 70)) continue;
4040 /* Build the filename */
4041 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
4043 /* Append to the file */
4044 fff = open_auto_dump(buf, mark, &line_num);
4049 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4051 fprintf(fff, "\n# Color redefinitions\n\n");
4056 for (i = 0; i < 256; i++)
4058 int kv = angband_color_table[i][0];
4059 int rv = angband_color_table[i][1];
4060 int gv = angband_color_table[i][2];
4061 int bv = angband_color_table[i][3];
4066 cptr name = "unknown";
4070 /* Skip non-entries */
4071 if (!kv && !rv && !gv && !bv) continue;
4073 /* Extract the color name */
4074 if (i < 16) name = color_names[i];
4076 /* Dump a comment */
4078 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4080 fprintf(fff, "# Color '%s'\n", name);
4084 /* Dump the monster attr/char info */
4085 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4091 close_auto_dump(fff, mark, line_num);
4095 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4097 msg_print("Dumped color redefinitions.");
4109 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4111 prt("Command: Modify colors", 8, 0);
4115 /* Hack -- query until done */
4124 /* Exhibit the normal colors */
4125 for (j = 0; j < 16; j++)
4127 /* Exhibit this color */
4128 Term_putstr(j*4, 20, -1, a, "###");
4130 /* Exhibit all colors */
4131 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4134 /* Describe the color */
4136 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4138 name = ((a < 16) ? color_names[a] : "undefined");
4142 /* Describe the color */
4144 Term_putstr(5, 10, -1, TERM_WHITE,
4145 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4147 Term_putstr(5, 10, -1, TERM_WHITE,
4148 format("Color = %d, Name = %s", a, name));
4152 /* Label the Current values */
4153 Term_putstr(5, 12, -1, TERM_WHITE,
4154 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4155 angband_color_table[a][0],
4156 angband_color_table[a][1],
4157 angband_color_table[a][2],
4158 angband_color_table[a][3]));
4162 Term_putstr(0, 14, -1, TERM_WHITE,
4163 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4165 Term_putstr(0, 14, -1, TERM_WHITE,
4166 "Command (n/N/k/K/r/R/g/G/b/B): ");
4174 if (i == ESCAPE) break;
4177 if (i == 'n') a = (byte)(a + 1);
4178 if (i == 'N') a = (byte)(a - 1);
4179 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4180 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4181 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4182 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4183 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4184 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4185 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4186 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4188 /* Hack -- react to changes */
4189 Term_xtra(TERM_XTRA_REACT, 0);
4191 /* Hack -- redraw */
4198 /* Unknown option */
4204 /* Flush messages */
4209 /* Restore the screen */
4215 * Note something in the message recall
4217 void do_cmd_note(void)
4226 if (!get_string("¥á¥â: ", buf, 60)) return;
4228 if (!get_string("Note: ", buf, 60)) return;
4232 /* Ignore empty notes */
4233 if (!buf[0] || (buf[0] == ' ')) return;
4235 /* Add the note to the message recall */
4237 msg_format("¥á¥â: %s", buf);
4239 msg_format("Note: %s", buf);
4246 * Mention the current version
4248 void do_cmd_version(void)
4252 #ifndef FAKE_VERSION
4253 msg_format("You are playing Angband %d.%d.%d.",
4254 VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
4257 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4258 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4260 msg_format("You are playing Hengband %d.%d.%d.",
4261 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4271 * Array of feeling strings
4273 static cptr do_cmd_feeling_text[11] =
4276 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4278 "Looks like any other level.",
4282 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4284 "You feel there is something special about this level.",
4288 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4290 "You nearly faint as horrible visions of death fill your mind!",
4294 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4296 "This level looks very dangerous.",
4300 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4302 "You have a very bad feeling...",
4306 "°¤¤Í½´¶¤¬¤¹¤ë...",
4308 "You have a bad feeling...",
4314 "You feel nervous.",
4318 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4320 "You feel your luck is turning...",
4324 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4326 "You don't like the look of this place.",
4330 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4332 "This level looks reasonably safe.",
4336 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4338 "What a boring place..."
4343 static cptr do_cmd_feeling_text_combat[11] =
4346 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4348 "Looks like any other level.",
4352 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4354 "You feel there is something special about this level.",
4358 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4360 "You nearly faint as horrible visions of death fill your mind!",
4364 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4366 "This level looks very dangerous.",
4370 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4372 "You have a very bad feeling...",
4376 "°¤¤Í½´¶¤¬¤¹¤ë...",
4378 "You have a bad feeling...",
4384 "You feel nervous.",
4388 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4390 "You feel your luck is turning...",
4394 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4396 "You don't like the look of this place.",
4400 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4402 "This level looks reasonably safe.",
4406 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4408 "What a boring place..."
4413 static cptr do_cmd_feeling_text_lucky[11] =
4416 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4417 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4418 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4419 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4420 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4421 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4422 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4423 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4424 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4425 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4426 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4428 "Looks like any other level.",
4429 "You feel there is something special about this level.",
4430 "You have a superb feeling about this level.",
4431 "You have an excellent feeling...",
4432 "You have a very good feeling...",
4433 "You have a good feeling...",
4434 "You feel strangely lucky...",
4435 "You feel your luck is turning...",
4436 "You like the look of this place...",
4437 "This level can't be all bad...",
4438 "What a boring place..."
4444 * Note that "feeling" is set to zero unless some time has passed.
4445 * Note that this is done when the level is GENERATED, not entered.
4447 void do_cmd_feeling(void)
4449 /* Verify the feeling */
4450 if (feeling > 10) feeling = 10;
4452 /* No useful feeling in quests */
4453 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4456 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4458 msg_print("Looks like a typical quest level.");
4464 /* No useful feeling in town */
4465 else if (p_ptr->town_num && !dun_level)
4468 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4470 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4474 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4476 msg_print("Looks like a strange wilderness.");
4484 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4486 msg_print("Looks like a typical town.");
4493 /* No useful feeling in the wilderness */
4494 else if (!dun_level)
4497 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4499 msg_print("Looks like a typical wilderness.");
4505 /* Display the feeling */
4506 if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
4508 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4510 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4511 msg_print(do_cmd_feeling_text_combat[feeling]);
4513 msg_print(do_cmd_feeling_text[feeling]);
4518 msg_print(do_cmd_feeling_text[0]);
4527 * Encode the screen colors
4529 static char hack[17] = "dwsorgbuDWvyRGBU";
4532 static errr photo_fgets(FILE *fff, char *buf, huge n)
4541 if (fgets(tmp, 1024, fff))
4543 /* Convert weirdness */
4544 for (s = tmp; *s; s++)
4546 /* Handle newline */
4557 else if (*s == '\t')
4559 /* Hack -- require room */
4560 if (i + 8 >= n) break;
4562 /* Append a space */
4565 /* Append some more spaces */
4566 while (!(i % 8)) buf[i++] = ' ';
4570 else if (iskanji(*s))
4577 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4578 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4585 /* Handle printables */
4606 * Hack -- load a screen dump from a file
4608 void do_cmd_load_screen(void)
4622 /* Hack -- drop permissions */
4625 /* Build the filename */
4626 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4628 /* Append to the file */
4629 fff = my_fopen(buf, "r");
4634 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4636 msg_format("Failed to open %s.", buf);
4643 /* Save the screen */
4646 /* Clear the screen */
4650 /* Load the screen */
4651 for (y = 0; okay && (y < 24); y++)
4653 /* Get a line of data */
4654 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4657 for (x = 0; x < 79; x++)
4659 /* Put the attr/char */
4660 Term_draw(x, y, TERM_WHITE, buf[x]);
4664 /* Get the blank line */
4665 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4668 /* Dump the screen */
4669 for (y = 0; okay && (y < 24); y++)
4671 /* Get a line of data */
4672 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4675 for (x = 0; x < 79; x++)
4677 /* Get the attr/char */
4678 (void)(Term_what(x, y, &a, &c));
4680 /* Look up the attr */
4681 for (i = 0; i < 16; i++)
4683 /* Use attr matches */
4684 if (hack[i] == buf[x]) a = i;
4687 /* Put the attr/char */
4688 Term_draw(x, y, a, c);
4693 /* Get the blank line */
4694 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4700 /* Hack -- grab permissions */
4706 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4708 msg_print("Screen dump loaded.");
4715 /* Restore the screen */
4722 cptr inven_res_label =
4724 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4726 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4729 /* XTRA HACK RESLIST */
4730 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4731 int *j, byte tval, char *where)
4733 char o_name[MAX_NLEN];
4736 if (!o_ptr->k_idx)return;
4737 if (o_ptr->tval != tval)return;
4740 * HACK:Ring of Lordly protection and Dragon shield/helm
4741 * have random resistances.
4743 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4744 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4745 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4746 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4747 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4748 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4749 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4752 object_desc(o_name, o_ptr, TRUE, 0);
4754 while ( o_name[i] && i < 26 ){
4756 if (iskanji(o_name[i])) i++;
4760 if(i<28) while(i<28){o_name[i]=' ';i++;}
4763 fprintf(fff,"%s %s", where, o_name);
4765 if (!(o_ptr->ident & (IDENT_MENTAL)))
4768 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4770 fprintf(fff, "-------unknown------------ -------unknown------\n");
4774 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4777 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4778 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4779 else fprintf(fff,"¡¦");
4781 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4782 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4783 else fprintf(fff,"¡¦");
4785 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4786 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4787 else fprintf(fff,"¡¦");
4789 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4790 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4791 else fprintf(fff,"¡¦");
4793 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4794 else fprintf(fff,"¡¦");
4796 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4797 else fprintf(fff,"¡¦");
4799 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4800 else fprintf(fff,"¡¦");
4802 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4803 else fprintf(fff,"¡¦");
4805 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4806 else fprintf(fff,"¡¦");
4808 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4809 else fprintf(fff,"¡¦");
4811 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4812 else fprintf(fff,"¡¦");
4814 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4815 else fprintf(fff,"¡¦");
4817 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4818 else fprintf(fff,"¡¦");
4822 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4823 else fprintf(fff,"¡¦");
4825 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4826 else fprintf(fff,"¡¦");
4828 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4829 else fprintf(fff,"¡¦");
4831 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4832 else fprintf(fff,"¡¦");
4834 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4835 else fprintf(fff,"¡¦");
4837 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4838 else fprintf(fff,"¡¦");
4840 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4841 else fprintf(fff,"¡¦");
4843 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4844 else fprintf(fff,"¡¦");
4847 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4848 else fprintf(fff,"¡¦");
4850 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4851 else fprintf(fff,"¡¦");
4853 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4854 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4855 else fprintf(fff,". ");
4857 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4858 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4859 else fprintf(fff,". ");
4861 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4862 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4863 else fprintf(fff,". ");
4865 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4866 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4867 else fprintf(fff,". ");
4869 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4870 else fprintf(fff,". ");
4872 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4873 else fprintf(fff,". ");
4875 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
4876 else fprintf(fff,". ");
4878 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
4879 else fprintf(fff,". ");
4881 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
4882 else fprintf(fff,". ");
4884 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
4885 else fprintf(fff,". ");
4887 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
4888 else fprintf(fff,". ");
4890 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
4891 else fprintf(fff,". ");
4893 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
4894 else fprintf(fff,". ");
4898 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
4899 else fprintf(fff,". ");
4901 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
4902 else fprintf(fff,". ");
4904 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
4905 else fprintf(fff,". ");
4907 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
4908 else fprintf(fff,". ");
4910 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
4911 else fprintf(fff,". ");
4913 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
4914 else fprintf(fff,". ");
4916 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
4917 else fprintf(fff,". ");
4919 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
4920 else fprintf(fff,". ");
4923 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
4924 else fprintf(fff,". ");
4926 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
4927 else fprintf(fff,". ");
4935 fprintf(fff,"%s\n", inven_res_label);
4941 * Display *ID* ed weapons/armors's resistances
4943 static void do_cmd_knowledge_inven(void)
4948 char file_name[1024];
4959 /* Open a new file */
4960 fff = my_fopen_temp(file_name, 1024);
4963 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
4965 msg_format("Failed to create temporally file %s.", file_name);
4970 fprintf(fff,"%s\n",inven_res_label);
4972 for (tval=TV_BOW; tval <= TV_RING; tval++){
4975 for (;j<9;j++) fprintf(fff, "\n");
4977 fprintf(fff,"%s\n",inven_res_label);
4981 strcpy(where, "Áõ");
4983 strcpy(where, "E ");
4985 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4987 o_ptr = &inventory[i];
4988 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4992 strcpy(where, "»ý");
4994 strcpy(where, "I ");
4996 for (i = 0; i < INVEN_PACK; i++)
4998 o_ptr = &inventory[i];
4999 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5003 /* Print all homes in the different towns */
5004 st_ptr = &town[1].store[STORE_HOME];
5006 strcpy(where, "²È");
5008 strcpy(where, "H ");/*nanka*/
5011 /* Dump all available items */
5012 for (i = 0; i < st_ptr->stock_num; i++)
5014 o_ptr = &st_ptr->stock[i];
5015 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5019 /* Close the file */
5022 /* Display the file contents */
5024 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5026 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5029 /* Remove the file */
5034 void do_cmd_save_screen_html_aux(char *filename, int message)
5038 byte a = 0, old_a = 0;
5052 char *html_head[] = {
5053 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5057 char *html_foot[] = {
5059 "</body>\n</html>\n",
5063 /* File type is "TEXT" */
5064 FILE_TYPE(FILE_TYPE_TEXT);
5066 /* Append to the file */
5067 fff = my_fopen(filename, "w");
5073 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5075 msg_format("Failed to open file %s.", filename);
5083 /* Save the screen */
5087 /* Build the filename */
5088 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
5089 tmpfff = my_fopen(buf, "r");
5091 for (i = 0; html_head[i]; i++)
5092 fprintf(fff, html_head[i]);
5096 while (!my_fgets(tmpfff, buf, 1024)) {
5098 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5102 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5104 fprintf(fff, "%s\n", buf);
5109 /* Dump the screen */
5110 for (y = 0; y < 24; y++)
5117 for (x = 0; x < 79; x++)
5121 /* Get the attr/char */
5122 (void)(Term_what(x, y, &a, &c));
5126 case '&': cc = "&"; break;
5127 case '<': cc = "<"; break;
5128 case '>': cc = ">"; break;
5130 case 0x1f: c = '.'; break;
5131 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5136 if ((y == 0 && x == 0) || a != old_a) {
5137 rv = angband_color_table[a][1];
5138 gv = angband_color_table[a][2];
5139 bv = angband_color_table[a][3];
5140 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5141 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5145 fprintf(fff, "%s", cc);
5147 fprintf(fff, "%c", c);
5150 fprintf(fff, "</font>");
5153 for (i = 0; html_foot[i]; i++)
5154 fprintf(fff, html_foot[i]);
5159 while (!my_fgets(tmpfff, buf, 1024)) {
5161 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5165 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5167 fprintf(fff, "%s\n", buf);
5182 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5184 msg_print("Screen dump saved.");
5189 /* Restore the screen */
5195 * Hack -- save a screen dump to a file
5197 void do_cmd_save_screen_html(void)
5199 char buf[1024], tmp[256] = "screen.html";
5202 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5204 if (!get_string("File name: ", tmp, 80))
5208 /* Build the filename */
5209 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5213 /* Hack -- drop permissions */
5216 do_cmd_save_screen_html_aux(buf, 1);
5218 /* Hack -- grab permissions */
5224 * Redefinable "save_screen" action
5226 void (*screendump_aux)(void) = NULL;
5230 * Hack -- save a screen dump to a file
5232 void do_cmd_save_screen(void)
5235 if (get_check("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©"))
5237 if (get_check("Save screen dump as HTML? "))
5240 do_cmd_save_screen_html();
5244 /* Do we use a special screendump function ? */
5247 /* Dump the screen to a graphics file */
5248 (*screendump_aux)();
5250 else /* Dump the screen as text */
5262 /* Hack -- drop permissions */
5265 /* Build the filename */
5266 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5268 /* File type is "TEXT" */
5269 FILE_TYPE(FILE_TYPE_TEXT);
5271 /* Append to the file */
5272 fff = my_fopen(buf, "w");
5277 /* Hack -- grab permissions */
5280 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5282 msg_format("Failed to open file %s.", buf);
5289 /* Save the screen */
5293 /* Dump the screen */
5294 for (y = 0; y < 24; y++)
5297 for (x = 0; x < 79; x++)
5299 /* Get the attr/char */
5300 (void)(Term_what(x, y, &a, &c));
5310 fprintf(fff, "%s\n", buf);
5317 /* Dump the screen */
5318 for (y = 0; y < 24; y++)
5321 for (x = 0; x < 79; x++)
5323 /* Get the attr/char */
5324 (void)(Term_what(x, y, &a, &c));
5327 buf[x] = hack[a&0x0F];
5334 fprintf(fff, "%s\n", buf);
5344 /* Hack -- grab permissions */
5349 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5351 msg_print("Screen dump saved.");
5357 /* Restore the screen */
5364 * Sorting hook -- Comp function -- see below
5366 * We use "u" to point to array of monster indexes,
5367 * and "v" to select the type of sorting to perform on "u".
5369 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5371 u16b *who = (u16b*)(u);
5373 u16b *why = (u16b*)(v);
5381 /* Sort by total kills */
5384 /* Extract total kills */
5385 z1 = a_info[w1].tval;
5386 z2 = a_info[w2].tval;
5388 /* Compare total kills */
5389 if (z1 < z2) return (TRUE);
5390 if (z1 > z2) return (FALSE);
5394 /* Sort by monster level */
5397 /* Extract levels */
5398 z1 = a_info[w1].sval;
5399 z2 = a_info[w2].sval;
5401 /* Compare levels */
5402 if (z1 < z2) return (TRUE);
5403 if (z1 > z2) return (FALSE);
5407 /* Sort by monster experience */
5410 /* Extract experience */
5411 z1 = a_info[w1].level;
5412 z2 = a_info[w2].level;
5414 /* Compare experience */
5415 if (z1 < z2) return (TRUE);
5416 if (z1 > z2) return (FALSE);
5420 /* Compare indexes */
5426 * Sorting hook -- Swap function -- see below
5428 * We use "u" to point to array of monster indexes,
5429 * and "v" to select the type of sorting to perform.
5431 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5433 u16b *who = (u16b*)(u);
5445 * Check the status of "artifacts"
5447 void do_cmd_knowledge_artifacts(void)
5449 int i, k, z, x, y, n = 0;
5455 char file_name[1024];
5457 char base_name[MAX_NLEN];
5461 /* Open a new file */
5462 fff = my_fopen_temp(file_name, 1024);
5466 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5468 msg_format("Failed to create temporary file %s.", file_name);
5474 /* Allocate the "who" array */
5475 C_MAKE(who, max_r_idx, s16b);
5477 /* Allocate the "okay" array */
5478 C_MAKE(okay, max_a_idx, bool);
5480 /* Scan the artifacts */
5481 for (k = 0; k < max_a_idx; k++)
5483 artifact_type *a_ptr = &a_info[k];
5488 /* Skip "empty" artifacts */
5489 if (!a_ptr->name) continue;
5491 /* Skip "uncreated" artifacts */
5492 if (!a_ptr->cur_num) continue;
5498 /* Check the dungeon */
5499 for (y = 0; y < cur_hgt; y++)
5501 for (x = 0; x < cur_wid; x++)
5503 cave_type *c_ptr = &cave[y][x];
5505 s16b this_o_idx, next_o_idx = 0;
5507 /* Scan all objects in the grid */
5508 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5512 /* Acquire object */
5513 o_ptr = &o_list[this_o_idx];
5515 /* Acquire next object */
5516 next_o_idx = o_ptr->next_o_idx;
5518 /* Ignore non-artifacts */
5519 if (!artifact_p(o_ptr)) continue;
5521 /* Ignore known items */
5522 if (object_known_p(o_ptr)) continue;
5524 /* Note the artifact */
5525 okay[o_ptr->name1] = FALSE;
5530 /* Check the inventory and equipment */
5531 for (i = 0; i < INVEN_TOTAL; i++)
5533 object_type *o_ptr = &inventory[i];
5535 /* Ignore non-objects */
5536 if (!o_ptr->k_idx) continue;
5538 /* Ignore non-artifacts */
5539 if (!artifact_p(o_ptr)) continue;
5541 /* Ignore known items */
5542 if (object_known_p(o_ptr)) continue;
5544 /* Note the artifact */
5545 okay[o_ptr->name1] = FALSE;
5548 for (k = 0; k < max_a_idx; k++)
5550 if (okay[k]) who[n++] = k;
5553 /* Select the sort method */
5554 ang_sort_comp = ang_sort_art_comp;
5555 ang_sort_swap = ang_sort_art_swap;
5557 /* Sort the array by dungeon depth of monsters */
5558 ang_sort(who, &why, n);
5560 /* Scan the artifacts */
5561 for (k = 0; k < n; k++)
5563 artifact_type *a_ptr = &a_info[who[k]];
5567 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5569 strcpy(base_name, "Unknown Artifact");
5573 /* Obtain the base object type */
5574 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5582 /* Get local object */
5585 /* Create fake object */
5586 object_prep(q_ptr, z);
5588 /* Make it an artifact */
5589 q_ptr->name1 = (byte)who[k];
5591 /* Describe the artifact */
5592 object_desc_store(base_name, q_ptr, FALSE, 0);
5595 /* Hack -- Build the artifact name */
5597 fprintf(fff, " %s\n", base_name);
5599 fprintf(fff, " The %s\n", base_name);
5604 /* Free the "who" array */
5605 C_KILL(who, max_r_idx, s16b);
5607 /* Free the "okay" array */
5608 C_KILL(okay, max_a_idx, bool);
5610 /* Close the file */
5613 /* Display the file contents */
5615 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5617 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5621 /* Remove the file */
5627 * Display known uniques
5629 static void do_cmd_knowledge_uniques(void)
5637 char file_name[1024];
5639 /* Open a new file */
5640 fff = my_fopen_temp(file_name, 1024);
5644 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5646 msg_format("Failed to create temporary file %s.", file_name);
5652 /* Allocate the "who" array */
5653 C_MAKE(who, max_r_idx, s16b);
5655 /* Scan the monsters */
5656 for (i = 1; i < max_r_idx; i++)
5658 monster_race *r_ptr = &r_info[i];
5660 /* Use that monster */
5661 if (r_ptr->name) who[n++] = i;
5664 /* Select the sort method */
5665 ang_sort_comp = ang_sort_comp_hook;
5666 ang_sort_swap = ang_sort_swap_hook;
5668 /* Sort the array by dungeon depth of monsters */
5669 ang_sort(who, &why, n);
5671 /* Scan the monster races */
5672 for (k = 0; k < n; k++)
5674 monster_race *r_ptr = &r_info[who[k]];
5676 /* Only print Uniques */
5677 if (r_ptr->flags1 & (RF1_UNIQUE))
5679 bool dead = (r_ptr->max_num == 0);
5683 /* Only display "known" uniques */
5684 if (dead || cheat_know || r_ptr->r_sights)
5686 /* Print a message */
5688 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5689 (r_name + r_ptr->name));
5691 fprintf(fff, " %s is alive\n",
5692 (r_name + r_ptr->name));
5699 /* Free the "who" array */
5700 C_KILL(who, max_r_idx, s16b);
5702 /* Close the file */
5705 /* Display the file contents */
5707 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5709 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5713 /* Remove the file */
5719 * Display dead uniques
5721 static void do_cmd_knowledge_uniques_dead(void)
5729 char file_name[1024];
5731 /* Open a new file */
5732 fff = my_fopen_temp(file_name, 1024);
5736 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5738 msg_format("Failed to create temporary file %s.", file_name);
5744 /* Allocate the "who" array */
5745 C_MAKE(who, max_r_idx, s16b);
5747 /* Scan the monsters */
5748 for (i = 1; i < max_r_idx; i++)
5750 monster_race *r_ptr = &r_info[i];
5752 /* Use that monster */
5753 if (r_ptr->name) who[n++] = i;
5756 /* Select the sort method */
5757 ang_sort_comp = ang_sort_comp_hook;
5758 ang_sort_swap = ang_sort_swap_hook;
5760 /* Sort the array by dungeon depth of monsters */
5761 ang_sort(who, &why, n);
5763 /* Scan the monster races */
5764 for (k = 0; k < n; k++)
5766 monster_race *r_ptr = &r_info[who[k]];
5768 /* Only print Uniques */
5769 if (r_ptr->flags1 & (RF1_UNIQUE))
5771 bool dead = (r_ptr->max_num == 0);
5773 if (!dead) continue;
5775 /* Only display "known" uniques */
5776 if (dead || cheat_know || r_ptr->r_sights)
5778 /* Print a message */
5780 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5781 (r_name + r_ptr->name));
5783 fprintf(fff, " %s is dead\n",
5784 (r_name + r_ptr->name));
5791 /* Free the "who" array */
5792 C_KILL(who, max_r_idx, s16b);
5794 /* Close the file */
5797 /* Display the file contents */
5799 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5801 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5805 /* Remove the file */
5811 * Display weapon-exp
5813 static void do_cmd_knowledge_weapon_exp(void)
5815 int i,j, num, shougou;
5819 char file_name[1024];
5822 /* Open a new file */
5823 fff = my_fopen_temp(file_name, 1024);
5826 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5828 msg_format("Failed to create temporary file %s.", file_name);
5834 for(i = 0; i < 5; i++)
5836 for (num = 0; num < 64; num++)
5838 for (j = 0; j < max_k_idx; j++)
5840 object_kind *k_ptr = &k_info[j];
5842 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
5844 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
5846 if(weapon_exp[4-i][num]<4000) shougou=0;
5847 else if(weapon_exp[4-i][num]<6000) shougou=1;
5848 else if(weapon_exp[4-i][num]<7000) shougou=2;
5849 else if(weapon_exp[4-i][num]<8000) shougou=3;
5852 fprintf(fff,"%-25s ",tmp);
5853 if (weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
5854 else fprintf(fff," ");
5855 fprintf(fff,"%s",shougou_moji[shougou]);
5856 if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
5864 /* Close the file */
5867 /* Display the file contents */
5869 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
5871 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
5875 /* Remove the file */
5883 static void do_cmd_knowledge_spell_exp(void)
5890 char file_name[1024];
5892 /* Open a new file */
5893 fff = my_fopen_temp(file_name, 1024);
5896 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5898 msg_format("Failed to create temporary file %s.", file_name);
5904 if(p_ptr->realm1 != REALM_NONE)
5907 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
5909 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
5911 for (i = 0; i < 32; i++)
5913 if (!is_magic(p_ptr->realm1))
5915 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC - 1][i];
5919 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5921 if(s_ptr->slevel == 99) continue;
5922 if(spell_exp[i]<900) shougou=0;
5923 else if(spell_exp[i]<1200) shougou=1;
5924 else if(spell_exp[i]<1400) shougou=2;
5925 else if(spell_exp[i]<1600) shougou=3;
5927 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
5928 if (p_ptr->realm1 == REALM_HISSATSU)
5929 fprintf(fff,"[--]");
5932 if (shougou == 4) fprintf(fff,"!");
5933 else fprintf(fff," ");
5934 fprintf(fff,"%s",shougou_moji[shougou]);
5936 if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
5941 if(p_ptr->realm2 != REALM_NONE)
5943 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
5944 for (i = 0; i < 32; i++)
5946 if (!is_magic(p_ptr->realm1))
5948 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC - 1][i];
5952 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5954 if(s_ptr->slevel == 99) continue;
5956 if(spell_exp[i+32]<900) shougou=0;
5957 else if(spell_exp[i+32]<1200) shougou=1;
5958 else if(spell_exp[i+32]<1400) shougou=2;
5960 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
5961 if (shougou == 3) fprintf(fff,"!");
5962 else fprintf(fff," ");
5963 fprintf(fff,"%s",shougou_moji[shougou]);
5964 if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
5969 /* Close the file */
5972 /* Display the file contents */
5974 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
5976 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
5980 /* Remove the file */
5988 static void do_cmd_knowledge_skill_exp(void)
5994 char file_name[1024];
5996 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
5998 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6001 /* Open a new file */
6002 fff = my_fopen_temp(file_name, 1024);
6005 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6007 msg_format("Failed to create temporary file %s.", file_name);
6013 for (i = 0; i < 3; i++)
6015 if(i == GINOU_RIDING)
6017 if(skill_exp[i]<500) shougou=0;
6018 else if(skill_exp[i]<2000) shougou=1;
6019 else if(skill_exp[i]<5000) shougou=2;
6020 else if(skill_exp[i]<8000) shougou=3;
6025 if(skill_exp[i]<4000) shougou=0;
6026 else if(skill_exp[i]<6000) shougou=1;
6027 else if(skill_exp[i]<7000) shougou=2;
6028 else if(skill_exp[i]<8000) shougou=3;
6031 fprintf(fff,"%-20s ",skill_name[i]);
6032 if (skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6033 else fprintf(fff," ");
6034 fprintf(fff,"%s",shougou_moji[shougou]);
6035 if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
6039 /* Close the file */
6042 /* Display the file contents */
6044 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6046 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6050 /* Remove the file */
6056 * Pluralize a monster name
6058 void plural_aux(char *Name)
6060 int NameLen = strlen(Name);
6062 if (strstr(Name, "Disembodied hand"))
6064 strcpy(Name, "Disembodied hands that strangled people");
6066 else if (strstr(Name, "Colour out of space"))
6068 strcpy(Name, "Colours out of space");
6070 else if (strstr(Name, "stairway to hell"))
6072 strcpy(Name, "stairways to hell");
6074 else if (strstr(Name, "Dweller on the threshold"))
6076 strcpy(Name, "Dwellers on the threshold");
6078 else if (strstr(Name, " of "))
6080 cptr aider = strstr(Name, " of ");
6091 if (dummy[i-1] == 's')
6093 strcpy(&(dummy[i]), "es");
6098 strcpy(&(dummy[i]), "s");
6101 strcpy(&(dummy[i+1]), aider);
6102 strcpy(Name, dummy);
6104 else if (strstr(Name, "coins"))
6107 strcpy(dummy, "piles of ");
6108 strcat(dummy, Name);
6109 strcpy(Name, dummy);
6112 else if (strstr(Name, "Manes"))
6116 else if (streq(&(Name[NameLen - 2]), "ey"))
6118 strcpy(&(Name[NameLen - 2]), "eys");
6120 else if (Name[NameLen - 1] == 'y')
6122 strcpy(&(Name[NameLen - 1]), "ies");
6124 else if (streq(&(Name[NameLen - 4]), "ouse"))
6126 strcpy(&(Name[NameLen - 4]), "ice");
6128 else if (streq(&(Name[NameLen - 2]), "us"))
6130 strcpy(&(Name[NameLen - 2]), "i");
6132 else if (streq(&(Name[NameLen - 6]), "kelman"))
6134 strcpy(&(Name[NameLen - 6]), "kelmen");
6136 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6138 strcpy(&(Name[NameLen - 8]), "wordsmen");
6140 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6142 strcpy(&(Name[NameLen - 7]), "oodsmen");
6144 else if (streq(&(Name[NameLen - 7]), "eastman"))
6146 strcpy(&(Name[NameLen - 7]), "eastmen");
6148 else if (streq(&(Name[NameLen - 8]), "izardman"))
6150 strcpy(&(Name[NameLen - 8]), "izardmen");
6152 else if (streq(&(Name[NameLen - 5]), "geist"))
6154 strcpy(&(Name[NameLen - 5]), "geister");
6156 else if (streq(&(Name[NameLen - 2]), "ex"))
6158 strcpy(&(Name[NameLen - 2]), "ices");
6160 else if (streq(&(Name[NameLen - 2]), "lf"))
6162 strcpy(&(Name[NameLen - 2]), "lves");
6164 else if (suffix(Name, "ch") ||
6165 suffix(Name, "sh") ||
6166 suffix(Name, "nx") ||
6167 suffix(Name, "s") ||
6170 strcpy(&(Name[NameLen]), "es");
6174 strcpy(&(Name[NameLen]), "s");
6179 * Display current pets
6181 static void do_cmd_knowledge_pets(void)
6185 monster_type *m_ptr;
6187 int show_upkeep = 0;
6188 char file_name[1024];
6191 /* Open a new file */
6192 fff = my_fopen_temp(file_name, 1024);
6195 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6197 msg_format("Failed to create temporary file %s.", file_name);
6203 /* Process the monsters (backwards) */
6204 for (i = m_max - 1; i >= 1; i--)
6206 monster_race *r_ptr;
6207 /* Access the monster */
6210 /* Ignore "dead" monsters */
6211 if (!m_ptr->r_idx) continue;
6212 r_ptr = &r_info[m_ptr->r_idx];
6214 /* Calculate "upkeep" for pets */
6219 monster_desc(pet_name, m_ptr, 0x88);
6220 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6221 if (p_ptr->riding == i)
6223 fprintf(fff, " ¾èÇÏÃæ");
6225 fprintf(fff, " Riding");
6231 show_upkeep = calculate_upkeep();
6233 fprintf(fff, "----------------------------------------------\n");
6235 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6236 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6238 fprintf(fff, " Total: %d pet%s.\n",
6239 t_friends, (t_friends == 1 ? "" : "s"));
6240 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6245 /* Close the file */
6248 /* Display the file contents */
6250 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6252 show_file(TRUE, file_name, "Current Pets", 0, 0);
6256 /* Remove the file */
6264 * Note that the player ghosts are ignored. XXX XXX XXX
6266 static void do_cmd_knowledge_kill_count(void)
6274 char file_name[1024];
6279 /* Open a new file */
6280 fff = my_fopen_temp(file_name, 1024);
6284 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6286 msg_format("Failed to create temporary file %s.", file_name);
6292 /* Allocate the "who" array */
6293 C_MAKE(who, max_r_idx, s16b);
6296 /* Monsters slain */
6299 for (kk = 1; kk < max_r_idx; kk++)
6301 monster_race *r_ptr = &r_info[kk];
6303 if (r_ptr->flags1 & (RF1_UNIQUE))
6305 bool dead = (r_ptr->max_num == 0);
6314 s16b This = r_ptr->r_pkills;
6325 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6327 fprintf(fff,"You have defeated no enemies yet.\n\n");
6330 else if (Total == 1)
6332 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6334 fprintf(fff,"You have defeated one enemy.\n\n");
6339 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6341 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6348 /* Scan the monsters */
6349 for (i = 1; i < max_r_idx; i++)
6351 monster_race *r_ptr = &r_info[i];
6353 /* Use that monster */
6354 if (r_ptr->name) who[n++] = i;
6357 /* Select the sort method */
6358 ang_sort_comp = ang_sort_comp_hook;
6359 ang_sort_swap = ang_sort_swap_hook;
6361 /* Sort the array by dungeon depth of monsters */
6362 ang_sort(who, &why, n);
6364 /* Scan the monster races */
6365 for (k = 0; k < n; k++)
6367 monster_race *r_ptr = &r_info[who[k]];
6369 if (r_ptr->flags1 & (RF1_UNIQUE))
6371 bool dead = (r_ptr->max_num == 0);
6375 /* Print a message */
6376 fprintf(fff, " %s\n",
6377 (r_name + r_ptr->name));
6383 s16b This = r_ptr->r_pkills;
6388 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6389 if(strchr("pt",r_ptr->d_char))
6390 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6392 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6396 if (strstr(r_name + r_ptr->name, "coins"))
6398 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6402 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6408 strcpy(ToPlural, (r_name + r_ptr->name));
6409 plural_aux(ToPlural);
6410 fprintf(fff, " %d %s\n", This, ToPlural);
6420 fprintf(fff,"----------------------------------------------\n");
6422 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6424 fprintf(fff," Total: %lu creature%s killed.\n",
6425 Total, (Total == 1 ? "" : "s"));
6429 /* Free the "who" array */
6430 C_KILL(who, max_r_idx, s16b);
6432 /* Close the file */
6435 /* Display the file contents */
6437 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6439 show_file(TRUE, file_name, "Kill Count", 0, 0);
6443 /* Remove the file */
6449 * Display known objects
6451 static void do_cmd_knowledge_objects(void)
6457 char o_name[MAX_NLEN];
6459 char file_name[1024];
6462 /* Open a new file */
6463 fff = my_fopen_temp(file_name, 1024);
6466 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6468 msg_format("Failed to create temporary file %s.", file_name);
6474 /* Scan the object kinds */
6475 for (k = 1; k < max_k_idx; k++)
6477 object_kind *k_ptr = &k_info[k];
6479 /* Hack -- skip artifacts */
6480 if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
6482 /* List known flavored objects */
6483 if (k_ptr->flavor && k_ptr->aware)
6486 object_type object_type_body;
6488 /* Get local object */
6489 i_ptr = &object_type_body;
6491 /* Create fake object */
6492 object_prep(i_ptr, k);
6494 /* Describe the object */
6495 object_desc_store(o_name, i_ptr, FALSE, 0);
6497 /* Print a message */
6498 fprintf(fff, " %s\n", o_name);
6502 /* Close the file */
6505 /* Display the file contents */
6507 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6509 show_file(TRUE, file_name, "Known Objects", 0, 0);
6513 /* Remove the file */
6519 * List virtues & status
6522 void do_cmd_knowledge_kubi(void)
6527 char file_name[1024];
6530 /* Open a new file */
6531 fff = my_fopen_temp(file_name, 1024);
6534 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6536 msg_format("Failed to create temporary file %s.", file_name);
6545 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6547 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6549 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6551 fprintf(fff, "List of wanted monsters\n");
6553 for (i = 0; i < MAX_KUBI; i++)
6555 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6556 if (kubi_r_idx[i] > 10000)
6558 fprintf(fff, "ºÑ\n");
6560 fprintf(fff, "done\n");
6563 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6567 /* Close the file */
6570 /* Display the file contents */
6572 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6574 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6578 /* Remove the file */
6583 * List virtues & status
6586 void do_cmd_knowledge_virtues(void)
6590 char file_name[1024];
6593 /* Open a new file */
6594 fff = my_fopen_temp(file_name, 1024);
6597 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6599 msg_format("Failed to create temporary file %s.", file_name);
6608 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6610 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6615 /* Close the file */
6618 /* Display the file contents */
6620 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6622 show_file(TRUE, file_name, "Virtues", 0, 0);
6626 /* Remove the file */
6634 void do_cmd_knowledge_dungeon(void)
6638 char file_name[1024];
6642 /* Open a new file */
6643 fff = my_fopen_temp(file_name, 1024);
6646 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6648 msg_format("Failed to create temporary file %s.", file_name);
6656 for (i = 1; i < max_d_idx; i++)
6660 if (!d_info[i].maxdepth) continue;
6661 if (!max_dlv[i]) continue;
6662 if (d_info[i].final_guardian)
6664 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6666 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6668 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6670 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6675 /* Close the file */
6678 /* Display the file contents */
6680 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6682 show_file(TRUE, file_name, "Dungeon", 0, 0);
6686 /* Remove the file */
6691 * List virtues & status
6694 static void do_cmd_knowledge_stat(void)
6698 char file_name[1024];
6701 /* Open a new file */
6702 fff = my_fopen_temp(file_name, 1024);
6705 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6707 msg_format("Failed to create temporary file %s.", file_name);
6715 percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
6716 (2 * p_ptr->hitdie +
6717 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6720 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6721 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6722 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6724 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6725 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6726 fprintf(fff, "Limits of maximum stats\n\n");
6728 for (v_nr = 0; v_nr < 6; v_nr++)
6730 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);
6731 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6737 /* Close the file */
6740 /* Display the file contents */
6742 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6744 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6748 /* Remove the file */
6753 * Print quest status of all active quests
6755 static void do_cmd_knowledge_quests(void)
6758 char file_name[1024];
6760 char rand_tmp_str[120] = "\0";
6762 monster_race *r_ptr;
6764 int rand_level = 100;
6767 /* Open a new file */
6768 fff = my_fopen_temp(file_name, 1024);
6771 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6773 msg_format("Failed to create temporary file %s.", file_name);
6780 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6782 fprintf(fff, "< Current Quest >\n");
6785 for (i = 1; i < max_quests; i++)
6787 /* No info from "silent" quests */
6788 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6790 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6795 /* Clear the text */
6796 for (j = 0; j < 10; j++)
6798 quest_text[j][0] = '\0';
6801 quest_text_line = 0;
6805 /* Set the quest number temporary */
6806 old_quest = p_ptr->inside_quest;
6807 p_ptr->inside_quest = i;
6809 /* Get the quest text */
6810 init_flags = INIT_SHOW_TEXT;
6812 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6814 /* Reset the old quest number */
6815 p_ptr->inside_quest = old_quest;
6817 if (quest[i].type != QUEST_TYPE_RANDOM)
6819 char note[80] = "\0";
6821 if (quest[i].status == QUEST_STATUS_TAKEN)
6823 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6825 r_ptr = &r_info[quest[i].r_idx];
6826 strcpy(name, r_name + r_ptr->name);
6827 if (quest[i].max_num > 1)
6830 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6833 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
6838 sprintf(note," - %s¤òÅݤ¹¡£",name);
6840 sprintf(note," - kill %s.",name);
6843 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
6846 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
6848 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
6851 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
6853 strcpy(name, a_name + a_info[quest[i].k_idx].name);
6855 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
6857 sprintf(note," - Find out %s.", name);
6860 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
6862 sprintf(note," - õº÷¤¹¤ë¡£");
6864 sprintf(note," - Search.");
6866 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
6868 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
6870 sprintf(note," - Kill all monsters.");
6874 /* Print the quest info */
6876 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
6878 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
6881 quest[i].name, quest[i].level, note);
6883 fprintf(fff, tmp_str);
6885 if (quest[i].status == QUEST_STATUS_COMPLETED)
6888 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
6890 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
6894 fprintf(fff, tmp_str);
6900 while (quest_text[j][0] && j < 10)
6902 fprintf(fff, " %s\n", quest_text[j]);
6907 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
6908 (quest[i].level < rand_level))
6911 rand_level = quest[i].level;
6913 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6915 /* Print the quest info */
6916 r_ptr = &r_info[quest[i].r_idx];
6917 strcpy(name, r_name + r_ptr->name);
6919 if (quest[i].max_num > 1)
6922 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
6923 quest[i].name, quest[i].level,
6924 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6928 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6929 quest[i].name, quest[i].level,
6930 quest[i].max_num, name, quest[i].cur_num);
6937 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
6939 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
6942 quest[i].name, quest[i].level, name);
6949 /* Print the current random quest */
6950 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
6953 if (!total) fprintf(fff, "¤Ê¤·\n");
6955 if (!total) fprintf(fff, "Nothing.\n");
6959 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
6961 fprintf(fff, "\n< Completed Quest >\n");
6964 for (i = 1; i < max_quests; i++)
6966 /* No info from "silent" quests */
6967 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6969 if (quest[i].status == QUEST_STATUS_FINISHED)
6975 if (i < MIN_RANDOM_QUEST)
6977 /* Set the quest number temporary */
6978 old_quest = p_ptr->inside_quest;
6979 p_ptr->inside_quest = i;
6982 init_flags = INIT_ASSIGN;
6984 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6986 /* Reset the old quest number */
6987 p_ptr->inside_quest = old_quest;
6990 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
6992 /* Print the quest info */
6994 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
6996 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
6999 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7003 /* Print the quest info */
7005 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7007 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7010 quest[i].name, quest[i].level, quest[i].complev);
7013 fprintf(fff, tmp_str);
7017 if (!total) fprintf(fff, "¤Ê¤·\n");
7019 if (!total) fprintf(fff, "Nothing.\n");
7023 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7025 fprintf(fff, "\n< Failed Quest >\n");
7028 for (i = 1; i < max_quests; i++)
7030 /* No info from "silent" quests */
7031 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7033 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7039 if (i < MIN_RANDOM_QUEST)
7041 /* Set the quest number temporary */
7042 old_quest = p_ptr->inside_quest;
7043 p_ptr->inside_quest = i;
7045 /* Get the quest text */
7046 init_flags = INIT_ASSIGN;
7048 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7050 /* Reset the old quest number */
7051 p_ptr->inside_quest = old_quest;
7054 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7056 /* Print the quest info */
7058 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7060 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7063 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7067 /* Print the quest info */
7069 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7071 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7074 quest[i].name, quest[i].level, quest[i].complev);
7076 fprintf(fff, tmp_str);
7080 if (!total) fprintf(fff, "¤Ê¤·\n");
7082 if (!total) fprintf(fff, "Nothing.\n");
7087 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7089 fprintf(fff, "\n< Remaining Random Quest >\n");
7092 for (i = 1; i < max_quests; i++)
7094 /* No info from "silent" quests */
7095 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7097 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7101 /* Print the quest info */
7103 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7105 sprintf(tmp_str, "%s (%d, %s)\n",
7108 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7109 fprintf(fff, tmp_str);
7113 if (!total) fprintf(fff, "¤Ê¤·\n");
7115 if (!total) fprintf(fff, "Nothing.\n");
7119 /* Close the file */
7122 /* Display the file contents */
7124 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7126 show_file(TRUE, file_name, "Quest status", 0, 0);
7130 /* Remove the file */
7140 void do_cmd_knowledge_home(void)
7145 char file_name[1024];
7147 char o_name[MAX_NLEN];
7150 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7152 /* Open a new file */
7153 fff = my_fopen_temp(file_name, 1024);
7156 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7158 msg_format("Failed to create temporary file %s.", file_name);
7166 /* Print all homes in the different towns */
7167 st_ptr = &town[1].store[STORE_HOME];
7169 /* Home -- if anything there */
7170 if (st_ptr->stock_num)
7172 /* Header with name of the town */
7174 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7176 fprintf(fff, " [Home Inventory]\n");
7180 /* Dump all available items */
7181 for (i = 0; i < st_ptr->stock_num; i++)
7184 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7185 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7186 if (strlen(o_name) <= 80-3)
7188 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7194 for (n = 0, t = o_name; n < 80-3; n++, t++)
7195 if(iskanji(*t)) {t++; n++;}
7196 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7198 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7199 fprintf(fff, " %.77s\n", o_name+n);
7202 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7203 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7208 /* Add an empty line */
7209 fprintf(fff, "\n\n");
7213 /* Close the file */
7216 /* Display the file contents */
7218 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7220 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7224 /* Remove the file */
7230 * Check the status of "autopick"
7232 static void do_cmd_knowledge_autopick(void)
7236 char file_name[1024];
7238 /* Open a new file */
7239 fff = my_fopen_temp(file_name, 1024);
7244 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7246 msg_format("Failed to create temporary file %s.", file_name);
7255 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7257 fprintf(fff, "No preference for auto picker/destroyer.");
7263 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7265 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7269 for (k = 0; k < max_autopick; k++)
7272 byte act = autopick_action[k];
7273 if (act & DONT_AUTOPICK)
7281 else if (act & DO_AUTODESTROY)
7298 if (act & DO_DISPLAY)
7299 fprintf(fff, "%11s", format("[%s]", tmp));
7301 fprintf(fff, "%11s", format("(%s)", tmp));
7303 fprintf(fff, " %s", autopick_name[k]);
7304 if(autopick_insc[k] != NULL)
7305 fprintf(fff, " {%s}", autopick_insc[k]);
7308 /* Close the file */
7310 /* Display the file contents */
7312 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7314 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7317 /* Remove the file */
7324 * Interact with "knowledge"
7326 void do_cmd_knowledge(void)
7329 /* File type is "TEXT" */
7330 FILE_TYPE(FILE_TYPE_TEXT);
7331 /* Save the screen */
7333 /* Interact until done */
7338 /* Ask for a choice */
7340 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7341 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7343 prt(format("page %d/2", (p+1)), 2, 65);
7344 prt("Display current knowledge", 3, 0);
7347 /* Give some choices */
7350 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7351 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7352 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7353 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7354 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7355 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7356 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7357 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7358 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7360 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7361 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7362 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7363 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7364 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7365 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7366 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7367 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7368 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7372 prt("(1) Display known artifacts", 6, 5);
7373 prt("(2) Display known objects", 7, 5);
7374 prt("(3) Display remaining uniques", 8, 5);
7375 prt("(4) Display dead uniques", 9, 5);
7376 prt("(5) Display kill count", 10, 5);
7377 prt("(6) Display wanted monsters", 11, 5);
7378 prt("(7) Display current pets", 12, 5);
7379 prt("(8) Display home inventory", 13, 5);
7380 prt("(9) Display *identified* equip.", 14, 5);
7382 prt("(a) Display about yourself", 6, 5);
7383 prt("(b) Display mutations", 7, 5);
7384 prt("(c) Display weapon proficiency", 8, 5);
7385 prt("(d) Display spell proficiency", 9, 5);
7386 prt("(e) Display misc. proficiency", 10, 5);
7387 prt("(f) Display virtues", 11, 5);
7388 prt("(g) Display dungeons", 12, 5);
7389 prt("(h) Display current quests", 13, 5);
7390 prt("(i) Display auto pick/destroy", 14, 5);
7395 prt("-³¤¯-", 16, 8);
7396 prt("ESC) È´¤±¤ë", 21, 1);
7397 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7398 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7399 prt("¥³¥Þ¥ó¥É:", 20, 0);
7401 prt("-more-", 16, 8);
7402 prt("ESC) Exit menu", 21, 1);
7403 prt("SPACE) Next page", 21, 30);
7404 /*prt("-) Previous page", 21, 60);*/
7405 prt("Command: ", 20, 0);
7411 if (i == ESCAPE) break;
7414 case ' ': /* Page change */
7418 case '1': /* Artifacts */
7419 do_cmd_knowledge_artifacts();
7421 case '2': /* Objects */
7422 do_cmd_knowledge_objects();
7424 case '3': /* Uniques */
7425 do_cmd_knowledge_uniques();
7427 case '4': /* Uniques */
7428 do_cmd_knowledge_uniques_dead();
7430 case '5': /* Kill count */
7431 do_cmd_knowledge_kill_count();
7433 case '6': /* wanted */
7434 do_cmd_knowledge_kubi();
7436 case '7': /* Pets */
7437 do_cmd_knowledge_pets();
7439 case '8': /* Home */
7440 do_cmd_knowledge_home();
7442 case '9': /* Resist list */
7443 do_cmd_knowledge_inven();
7446 case 'a': /* Max stat */
7447 do_cmd_knowledge_stat();
7449 case 'b': /* Mutations */
7450 do_cmd_knowledge_mutations();
7452 case 'c': /* weapon-exp */
7453 do_cmd_knowledge_weapon_exp();
7455 case 'd': /* spell-exp */
7456 do_cmd_knowledge_spell_exp();
7458 case 'e': /* skill-exp */
7459 do_cmd_knowledge_skill_exp();
7461 case 'f': /* Virtues */
7462 do_cmd_knowledge_virtues();
7464 case 'g': /* Dungeon */
7465 do_cmd_knowledge_dungeon();
7467 case 'h': /* Quests */
7468 do_cmd_knowledge_quests();
7470 case 'i': /* Autopick */
7471 do_cmd_knowledge_autopick();
7473 default: /* Unknown option */
7476 /* Flush messages */
7479 /* Restore the screen */
7485 * Check on the status of an active quest
7487 void do_cmd_checkquest(void)
7489 /* File type is "TEXT" */
7490 FILE_TYPE(FILE_TYPE_TEXT);
7492 /* Save the screen */
7496 do_cmd_knowledge_quests();
7498 /* Restore the screen */
7504 * Display the time and date
7506 void do_cmd_time(void)
7508 int day, hour, min, full, start, end, num;
7515 s32b len = 20L * TOWN_DAWN;
7516 s32b tick = turn % len + len / 4;
7518 if ((p_ptr->prace == RACE_VAMPIRE) ||
7519 (p_ptr->prace == RACE_SKELETON) ||
7520 (p_ptr->prace == RACE_ZOMBIE) ||
7521 (p_ptr->prace == RACE_SPECTRE))
7522 day = (turn - (15L * TOWN_DAWN))/ len + 1;
7524 day = (turn + (5L * TOWN_DAWN))/ len + 1;
7525 hour = (24 * tick / len) % 24;
7526 min = (1440 * tick / len) % 60;
7527 full = hour * 100 + min;
7535 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7537 strcpy(desc, "It is a strange time.");
7543 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7545 msg_format("This is day %d. The time is %d:%02d %s.",
7548 day, (hour % 12 == 0) ? 12 : (hour % 12),
7549 min, (hour < 12) ? "AM" : "PM");
7552 if (!randint0(10) || p_ptr->image)
7555 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7557 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7564 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7566 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7571 /* Open this file */
7572 fff = my_fopen(buf, "rt");
7577 /* Find this time */
7578 while (!my_fgets(fff, buf, 1024))
7580 /* Ignore comments */
7581 if (!buf[0] || (buf[0] == '#')) continue;
7583 /* Ignore invalid lines */
7584 if (buf[1] != ':') continue;
7586 /* Process 'Start' */
7589 /* Extract the starting time */
7590 start = atoi(buf + 2);
7592 /* Assume valid for an hour */
7602 /* Extract the ending time */
7603 end = atoi(buf + 2);
7609 /* Ignore incorrect range */
7610 if ((start > full) || (full > end)) continue;
7612 /* Process 'Description' */
7617 /* Apply the randomizer */
7618 if (!randint0(num)) strcpy(desc, buf + 2);
7628 /* Close the file */