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];
143 sprintf(header_mark_str, auto_dump_header, mark);
145 /* Remove old macro dumps */
146 remove_auto_dump(buf, mark);
148 /* Append to the file */
149 fff = my_fopen(buf, "a");
154 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
156 msg_format("Failed to open %s.", buf);
163 fprintf(fff, "%s\n", header_mark_str);
166 fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
167 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
169 fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
170 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
178 * Append foot part and close auto dump.
180 static void close_auto_dump(FILE *fff, cptr mark, int line_num)
182 char footer_mark_str[80];
184 sprintf(footer_mark_str, auto_dump_footer, mark);
188 fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
189 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
191 fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
192 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
196 fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
205 * Take note to the dialy.
208 errr do_cmd_write_nikki(int type, int num, cptr note)
214 cptr note_level = "";
215 bool do_level = TRUE;
217 s32b len = 20L * TOWN_DAWN;
218 s32b tick = turn % len + len / 4;
220 static bool disable_nikki = FALSE;
222 if (disable_nikki) return(-1);
224 if ((p_ptr->prace == RACE_VAMPIRE) ||
225 (p_ptr->prace == RACE_SKELETON) ||
226 (p_ptr->prace == RACE_ZOMBIE) ||
227 (p_ptr->prace == RACE_SPECTRE))
228 day = (turn - (15L * TOWN_DAWN))/ len + 1;
230 day = (turn + (5L * TOWN_DAWN))/ len + 1;
232 hour = (24 * tick / len) % 24;
233 min = (1440 * tick / len) % 60;
235 if (type == NIKKI_FIX_QUEST_C ||
236 type == NIKKI_FIX_QUEST_F ||
237 type == NIKKI_RAND_QUEST_C ||
238 type == NIKKI_RAND_QUEST_F ||
239 type == NIKKI_TO_QUEST)
243 old_quest = p_ptr->inside_quest;
244 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
246 /* Get the quest text */
247 init_flags = INIT_ASSIGN;
249 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
251 /* Reset the old quest number */
252 p_ptr->inside_quest = old_quest;
256 sprintf(file_name,"playrecord-%s.txt",savefile_base);
258 /* different filne name to avoid mixing */
259 sprintf(file_name,"playrec-%s.txt",savefile_base);
262 /* Build the filename */
263 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
265 /* File type is "TEXT" */
266 FILE_TYPE(FILE_TYPE_TEXT);
268 fff = my_fopen(buf, "a");
273 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
275 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
284 if (p_ptr->inside_arena)
286 note_level = "¥¢¥ê¡¼¥Ê:";
288 note_level = "Arane:";
292 note_level = "ÃϾå:";
294 note_level = "Surface:";
296 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)))
298 note_level = "¥¯¥¨¥¹¥È:";
300 note_level = "Quest:";
304 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
306 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
315 fprintf(fff, "%dÆüÌÜ\n",day);
317 fprintf(fff, "Day %d\n",day);
326 fprintf(fff, "%s\n",note);
330 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
336 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
338 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
345 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
347 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
351 case NIKKI_FIX_QUEST_C:
353 if (quest[num].flags & QUEST_FLAG_SILENT) break;
355 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
357 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
361 case NIKKI_FIX_QUEST_F:
363 if (quest[num].flags & QUEST_FLAG_SILENT) break;
365 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
367 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
371 case NIKKI_RAND_QUEST_C:
374 strcpy(name, r_name+r_info[quest[num].r_idx].name);
376 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
378 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
382 case NIKKI_RAND_QUEST_F:
385 strcpy(name, r_name+r_info[quest[num].r_idx].name);
387 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
389 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
393 case NIKKI_MAXDEAPTH:
396 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
398 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);
405 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
407 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);
414 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
425 if (!(dun_level+num)) to = "ÃϾå";
426 else to = format("%d³¬", dun_level+num);
428 if (!(dun_level+num)) to = "the surfice";
429 else to = format("level %d", dun_level+num);
434 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
436 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
444 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
446 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);
450 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
452 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
458 if (quest[num].flags & QUEST_FLAG_SILENT) break;
460 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
462 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
477 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)))
488 if (!(dun_level+num)) to = "ÃϾå";
489 else to = format("%d³¬", dun_level+num);
491 if (!(dun_level+num)) to = "surface";
492 else to = format("level %d", dun_level+num);
497 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
499 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
506 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
508 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
515 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
517 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
524 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
526 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);
528 if (num == MAX_ARENA_MONS)
531 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
533 fprintf(fff, " win all fight to become a Chanpion.\n");
542 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
544 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
559 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
561 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
565 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
567 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
574 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
576 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
580 case NIKKI_GAMESTART:
582 time_t ct = time((time_t*)0);
586 fprintf(fff, "%s %s",note, ctime(&ct));
589 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
592 case NIKKI_NAMED_PET:
594 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
599 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
601 fprintf(fff, "decide to travel together with %s.\n", note);
606 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
608 fprintf(fff, "unname %s.\n", note);
613 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
615 fprintf(fff, "dismiss %s.\n", note);
620 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
622 fprintf(fff, "%s die.\n", note);
627 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
629 fprintf(fff, "move to other map leaving %s behind.\n", note);
634 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
636 fprintf(fff, "lose sight of %s.\n", note);
641 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
643 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
648 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
650 fprintf(fff, "%s is crushed by falling rocks.\n", note);
665 if (do_level) write_level = FALSE;
671 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
673 static void do_cmd_disp_nikki(void)
675 char nikki_title[256];
680 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
681 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
692 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
693 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
694 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
695 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
700 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
709 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
711 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
712 "Attack is the best form of defence.",
714 "An unexpected windfall",
715 "A drowning man will catch at a straw",
716 "Don't count your chickens before they are hatched.",
717 "It is no use crying over spilt milk.",
718 "Seeing is believing.",
719 "Strike the iron while it is hot.",
720 "I don't care what follows.",
721 "To dig a well to put out a house on fire.",
722 "Tomorrow is another day.",
723 "Easy come, easy go.",
724 "The more haste, the less speed.",
725 "Where there is life, there is hope.",
726 "There is no royal road to *WINNER*.",
727 "Danger past, God forgotten.",
728 "The best thing to do now is to run away.",
729 "Life is but an empty dream.",
730 "Dead men tell no tales.",
731 "A book that remains shut is but a block.",
732 "Misfortunes never come singly.",
733 "A little knowledge is a dangerous thing.",
734 "History repeats itself.",
735 "*WINNER* was not built in a day.",
736 "Ignorance is bliss.",
737 "To lose is to win?",
738 "No medicine can cure folly.",
739 "All good things come to an end.",
740 "M$ Empire strikes back.",
741 "To see is to believe",
743 "Quest of The World's Greatest Brain"};
746 sprintf(file_name,"playrecord-%s.txt",savefile_base);
748 sprintf(file_name,"playrec-%s.txt",savefile_base);
751 /* Build the filename */
752 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
754 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
755 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)]);
756 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
757 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)+1]);
758 else strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-2)+1]);
761 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
762 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
764 sprintf(nikki_title, "Legend of %s %s '%s'",
765 ap_ptr->title, player_name, tmp);
768 /* Display the file contents */
769 show_file(FALSE, buf, nikki_title, -1, 0);
772 static void do_cmd_bunshou(void)
775 char bunshou[80] = "\0";
778 if (get_string("ÆâÍÆ: ", tmp, 79))
780 if (get_string("diary note: ", tmp, 79))
783 strcpy(bunshou, tmp);
785 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
789 static void do_cmd_last_get(void)
794 if (record_o_name[0] == '\0') return;
797 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
799 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
801 if (!get_check(buf)) return;
806 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
808 sprintf(buf,"descover %s.", record_o_name);
810 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
814 static void do_cmd_erase_nikki(void)
821 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
823 if (!get_check("Do you really want to delete all your record? ")) return;
827 sprintf(file_name,"playrecord-%s.txt",savefile_base);
829 sprintf(file_name,"playrec-%s.txt",savefile_base);
832 /* Build the filename */
833 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
835 /* Remove the file */
838 fff = my_fopen(buf, "w");
842 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
844 msg_format("deleted record.");
848 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
850 msg_format("failed to delete %s.", buf);
859 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
865 void do_cmd_nikki(void)
869 /* File type is "TEXT" */
870 FILE_TYPE(FILE_TYPE_TEXT);
872 /* Save the screen */
875 /* Interact until done */
881 /* Ask for a choice */
883 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
885 prt("[ Play Record ]", 2, 0);
889 /* Give some choices */
891 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
892 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
893 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
894 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
896 prt("(1) Display your record", 4, 5);
897 prt("(2) Add record", 5, 5);
898 prt("(3) Record item you last get/identify", 6, 5);
899 prt("(4) Delete your record", 7, 5);
905 prt("¥³¥Þ¥ó¥É:", 18, 0);
907 prt("Command: ", 18, 0);
915 if (i == ESCAPE) break;
929 do_cmd_erase_nikki();
936 default: /* Unknown option */
944 /* Restore the screen */
949 * Hack -- redraw the screen
951 * This command performs various low level updates, clears all the "extra"
952 * windows, does a total redraw of the main window, and requests all of the
953 * interesting updates and redraws that I can think of.
955 * This command is also used to "instantiate" the results of the user
956 * selecting various things, such as graphics mode, so it must call
957 * the "TERM_XTRA_REACT" hook before redrawing the windows.
959 void do_cmd_redraw(void)
966 /* Hack -- react to changes */
967 Term_xtra(TERM_XTRA_REACT, 0);
970 /* Combine and Reorder the pack (later) */
971 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
975 p_ptr->update |= (PU_TORCH);
978 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
980 /* Forget lite/view */
981 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
983 /* Update lite/view */
984 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
986 /* Update monsters */
987 p_ptr->update |= (PU_MONSTERS);
989 /* Redraw everything */
990 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
993 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
996 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1000 /* Hack -- update */
1003 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1006 /* Redraw every window */
1007 for (j = 0; j < 8; j++)
1010 if (!angband_term[j]) continue;
1013 Term_activate(angband_term[j]);
1028 * Hack -- change name
1030 void do_cmd_change_name(void)
1039 /* Save the screen */
1047 /* Display the player */
1048 display_player(mode);
1053 display_player(mode);
1058 Term_putstr(2, 23, -1, TERM_WHITE,
1059 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1061 Term_putstr(2, 23, -1, TERM_WHITE,
1062 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1070 if (c == ESCAPE) break;
1081 sprintf(tmp, "%s.txt", player_base);
1083 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1085 if (get_string("File name: ", tmp, 80))
1089 if (tmp[0] && (tmp[0] != ' '))
1091 file_character(tmp, TRUE);
1108 /* Flush messages */
1112 /* Restore the screen */
1115 /* Redraw everything */
1116 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1123 * Recall the most recent message
1125 void do_cmd_message_one(void)
1127 /* Recall one message XXX XXX XXX */
1128 prt(format("> %s", message_str(0)), 0, 0);
1133 * Show previous messages to the user -BEN-
1135 * The screen format uses line 0 and 23 for headers and prompts,
1136 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1138 * This command shows you which commands you are viewing, and allows
1139 * you to "search" for strings in the recall.
1141 * Note that messages may be longer than 80 characters, but they are
1142 * displayed using "infinite" length, with a special sub-command to
1143 * "slide" the virtual display to the left or right.
1145 * Attempt to only hilite the matching portions of the string.
1147 void do_cmd_messages(int num_now)
1163 /* Total messages */
1166 /* Start on first message */
1169 /* Start at leftmost edge */
1172 /* Save the screen */
1175 /* Process requests until done */
1181 /* Dump up to 20 lines of messages */
1182 for (j = 0; (j < 20) && (i + j < n); j++)
1184 cptr msg = message_str(i+j);
1186 /* Apply horizontal scroll */
1187 msg = (strlen(msg) >= q) ? (msg + q) : "";
1189 /* Dump the messages, bottom to top */
1190 Term_putstr(0, 21-j, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1192 /* Hilite "shower" */
1197 /* Display matches */
1198 while ((str = strstr(str, shower)) != NULL)
1200 int len = strlen(shower);
1202 /* Display the match */
1203 Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
1211 /* Display header XXX XXX XXX */
1214 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1215 i, i+j-1, n, q), 0, 0);
1217 prt(format("Message Recall (%d-%d of %d), Offset %d",
1218 i, i+j-1, n, q), 0, 0);
1222 /* Display prompt (not very informative) */
1224 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", 23, 0);
1226 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0);
1233 /* Exit on Escape */
1234 if (k == ESCAPE) break;
1236 /* Hack -- Save the old index */
1239 /* Horizontal scroll */
1243 q = (q >= 40) ? (q - 40) : 0;
1249 /* Horizontal scroll */
1259 /* Hack -- handle show */
1264 prt("¶¯Ä´: ", 23, 0);
1266 prt("Show: ", 23, 0);
1270 /* Get a "shower" string, or continue */
1271 if (!askfor_aux(shower, 80)) continue;
1277 /* Hack -- handle find */
1284 prt("¸¡º÷: ", 23, 0);
1286 prt("Find: ", 23, 0);
1290 /* Get a "finder" string, or continue */
1291 if (!askfor_aux(finder, 80)) continue;
1294 strcpy(shower, finder);
1297 for (z = i + 1; z < n; z++)
1299 cptr msg = message_str(z);
1302 if (strstr(msg, finder))
1313 /* Recall 1 older message */
1314 if ((k == '8') || (k == '\n') || (k == '\r'))
1316 /* Go newer if legal */
1317 if (i + 1 < n) i += 1;
1320 /* Recall 10 older messages */
1323 /* Go older if legal */
1324 if (i + 10 < n) i += 10;
1327 /* Recall 20 older messages */
1328 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1330 /* Go older if legal */
1331 if (i + 20 < n) i += 20;
1334 /* Recall 20 newer messages */
1335 if ((k == 'n') || (k == KTRL('N')))
1337 /* Go newer (if able) */
1338 i = (i >= 20) ? (i - 20) : 0;
1341 /* Recall 10 newer messages */
1344 /* Go newer (if able) */
1345 i = (i >= 20) ? (i - 20) : 0;
1348 /* Recall 1 newer messages */
1351 /* Go newer (if able) */
1352 i = (i >= 1) ? (i - 1) : 0;
1355 /* Hack -- Error of some kind */
1359 /* Restore the screen */
1366 * Number of cheating options
1373 static option_type cheat_info[CHEAT_MAX] =
1375 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1377 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1379 "cheat_peek", "Peek into object creation" },
1383 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1385 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1387 "cheat_hear", "Peek into monster creation" },
1391 { &cheat_room, FALSE, 255, 0x04, 0x00,
1393 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1395 "cheat_room", "Peek into dungeon creation" },
1399 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1401 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1403 "cheat_xtra", "Peek into something else" },
1407 { &cheat_know, FALSE, 255, 0x10, 0x00,
1409 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1411 "cheat_know", "Know complete monster info" },
1415 { &cheat_live, FALSE, 255, 0x20, 0x00,
1417 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1419 "cheat_live", "Allow player to avoid death" }
1425 * Interact with some options for cheating
1427 static void do_cmd_options_cheat(cptr info)
1431 int i, k = 0, n = CHEAT_MAX;
1439 /* Interact with the player */
1442 /* Prompt XXX XXX XXX */
1444 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1446 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1452 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1453 prt(" << Ãí°Õ >>", 11, 0);
1454 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1455 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1456 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1458 /* Display the options */
1459 for (i = 0; i < n; i++)
1461 byte a = TERM_WHITE;
1463 /* Color current option */
1464 if (i == k) a = TERM_L_BLUE;
1466 /* Display the option text */
1467 sprintf(buf, "%-48s: %s (%s)",
1468 cheat_info[i].o_desc,
1470 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1472 (*cheat_info[i].o_var ? "yes" : "no "),
1475 cheat_info[i].o_text);
1476 c_prt(a, buf, i + 2, 0);
1479 /* Hilite current option */
1480 move_cursor(k + 2, 50);
1496 k = (n + k - 1) % n;
1515 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1517 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1519 noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1520 (*cheat_info[k].o_var) = TRUE;
1529 (*cheat_info[k].o_var) = FALSE;
1544 static option_type autosave_info[2] =
1546 { &autosave_l, FALSE, 255, 0x01, 0x00,
1548 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1550 "autosave_l", "Autosave when entering new levels" },
1554 { &autosave_t, FALSE, 255, 0x02, 0x00,
1556 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1558 "autosave_t", "Timed autosave" },
1564 static s16b toggle_frequency(s16b current)
1566 if (current == 0) return 50;
1567 if (current == 50) return 100;
1568 if (current == 100) return 250;
1569 if (current == 250) return 500;
1570 if (current == 500) return 1000;
1571 if (current == 1000) return 2500;
1572 if (current == 2500) return 5000;
1573 if (current == 5000) return 10000;
1574 if (current == 10000) return 25000;
1581 * Interact with some options for cheating
1583 static void do_cmd_options_autosave(cptr info)
1587 int i, k = 0, n = 2;
1595 /* Interact with the player */
1598 /* Prompt XXX XXX XXX */
1600 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1602 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1607 /* Display the options */
1608 for (i = 0; i < n; i++)
1610 byte a = TERM_WHITE;
1612 /* Color current option */
1613 if (i == k) a = TERM_L_BLUE;
1615 /* Display the option text */
1616 sprintf(buf, "%-48s: %s (%s)",
1617 autosave_info[i].o_desc,
1619 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1621 (*autosave_info[i].o_var ? "yes" : "no "),
1624 autosave_info[i].o_text);
1625 c_prt(a, buf, i + 2, 0);
1629 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1631 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1636 /* Hilite current option */
1637 move_cursor(k + 2, 50);
1653 k = (n + k - 1) % n;
1671 (*autosave_info[k].o_var) = TRUE;
1680 (*autosave_info[k].o_var) = FALSE;
1688 autosave_freq = toggle_frequency(autosave_freq);
1690 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1692 prt(format("Timed autosave frequency: every %d turns",
1695 autosave_freq), 5, 0);
1708 #define PAGE_AUTODESTROY 7
1711 * Interact with some options
1713 void do_cmd_options_aux(int page, cptr info)
1716 int i, k = 0, n = 0, l;
1721 /* Lookup the options */
1722 for (i = 0; i < 24; i++) opt[i] = 0;
1724 /* Scan the options */
1725 for (i = 0; option_info[i].o_desc; i++)
1727 /* Notice options on this "page" */
1728 if (option_info[i].o_page == page) opt[n++] = i;
1736 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
1738 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
1741 /* Interact with the player */
1744 /* Prompt XXX XXX XXX */
1746 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1748 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1753 /* Display the options */
1754 for (i = 0; i < n; i++)
1756 byte a = TERM_WHITE;
1758 /* Color current option */
1759 if (i == k) a = TERM_L_BLUE;
1761 /* Display the option text */
1762 sprintf(buf, "%-48s: %s (%.19s)",
1763 option_info[opt[i]].o_desc,
1765 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1767 (*option_info[opt[i]].o_var ? "yes" : "no "),
1770 option_info[opt[i]].o_text);
1771 if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
1772 else c_prt(a, buf, i + 2, 0);
1775 if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
1777 /* Hilite current option */
1778 move_cursor(k + 2 + l, 50);
1796 k = (n + k - 1) % n;
1817 (*option_info[opt[k]].o_var) = TRUE;
1828 (*option_info[opt[k]].o_var) = FALSE;
1836 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1851 * Modify the "window" options
1853 static void do_cmd_options_win(void)
1867 /* Memorize old flags */
1868 for (j = 0; j < 8; j++)
1870 /* Acquire current flags */
1871 old_flag[j] = window_flag[j];
1881 /* Prompt XXX XXX XXX */
1883 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1885 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1889 /* Display the windows */
1890 for (j = 0; j < 8; j++)
1892 byte a = TERM_WHITE;
1894 cptr s = angband_term_name[j];
1897 if (j == x) a = TERM_L_BLUE;
1899 /* Window name, staggered, centered */
1900 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1903 /* Display the options */
1904 for (i = 0; i < 16; i++)
1906 byte a = TERM_WHITE;
1908 cptr str = window_flag_desc[i];
1911 if (i == y) a = TERM_L_BLUE;
1915 if (!str) str = "(̤»ÈÍÑ)";
1917 if (!str) str = "(Unused option)";
1922 Term_putstr(0, i + 5, -1, a, str);
1924 /* Display the windows */
1925 for (j = 0; j < 8; j++)
1927 byte a = TERM_WHITE;
1932 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1935 if (window_flag[j] & (1L << i)) c = 'X';
1938 Term_putch(35 + j * 5, i + 5, a, c);
1943 Term_gotoxy(35 + x * 5, y + 5);
1961 for (j = 0; j < 8; j++)
1963 window_flag[j] &= ~(1L << y);
1967 for (i = 0; i < 16; i++)
1969 window_flag[x] &= ~(1L << i);
1982 window_flag[x] |= (1L << y);
1990 window_flag[x] &= ~(1L << y);
1996 d = get_keymap_dir(ch);
1998 x = (x + ddx[d] + 8) % 8;
1999 y = (y + ddy[d] + 16) % 16;
2006 /* Notice changes */
2007 for (j = 0; j < 8; j++)
2012 if (!angband_term[j]) continue;
2014 /* Ignore non-changes */
2015 if (window_flag[j] == old_flag[j]) continue;
2018 Term_activate(angband_term[j]);
2035 * Set or unset various options.
2037 * The user must use the "Ctrl-R" command to "adapt" to changes
2038 * in any options which control "visual" aspects of the game.
2040 void do_cmd_options(void)
2045 /* Save the screen */
2055 /* Why are we here */
2057 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2059 prt("Options", 2, 0);
2063 /* Give some choices */
2065 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2066 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2067 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2068 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2069 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2070 prt("(6) ¥¢¥¤¥Æ¥à¼«Æ°½¦¤¤/Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2071 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2072 /* Special choices */
2073 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2074 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2075 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2077 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2079 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2081 prt("(1) Input Options", 4, 5);
2082 prt("(2) Output Options", 5, 5);
2083 prt("(3) Game-Play Options", 6, 5);
2084 prt("(4) Disturbance Options", 7, 5);
2085 prt("(5) Efficiency Options", 8, 5);
2086 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2087 prt("(R) Play-record Options", 10, 5);
2089 /* Special choices */
2090 prt("(D) Base Delay Factor", 12, 5);
2091 prt("(H) Hitpoint Warning", 13, 5);
2092 prt("(A) Autosave Options", 14, 5);
2096 prt("(W) Window Flags", 15, 5);
2099 prt("(C) Cheating Options", 16, 5);
2105 prt("¥³¥Þ¥ó¥É:", 18, 0);
2107 prt("Command: ", 18, 0);
2115 if (k == ESCAPE) break;
2120 /* General Options */
2123 /* Process the general options */
2125 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2127 do_cmd_options_aux(1, "Input Options");
2133 /* General Options */
2136 /* Process the general options */
2138 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2140 do_cmd_options_aux(2, "Output Options");
2146 /* Inventory Options */
2151 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2153 do_cmd_options_aux(3, "Game-Play Options");
2159 /* Disturbance Options */
2164 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2166 do_cmd_options_aux(4, "Disturbance Options");
2172 /* Efficiency Options */
2177 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2179 do_cmd_options_aux(5, "Efficiency Options");
2185 /* Object auto-destruction Options */
2190 do_cmd_options_aux(7, "¥¢¥¤¥Æ¥à¼«Æ°½¦¤¤/Ç˲õ¥ª¥×¥·¥ç¥ó");
2192 do_cmd_options_aux(7, "Object Auto-Pick/Destroy Options");
2197 /* Play-record Options */
2203 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2205 do_cmd_options_aux(10, "Play-record Option");
2210 /* Cheating Options */
2215 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2217 do_cmd_options_cheat("Cheaters never win");
2227 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2229 do_cmd_options_autosave("Autosave");
2240 do_cmd_options_win();
2241 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2242 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2243 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2244 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2248 /* Hack -- Delay Speed */
2254 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2256 prt("Command: Base Delay Factor", 18, 0);
2260 /* Get a new value */
2263 int msec = delay_factor * delay_factor * delay_factor;
2265 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2267 prt(format("Current base delay factor: %d (%d msec)",
2270 delay_factor, msec), 22, 0);
2272 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2274 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2278 if (k == ESCAPE) break;
2279 if (isdigit(k)) delay_factor = D2I(k);
2286 /* Hack -- hitpoint warning factor */
2292 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2294 prt("Command: Hitpoint Warning", 18, 0);
2298 /* Get a new value */
2302 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2303 hitpoint_warn), 22, 0);
2305 prt(format("Current hitpoint warning: %d0%%",
2306 hitpoint_warn), 22, 0);
2310 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2312 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2316 if (k == ESCAPE) break;
2317 if (isdigit(k)) hitpoint_warn = D2I(k);
2324 /* Unknown option */
2333 /* Flush messages */
2338 /* Restore the screen */
2341 /* Hack - Redraw equippy chars */
2342 p_ptr->redraw |= (PR_EQUIPPY);
2348 * Ask for a "user pref line" and process it
2350 * XXX XXX XXX Allow absolute file names?
2352 void do_cmd_pref(void)
2359 /* Ask for a "user pref command" */
2361 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2363 if (!get_string("Pref: ", buf, 80)) return;
2367 /* Process that pref command */
2368 (void)process_pref_file_command(buf);
2371 void do_cmd_pickpref(void)
2378 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2380 if(!get_check("Reload auto-pick preference file? ")) return;
2382 /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
2383 for( i = 0; i < max_autopick; i++){
2384 string_free(autopick_name[i]);
2385 string_free(autopick_insc[i]);
2389 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2391 sprintf(buf, "picktype-%s.prf", player_name);
2393 sprintf(buf, "pickpref-%s.prf", player_name);
2395 if( process_pickpref_file(buf) == 0 ){
2398 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2400 msg_format("loaded '%s'.", buf);
2404 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2406 if( process_pickpref_file("picktype.prf") == 0 )
2408 if( process_pickpref_file("pickpref.prf") == 0 )
2413 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2415 msg_print("loaded 'pickpref.prf'.");
2420 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2422 if(err) msg_print("Failed to reload autopick preference.");
2429 * Hack -- append all current macros to the given file
2431 static errr macro_dump(cptr fname)
2433 static cptr mark = "Macro Dump";
2441 /* Build the filename */
2442 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2444 /* File type is "TEXT" */
2445 FILE_TYPE(FILE_TYPE_TEXT);
2447 /* Append to the file */
2448 fff = open_auto_dump(buf, mark, &line_num);
2449 if (!fff) return (-1);
2453 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2455 fprintf(fff, "\n# Automatic macro dump\n\n");
2460 for (i = 0; i < macro__num; i++)
2462 /* Extract the action */
2463 ascii_to_text(buf, macro__act[i]);
2465 /* Dump the macro */
2466 fprintf(fff, "A:%s\n", buf);
2468 /* Extract the action */
2469 ascii_to_text(buf, macro__pat[i]);
2471 /* Dump normal macros */
2472 fprintf(fff, "P:%s\n", buf);
2477 /* count number of lines */
2482 close_auto_dump(fff, mark, line_num);
2490 * Hack -- ask for a "trigger" (see below)
2492 * Note the complex use of the "inkey()" function from "util.c".
2494 * Note that both "flush()" calls are extremely important.
2496 static void do_cmd_macro_aux(char *buf)
2506 /* Do not process macros */
2512 /* Read the pattern */
2518 /* Do not process macros */
2521 /* Do not wait for keys */
2524 /* Attempt to read a key */
2535 /* Convert the trigger */
2536 ascii_to_text(tmp, buf);
2538 /* Hack -- display the trigger */
2539 Term_addstr(-1, TERM_WHITE, tmp);
2546 * Hack -- ask for a keymap "trigger" (see below)
2548 * Note that both "flush()" calls are extremely important. This may
2549 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2551 static void do_cmd_macro_aux_keymap(char *buf)
2565 /* Convert to ascii */
2566 ascii_to_text(tmp, buf);
2568 /* Hack -- display the trigger */
2569 Term_addstr(-1, TERM_WHITE, tmp);
2578 * Hack -- append all keymaps to the given file
2580 static errr keymap_dump(cptr fname)
2582 static cptr mark = "Keymap Dump";
2594 if (rogue_like_commands)
2596 mode = KEYMAP_MODE_ROGUE;
2602 mode = KEYMAP_MODE_ORIG;
2606 /* Build the filename */
2607 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2609 /* File type is "TEXT" */
2610 FILE_TYPE(FILE_TYPE_TEXT);
2612 /* Append to the file */
2613 fff = open_auto_dump(buf, mark, &line_num);
2614 if (!fff) return -1;
2618 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2620 fprintf(fff, "\n# Automatic keymap dump\n\n");
2625 for (i = 0; i < 256; i++)
2629 /* Loop up the keymap */
2630 act = keymap_act[mode][i];
2632 /* Skip empty keymaps */
2635 /* Encode the key */
2638 ascii_to_text(key, buf);
2640 /* Encode the action */
2641 ascii_to_text(buf, act);
2643 /* Dump the macro */
2644 fprintf(fff, "A:%s\n", buf);
2645 fprintf(fff, "C:%d:%s\n", mode, key);
2650 close_auto_dump(fff, mark, line_num);
2659 * Interact with "macros"
2661 * Note that the macro "action" must be defined before the trigger.
2663 * Could use some helpful instructions on this page. XXX XXX XXX
2665 void do_cmd_macros(void)
2677 if (rogue_like_commands)
2679 mode = KEYMAP_MODE_ROGUE;
2685 mode = KEYMAP_MODE_ORIG;
2688 /* File type is "TEXT" */
2689 FILE_TYPE(FILE_TYPE_TEXT);
2696 /* Process requests until done */
2704 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2706 prt("Interact with Macros", 2, 0);
2711 /* Describe that action */
2713 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2715 prt("Current action (if any) shown below:", 20, 0);
2719 /* Analyze the current action */
2720 ascii_to_text(buf, macro__buf);
2722 /* Display the current action */
2728 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2730 prt("(1) Load a user pref file", 4, 5);
2735 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2736 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2737 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2738 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2739 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2740 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2741 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2742 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2743 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2745 prt("(2) Append macros to a file", 5, 5);
2746 prt("(3) Query a macro", 6, 5);
2747 prt("(4) Create a macro", 7, 5);
2748 prt("(5) Remove a macro", 8, 5);
2749 prt("(6) Append keymaps to a file", 9, 5);
2750 prt("(7) Query a keymap", 10, 5);
2751 prt("(8) Create a keymap", 11, 5);
2752 prt("(9) Remove a keymap", 12, 5);
2753 prt("(0) Enter a new action", 13, 5);
2756 #endif /* ALLOW_MACROS */
2760 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2762 prt("Command: ", 16, 0);
2770 if (i == ESCAPE) break;
2772 /* Load a 'macro' file */
2777 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2779 prt("Command: Load a user pref file", 16, 0);
2785 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2787 prt("File: ", 18, 0);
2791 /* Default filename */
2792 sprintf(tmp, "%s.prf", player_name);
2794 /* Ask for a file */
2795 if (!askfor_aux(tmp, 80)) continue;
2797 /* Process the given filename */
2798 if (0 != process_pref_file(tmp))
2802 msg_print("¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤á¤Þ¤»¤ó¤Ç¤·¤¿¡ª");
2804 msg_print("Could not load file!");
2817 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2819 prt("Command: Append macros to a file", 16, 0);
2825 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2827 prt("File: ", 18, 0);
2831 /* Default filename */
2832 sprintf(tmp, "%s.prf", player_name);
2834 /* Ask for a file */
2835 if (!askfor_aux(tmp, 80)) continue;
2840 /* Dump the macros */
2841 (void)macro_dump(tmp);
2848 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2850 msg_print("Appended macros.");
2862 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2864 prt("Command: Query a macro", 16, 0);
2870 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2872 prt("Trigger: ", 18, 0);
2876 /* Get a macro trigger */
2877 do_cmd_macro_aux(buf);
2879 /* Acquire action */
2880 k = macro_find_exact(buf);
2887 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2889 msg_print("Found no macro.");
2897 /* Obtain the action */
2898 strcpy(macro__buf, macro__act[k]);
2900 /* Analyze the current action */
2901 ascii_to_text(buf, macro__buf);
2903 /* Display the current action */
2908 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2910 msg_print("Found a macro.");
2916 /* Create a macro */
2921 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2923 prt("Command: Create a macro", 16, 0);
2929 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2931 prt("Trigger: ", 18, 0);
2935 /* Get a macro trigger */
2936 do_cmd_macro_aux(buf);
2943 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
2945 prt("Action: ", 20, 0);
2949 /* Convert to text */
2950 ascii_to_text(tmp, macro__buf);
2952 /* Get an encoded action */
2953 if (askfor_aux(tmp, 80))
2955 /* Convert to ascii */
2956 text_to_ascii(macro__buf, tmp);
2958 /* Link the macro */
2959 macro_add(buf, macro__buf);
2963 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2965 msg_print("Added a macro.");
2971 /* Remove a macro */
2976 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
2978 prt("Command: Remove a macro", 16, 0);
2984 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2986 prt("Trigger: ", 18, 0);
2990 /* Get a macro trigger */
2991 do_cmd_macro_aux(buf);
2993 /* Link the macro */
2994 macro_add(buf, buf);
2998 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3000 msg_print("Removed a macro.");
3010 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3012 prt("Command: Append keymaps to a file", 16, 0);
3018 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3020 prt("File: ", 18, 0);
3024 /* Default filename */
3025 sprintf(tmp, "%s.prf", player_name);
3027 /* Ask for a file */
3028 if (!askfor_aux(tmp, 80)) continue;
3033 /* Dump the macros */
3034 (void)keymap_dump(tmp);
3041 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3043 msg_print("Appended keymaps.");
3048 /* Query a keymap */
3055 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3057 prt("Command: Query a keymap", 16, 0);
3063 prt("²¡¤¹¥¡¼: ", 18, 0);
3065 prt("Keypress: ", 18, 0);
3069 /* Get a keymap trigger */
3070 do_cmd_macro_aux_keymap(buf);
3072 /* Look up the keymap */
3073 act = keymap_act[mode][(byte)(buf[0])];
3080 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3082 msg_print("Found no keymap.");
3090 /* Obtain the action */
3091 strcpy(macro__buf, act);
3093 /* Analyze the current action */
3094 ascii_to_text(buf, macro__buf);
3096 /* Display the current action */
3101 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3103 msg_print("Found a keymap.");
3109 /* Create a keymap */
3114 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3116 prt("Command: Create a keymap", 16, 0);
3122 prt("²¡¤¹¥¡¼: ", 18, 0);
3124 prt("Keypress: ", 18, 0);
3128 /* Get a keymap trigger */
3129 do_cmd_macro_aux_keymap(buf);
3136 prt("¹ÔÆ°: ", 20, 0);
3138 prt("Action: ", 20, 0);
3142 /* Convert to text */
3143 ascii_to_text(tmp, macro__buf);
3145 /* Get an encoded action */
3146 if (askfor_aux(tmp, 80))
3148 /* Convert to ascii */
3149 text_to_ascii(macro__buf, tmp);
3151 /* Free old keymap */
3152 string_free(keymap_act[mode][(byte)(buf[0])]);
3154 /* Make new keymap */
3155 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3159 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3161 msg_print("Added a keymap.");
3167 /* Remove a keymap */
3172 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3174 prt("Command: Remove a keymap", 16, 0);
3180 prt("²¡¤¹¥¡¼: ", 18, 0);
3182 prt("Keypress: ", 18, 0);
3186 /* Get a keymap trigger */
3187 do_cmd_macro_aux_keymap(buf);
3189 /* Free old keymap */
3190 string_free(keymap_act[mode][(byte)(buf[0])]);
3192 /* Make new keymap */
3193 keymap_act[mode][(byte)(buf[0])] = NULL;
3197 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3199 msg_print("Removed a keymap.");
3204 /* Enter a new action */
3209 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3211 prt("Command: Enter a new action", 16, 0);
3215 /* Go to the correct location */
3218 /* Hack -- limit the value */
3221 /* Get an encoded action */
3222 if (!askfor_aux(buf, 80)) continue;
3224 /* Extract an action */
3225 text_to_ascii(macro__buf, buf);
3228 #endif /* ALLOW_MACROS */
3237 /* Flush messages */
3247 * Interact with "visuals"
3249 void do_cmd_visuals(void)
3260 /* File type is "TEXT" */
3261 FILE_TYPE(FILE_TYPE_TEXT);
3264 /* Save the screen */
3268 /* Interact until done */
3274 /* Ask for a choice */
3276 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3278 prt("Interact with Visuals", 2, 0);
3282 /* Give some choices */
3284 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3286 prt("(1) Load a user pref file", 4, 5);
3289 #ifdef ALLOW_VISUALS
3291 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3292 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3293 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3294 prt("(5) (̤»ÈÍÑ)", 8, 5);
3295 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3296 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3297 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3298 prt("(9) (̤»ÈÍÑ)", 12, 5);
3300 prt("(2) Dump monster attr/chars", 5, 5);
3301 prt("(3) Dump object attr/chars", 6, 5);
3302 prt("(4) Dump feature attr/chars", 7, 5);
3303 prt("(5) (unused)", 8, 5);
3304 prt("(6) Change monster attr/chars", 9, 5);
3305 prt("(7) Change object attr/chars", 10, 5);
3306 prt("(8) Change feature attr/chars", 11, 5);
3307 prt("(9) (unused)", 12, 5);
3312 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3314 prt("(0) Reset visuals", 13, 5);
3320 prt("¥³¥Þ¥ó¥É:", 18, 0);
3322 prt("Command: ", 15, 0);
3330 if (i == ESCAPE) break;
3332 /* Load a 'pref' file */
3337 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3339 prt("Command: Load a user pref file", 15, 0);
3345 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3347 prt("File: ", 17, 0);
3351 /* Default filename */
3352 sprintf(tmp, "%s.prf", player_name);
3355 if (!askfor_aux(tmp, 70)) continue;
3357 /* Process the given filename */
3358 (void)process_pref_file(tmp);
3361 #ifdef ALLOW_VISUALS
3363 /* Dump monster attr/chars */
3366 static cptr mark = "Monster attr/chars";
3371 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3373 prt("Command: Dump monster attr/chars", 15, 0);
3379 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3381 prt("File: ", 17, 0);
3385 /* Default filename */
3386 sprintf(tmp, "%s.prf", player_name);
3388 /* Get a filename */
3389 if (!askfor_aux(tmp, 70)) continue;
3391 /* Build the filename */
3392 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3397 /* Append to the file */
3398 fff = open_auto_dump(buf, mark, &line_num);
3406 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3408 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3413 for (i = 0; i < max_r_idx; i++)
3415 monster_race *r_ptr = &r_info[i];
3417 /* Skip non-entries */
3418 if (!r_ptr->name) continue;
3420 /* Dump a comment */
3421 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3424 /* Dump the monster attr/char info */
3425 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3426 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3431 close_auto_dump(fff, mark, line_num);
3435 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3437 msg_print("Dumped monster attr/chars.");
3442 /* Dump object attr/chars */
3445 static cptr mark = "Object attr/chars";
3450 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3452 prt("Command: Dump object attr/chars", 15, 0);
3458 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3460 prt("File: ", 17, 0);
3464 /* Default filename */
3465 sprintf(tmp, "%s.prf", player_name);
3467 /* Get a filename */
3468 if (!askfor_aux(tmp, 70)) continue;
3470 /* Build the filename */
3471 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3476 /* Append to the file */
3477 fff = open_auto_dump(buf, mark, &line_num);
3485 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3487 fprintf(fff, "\n# Object attr/char definitions\n\n");
3492 for (i = 0; i < max_k_idx; i++)
3494 object_kind *k_ptr = &k_info[i];
3496 /* Skip non-entries */
3497 if (!k_ptr->name) continue;
3499 /* Dump a comment */
3500 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3503 /* Dump the object attr/char info */
3504 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3505 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3510 close_auto_dump(fff, mark, line_num);
3514 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3516 msg_print("Dumped object attr/chars.");
3521 /* Dump feature attr/chars */
3524 static cptr mark = "Feature attr/chars";
3529 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3531 prt("Command: Dump feature attr/chars", 15, 0);
3537 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3539 prt("File: ", 17, 0);
3543 /* Default filename */
3544 sprintf(tmp, "%s.prf", player_name);
3546 /* Get a filename */
3547 if (!askfor_aux(tmp, 70)) continue;
3549 /* Build the filename */
3550 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3555 /* Append to the file */
3556 fff = open_auto_dump(buf, mark, &line_num);
3564 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3566 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3571 for (i = 0; i < max_f_idx; i++)
3573 feature_type *f_ptr = &f_info[i];
3575 /* Skip non-entries */
3576 if (!f_ptr->name) continue;
3578 /* Dump a comment */
3579 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3582 /* Dump the feature attr/char info */
3583 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3584 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3589 close_auto_dump(fff, mark, line_num);
3593 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3595 msg_print("Dumped feature attr/chars.");
3600 /* Modify monster attr/chars */
3607 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3609 prt("Command: Change monster attr/chars", 15, 0);
3613 /* Hack -- query until done */
3616 monster_race *r_ptr = &r_info[r];
3618 byte da = (r_ptr->d_attr);
3619 byte dc = (r_ptr->d_char);
3620 byte ca = (r_ptr->x_attr);
3621 byte cc = (r_ptr->x_char);
3623 /* Label the object */
3625 Term_putstr(5, 17, -1, TERM_WHITE,
3626 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3627 r, (r_name + r_ptr->name)));
3629 Term_putstr(5, 17, -1, TERM_WHITE,
3630 format("Monster = %d, Name = %-40.40s",
3631 r, (r_name + r_ptr->name)));
3635 /* Label the Default values */
3637 Term_putstr(10, 19, -1, TERM_WHITE,
3638 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3640 Term_putstr(10, 19, -1, TERM_WHITE,
3641 format("Default attr/char = %3u / %3u", da, dc));
3644 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3645 Term_putch(43, 19, da, dc);
3647 /* Label the Current values */
3649 Term_putstr(10, 20, -1, TERM_WHITE,
3650 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3652 Term_putstr(10, 20, -1, TERM_WHITE,
3653 format("Current attr/char = %3u / %3u", ca, cc));
3656 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3657 Term_putch(43, 20, ca, cc);
3661 Term_putstr(0, 22, -1, TERM_WHITE,
3662 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3664 Term_putstr(0, 22, -1, TERM_WHITE,
3665 "Command (n/N/a/A/c/C): ");
3673 if (i == ESCAPE) break;
3676 if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx;
3677 if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx;
3678 if (i == 'a') r_ptr->x_attr = (byte)(ca + 1);
3679 if (i == 'A') r_ptr->x_attr = (byte)(ca - 1);
3680 if (i == 'c') r_ptr->x_char = (byte)(cc + 1);
3681 if (i == 'C') r_ptr->x_char = (byte)(cc - 1);
3685 /* Modify object attr/chars */
3692 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3694 prt("Command: Change object attr/chars", 15, 0);
3698 /* Hack -- query until done */
3701 object_kind *k_ptr = &k_info[k];
3703 byte da = (byte)k_ptr->d_attr;
3704 byte dc = (byte)k_ptr->d_char;
3705 byte ca = (byte)k_ptr->x_attr;
3706 byte cc = (byte)k_ptr->x_char;
3708 /* Label the object */
3710 Term_putstr(5, 17, -1, TERM_WHITE,
3711 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3712 k, (k_name + k_ptr->name)));
3714 Term_putstr(5, 17, -1, TERM_WHITE,
3715 format("Object = %d, Name = %-40.40s",
3716 k, (k_name + k_ptr->name)));
3720 /* Label the Default values */
3722 Term_putstr(10, 19, -1, TERM_WHITE,
3723 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3725 Term_putstr(10, 19, -1, TERM_WHITE,
3726 format("Default attr/char = %3d / %3d", da, dc));
3729 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3730 Term_putch(43, 19, da, dc);
3732 /* Label the Current values */
3734 Term_putstr(10, 20, -1, TERM_WHITE,
3735 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3737 Term_putstr(10, 20, -1, TERM_WHITE,
3738 format("Current attr/char = %3d / %3d", ca, cc));
3741 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3742 Term_putch(43, 20, ca, cc);
3746 Term_putstr(0, 22, -1, TERM_WHITE,
3747 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3749 Term_putstr(0, 22, -1, TERM_WHITE,
3750 "Command (n/N/a/A/c/C): ");
3758 if (i == ESCAPE) break;
3761 if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx;
3762 if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx;
3763 if (i == 'a') k_info[k].x_attr = (byte)(ca + 1);
3764 if (i == 'A') k_info[k].x_attr = (byte)(ca - 1);
3765 if (i == 'c') k_info[k].x_char = (byte)(cc + 1);
3766 if (i == 'C') k_info[k].x_char = (byte)(cc - 1);
3770 /* Modify feature attr/chars */
3777 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3779 prt("Command: Change feature attr/chars", 15, 0);
3783 /* Hack -- query until done */
3786 feature_type *f_ptr = &f_info[f];
3788 byte da = (byte)f_ptr->d_attr;
3789 byte dc = (byte)f_ptr->d_char;
3790 byte ca = (byte)f_ptr->x_attr;
3791 byte cc = (byte)f_ptr->x_char;
3793 /* Label the object */
3795 Term_putstr(5, 17, -1, TERM_WHITE,
3796 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3797 f, (f_name + f_ptr->name)));
3799 Term_putstr(5, 17, -1, TERM_WHITE,
3800 format("Terrain = %d, Name = %-40.40s",
3801 f, (f_name + f_ptr->name)));
3805 /* Label the Default values */
3807 Term_putstr(10, 19, -1, TERM_WHITE,
3808 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3810 Term_putstr(10, 19, -1, TERM_WHITE,
3811 format("Default attr/char = %3d / %3d", da, dc));
3814 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3815 Term_putch(43, 19, da, dc);
3817 /* Label the Current values */
3819 Term_putstr(10, 20, -1, TERM_WHITE,
3820 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3822 Term_putstr(10, 20, -1, TERM_WHITE,
3823 format("Current attr/char = %3d / %3d", ca, cc));
3826 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3827 Term_putch(43, 20, ca, cc);
3831 Term_putstr(0, 22, -1, TERM_WHITE,
3832 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3834 Term_putstr(0, 22, -1, TERM_WHITE,
3835 "Command (n/N/a/A/c/C): ");
3843 if (i == ESCAPE) break;
3846 if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx;
3847 if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx;
3848 if (i == 'a') f_info[f].x_attr = (byte)(ca + 1);
3849 if (i == 'A') f_info[f].x_attr = (byte)(ca - 1);
3850 if (i == 'c') f_info[f].x_char = (byte)(cc + 1);
3851 if (i == 'C') f_info[f].x_char = (byte)(cc - 1);
3865 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
3867 msg_print("Visual attr/char tables reset.");
3872 /* Unknown option */
3878 /* Flush messages */
3883 /* Restore the screen */
3889 * Interact with "colors"
3891 void do_cmd_colors(void)
3902 /* File type is "TEXT" */
3903 FILE_TYPE(FILE_TYPE_TEXT);
3906 /* Save the screen */
3910 /* Interact until done */
3916 /* Ask for a choice */
3918 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
3920 prt("Interact with Colors", 2, 0);
3924 /* Give some choices */
3926 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3928 prt("(1) Load a user pref file", 4, 5);
3933 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3934 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
3936 prt("(2) Dump colors", 5, 5);
3937 prt("(3) Modify colors", 6, 5);
3944 prt("¥³¥Þ¥ó¥É: ", 8, 0);
3946 prt("Command: ", 8, 0);
3954 if (i == ESCAPE) break;
3956 /* Load a 'pref' file */
3961 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
3963 prt("Command: Load a user pref file", 8, 0);
3969 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
3971 prt("File: ", 10, 0);
3976 sprintf(tmp, "%s.prf", player_name);
3979 if (!askfor_aux(tmp, 70)) continue;
3981 /* Process the given filename */
3982 (void)process_pref_file(tmp);
3984 /* Mega-Hack -- react to changes */
3985 Term_xtra(TERM_XTRA_REACT, 0);
3987 /* Mega-Hack -- redraw */
3996 static cptr mark = "Colors";
4001 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4003 prt("Command: Dump colors", 8, 0);
4009 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4011 prt("File: ", 10, 0);
4015 /* Default filename */
4016 sprintf(tmp, "%s.prf", player_name);
4018 /* Get a filename */
4019 if (!askfor_aux(tmp, 70)) continue;
4021 /* Build the filename */
4022 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
4027 /* Append to the file */
4028 fff = open_auto_dump(buf, mark, &line_num);
4036 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4038 fprintf(fff, "\n# Color redefinitions\n\n");
4043 for (i = 0; i < 256; i++)
4045 int kv = angband_color_table[i][0];
4046 int rv = angband_color_table[i][1];
4047 int gv = angband_color_table[i][2];
4048 int bv = angband_color_table[i][3];
4053 cptr name = "unknown";
4057 /* Skip non-entries */
4058 if (!kv && !rv && !gv && !bv) continue;
4060 /* Extract the color name */
4061 if (i < 16) name = color_names[i];
4063 /* Dump a comment */
4065 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4067 fprintf(fff, "# Color '%s'\n", name);
4071 /* Dump the monster attr/char info */
4072 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4078 close_auto_dump(fff, mark, line_num);
4082 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4084 msg_print("Dumped color redefinitions.");
4096 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4098 prt("Command: Modify colors", 8, 0);
4102 /* Hack -- query until done */
4111 /* Exhibit the normal colors */
4112 for (j = 0; j < 16; j++)
4114 /* Exhibit this color */
4115 Term_putstr(j*4, 20, -1, a, "###");
4117 /* Exhibit all colors */
4118 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4121 /* Describe the color */
4123 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4125 name = ((a < 16) ? color_names[a] : "undefined");
4129 /* Describe the color */
4131 Term_putstr(5, 10, -1, TERM_WHITE,
4132 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4134 Term_putstr(5, 10, -1, TERM_WHITE,
4135 format("Color = %d, Name = %s", a, name));
4139 /* Label the Current values */
4140 Term_putstr(5, 12, -1, TERM_WHITE,
4141 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4142 angband_color_table[a][0],
4143 angband_color_table[a][1],
4144 angband_color_table[a][2],
4145 angband_color_table[a][3]));
4149 Term_putstr(0, 14, -1, TERM_WHITE,
4150 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4152 Term_putstr(0, 14, -1, TERM_WHITE,
4153 "Command (n/N/k/K/r/R/g/G/b/B): ");
4161 if (i == ESCAPE) break;
4164 if (i == 'n') a = (byte)(a + 1);
4165 if (i == 'N') a = (byte)(a - 1);
4166 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4167 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4168 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4169 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4170 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4171 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4172 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4173 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4175 /* Hack -- react to changes */
4176 Term_xtra(TERM_XTRA_REACT, 0);
4178 /* Hack -- redraw */
4185 /* Unknown option */
4191 /* Flush messages */
4196 /* Restore the screen */
4202 * Note something in the message recall
4204 void do_cmd_note(void)
4213 if (!get_string("¥á¥â: ", buf, 60)) return;
4215 if (!get_string("Note: ", buf, 60)) return;
4219 /* Ignore empty notes */
4220 if (!buf[0] || (buf[0] == ' ')) return;
4222 /* Add the note to the message recall */
4224 msg_format("¥á¥â: %s", buf);
4226 msg_format("Note: %s", buf);
4233 * Mention the current version
4235 void do_cmd_version(void)
4239 #ifndef FAKE_VERSION
4240 msg_format("You are playing Angband %d.%d.%d.",
4241 VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
4244 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4245 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4247 msg_format("You are playing Hengband %d.%d.%d.",
4248 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4258 * Array of feeling strings
4260 static cptr do_cmd_feeling_text[11] =
4263 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4265 "Looks like any other level.",
4269 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4271 "You feel there is something special about this level.",
4275 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4277 "You nearly faint as horrible visions of death fill your mind!",
4281 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4283 "This level looks very dangerous.",
4287 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4289 "You have a very bad feeling...",
4293 "°¤¤Í½´¶¤¬¤¹¤ë...",
4295 "You have a bad feeling...",
4301 "You feel nervous.",
4305 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4307 "You feel your luck is turning...",
4311 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4313 "You don't like the look of this place.",
4317 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4319 "This level looks reasonably safe.",
4323 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4325 "What a boring place..."
4330 static cptr do_cmd_feeling_text_combat[11] =
4333 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4335 "Looks like any other level.",
4339 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4341 "You feel there is something special about this level.",
4345 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4347 "You nearly faint as horrible visions of death fill your mind!",
4351 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4353 "This level looks very dangerous.",
4357 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4359 "You have a very bad feeling...",
4363 "°¤¤Í½´¶¤¬¤¹¤ë...",
4365 "You have a bad feeling...",
4371 "You feel nervous.",
4375 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4377 "You feel your luck is turning...",
4381 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4383 "You don't like the look of this place.",
4387 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4389 "This level looks reasonably safe.",
4393 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4395 "What a boring place..."
4400 static cptr do_cmd_feeling_text_lucky[11] =
4403 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4404 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4405 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4406 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4407 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4408 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4409 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4410 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4411 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4412 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4413 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4415 "Looks like any other level.",
4416 "You feel there is something special about this level.",
4417 "You have a superb feeling about this level.",
4418 "You have an excellent feeling...",
4419 "You have a very good feeling...",
4420 "You have a good feeling...",
4421 "You feel strangely lucky...",
4422 "You feel your luck is turning...",
4423 "You like the look of this place...",
4424 "This level can't be all bad...",
4425 "What a boring place..."
4431 * Note that "feeling" is set to zero unless some time has passed.
4432 * Note that this is done when the level is GENERATED, not entered.
4434 void do_cmd_feeling(void)
4436 /* Verify the feeling */
4437 if (feeling > 10) feeling = 10;
4440 if (cmd_feeling_callback(feeling)) return;
4441 #endif /* USE_SCRIPT */
4443 /* No useful feeling in quests */
4444 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4447 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4449 msg_print("Looks like a typical quest level.");
4455 /* No useful feeling in town */
4456 else if (p_ptr->town_num && !dun_level)
4459 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4461 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4465 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4467 msg_print("Looks like a strange wilderness.");
4475 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4477 msg_print("Looks like a typical town.");
4484 /* No useful feeling in the wilderness */
4485 else if (!dun_level)
4488 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4490 msg_print("Looks like a typical wilderness.");
4496 /* Display the feeling */
4497 if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
4499 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4501 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4502 msg_print(do_cmd_feeling_text_combat[feeling]);
4504 msg_print(do_cmd_feeling_text[feeling]);
4509 msg_print(do_cmd_feeling_text[0]);
4518 * Encode the screen colors
4520 static char hack[17] = "dwsorgbuDWvyRGBU";
4523 static errr photo_fgets(FILE *fff, char *buf, huge n)
4532 if (fgets(tmp, 1024, fff))
4534 /* Convert weirdness */
4535 for (s = tmp; *s; s++)
4537 /* Handle newline */
4548 else if (*s == '\t')
4550 /* Hack -- require room */
4551 if (i + 8 >= n) break;
4553 /* Append a space */
4556 /* Append some more spaces */
4557 while (!(i % 8)) buf[i++] = ' ';
4561 else if (iskanji(*s))
4568 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4569 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4576 /* Handle printables */
4597 * Hack -- load a screen dump from a file
4599 void do_cmd_load_screen(void)
4613 /* Build the filename */
4614 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4616 /* Append to the file */
4617 fff = my_fopen(buf, "r");
4622 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4624 msg_format("Failed to open %s.", buf);
4631 /* Save the screen */
4634 /* Clear the screen */
4638 /* Load the screen */
4639 for (y = 0; okay && (y < 24); y++)
4641 /* Get a line of data */
4642 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4645 for (x = 0; x < 79; x++)
4647 /* Put the attr/char */
4648 Term_draw(x, y, TERM_WHITE, buf[x]);
4652 /* Get the blank line */
4653 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4656 /* Dump the screen */
4657 for (y = 0; okay && (y < 24); y++)
4659 /* Get a line of data */
4660 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4663 for (x = 0; x < 79; x++)
4665 /* Get the attr/char */
4666 (void)(Term_what(x, y, &a, &c));
4668 /* Look up the attr */
4669 for (i = 0; i < 16; i++)
4671 /* Use attr matches */
4672 if (hack[i] == buf[x]) a = i;
4675 /* Put the attr/char */
4676 Term_draw(x, y, a, c);
4681 /* Get the blank line */
4682 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4691 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4693 msg_print("Screen dump loaded.");
4700 /* Restore the screen */
4707 cptr inven_res_label =
4709 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4711 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4714 /* XTRA HACK RESLIST */
4715 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4716 int *j, byte tval, char *where)
4718 char o_name[MAX_NLEN];
4721 if (!o_ptr->k_idx)return;
4722 if (o_ptr->tval != tval)return;
4725 * HACK:Ring of Lordly protection and Dragon shield/helm
4726 * have random resistances.
4728 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4729 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4730 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4731 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4732 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4733 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4734 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4737 object_desc(o_name, o_ptr, TRUE, 0);
4739 while ( o_name[i] && i < 26 ){
4741 if (iskanji(o_name[i])) i++;
4745 if(i<28) while(i<28){o_name[i]=' ';i++;}
4748 fprintf(fff,"%s %s", where, o_name);
4750 if (!(o_ptr->ident & (IDENT_MENTAL)))
4753 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4755 fprintf(fff, "-------unknown------------ -------unknown------\n");
4759 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4762 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4763 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4764 else fprintf(fff,"¡¦");
4766 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4767 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4768 else fprintf(fff,"¡¦");
4770 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4771 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4772 else fprintf(fff,"¡¦");
4774 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4775 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4776 else fprintf(fff,"¡¦");
4778 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4779 else fprintf(fff,"¡¦");
4781 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4782 else fprintf(fff,"¡¦");
4784 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4785 else fprintf(fff,"¡¦");
4787 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4788 else fprintf(fff,"¡¦");
4790 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4791 else fprintf(fff,"¡¦");
4793 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4794 else fprintf(fff,"¡¦");
4796 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4797 else fprintf(fff,"¡¦");
4799 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4800 else fprintf(fff,"¡¦");
4802 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4803 else fprintf(fff,"¡¦");
4807 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4808 else fprintf(fff,"¡¦");
4810 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4811 else fprintf(fff,"¡¦");
4813 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4814 else fprintf(fff,"¡¦");
4816 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4817 else fprintf(fff,"¡¦");
4819 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4820 else fprintf(fff,"¡¦");
4822 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4823 else fprintf(fff,"¡¦");
4825 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4826 else fprintf(fff,"¡¦");
4828 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4829 else fprintf(fff,"¡¦");
4832 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4833 else fprintf(fff,"¡¦");
4835 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4836 else fprintf(fff,"¡¦");
4838 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4839 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4840 else fprintf(fff,". ");
4842 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4843 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4844 else fprintf(fff,". ");
4846 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4847 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4848 else fprintf(fff,". ");
4850 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4851 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4852 else fprintf(fff,". ");
4854 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4855 else fprintf(fff,". ");
4857 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4858 else fprintf(fff,". ");
4860 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
4861 else fprintf(fff,". ");
4863 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
4864 else fprintf(fff,". ");
4866 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
4867 else fprintf(fff,". ");
4869 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
4870 else fprintf(fff,". ");
4872 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
4873 else fprintf(fff,". ");
4875 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
4876 else fprintf(fff,". ");
4878 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
4879 else fprintf(fff,". ");
4883 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
4884 else fprintf(fff,". ");
4886 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
4887 else fprintf(fff,". ");
4889 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
4890 else fprintf(fff,". ");
4892 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
4893 else fprintf(fff,". ");
4895 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
4896 else fprintf(fff,". ");
4898 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
4899 else fprintf(fff,". ");
4901 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
4902 else fprintf(fff,". ");
4904 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
4905 else fprintf(fff,". ");
4908 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
4909 else fprintf(fff,". ");
4911 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
4912 else fprintf(fff,". ");
4920 fprintf(fff,"%s\n", inven_res_label);
4926 * Display *ID* ed weapons/armors's resistances
4928 static void do_cmd_knowledge_inven(void)
4933 char file_name[1024];
4944 /* Open a new file */
4945 fff = my_fopen_temp(file_name, 1024);
4948 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
4950 msg_format("Failed to create temporally file %s.", file_name);
4955 fprintf(fff,"%s\n",inven_res_label);
4957 for (tval=TV_BOW; tval <= TV_RING; tval++){
4960 for (;j<9;j++) fprintf(fff, "\n");
4962 fprintf(fff,"%s\n",inven_res_label);
4966 strcpy(where, "Áõ");
4968 strcpy(where, "E ");
4970 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4972 o_ptr = &inventory[i];
4973 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4977 strcpy(where, "»ý");
4979 strcpy(where, "I ");
4981 for (i = 0; i < INVEN_PACK; i++)
4983 o_ptr = &inventory[i];
4984 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4988 /* Print all homes in the different towns */
4989 st_ptr = &town[1].store[STORE_HOME];
4991 strcpy(where, "²È");
4993 strcpy(where, "H ");/*nanka*/
4996 /* Dump all available items */
4997 for (i = 0; i < st_ptr->stock_num; i++)
4999 o_ptr = &st_ptr->stock[i];
5000 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5004 /* Close the file */
5007 /* Display the file contents */
5009 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5011 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5014 /* Remove the file */
5019 void do_cmd_save_screen_html_aux(char *filename, int message)
5023 byte a = 0, old_a = 0;
5037 char *html_head[] = {
5038 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5042 char *html_foot[] = {
5044 "</body>\n</html>\n",
5048 /* File type is "TEXT" */
5049 FILE_TYPE(FILE_TYPE_TEXT);
5051 /* Hack -- drop permissions */
5054 /* Append to the file */
5055 fff = my_fopen(filename, "w");
5057 /* Hack -- grab permissions */
5064 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5066 msg_format("Failed to open file %s.", filename);
5073 /* Save the screen */
5077 /* Build the filename */
5078 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
5079 tmpfff = my_fopen(buf, "r");
5081 for (i = 0; html_head[i]; i++)
5082 fprintf(fff, html_head[i]);
5086 while (!my_fgets(tmpfff, buf, 1024)) {
5088 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5092 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5094 fprintf(fff, "%s\n", buf);
5099 /* Dump the screen */
5100 for (y = 0; y < 24; y++)
5107 for (x = 0; x < 79; x++)
5111 /* Get the attr/char */
5112 (void)(Term_what(x, y, &a, &c));
5116 case '&': cc = "&"; break;
5117 case '<': cc = "<"; break;
5118 case '>': cc = ">"; break;
5120 case 0x1f: c = '.'; break;
5121 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5126 if ((y == 0 && x == 0) || a != old_a) {
5127 rv = angband_color_table[a][1];
5128 gv = angband_color_table[a][2];
5129 bv = angband_color_table[a][3];
5130 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5131 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5135 fprintf(fff, "%s", cc);
5137 fprintf(fff, "%c", c);
5140 fprintf(fff, "</font>");
5143 for (i = 0; html_foot[i]; i++)
5144 fprintf(fff, html_foot[i]);
5149 while (!my_fgets(tmpfff, buf, 1024)) {
5151 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5155 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5157 fprintf(fff, "%s\n", buf);
5172 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5174 msg_print("Screen dump saved.");
5179 /* Restore the screen */
5185 * Hack -- save a screen dump to a file
5187 void do_cmd_save_screen_html(void)
5189 char buf[1024], tmp[256] = "screen.html";
5192 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5194 if (!get_string("File name: ", tmp, 80))
5198 /* Build the filename */
5199 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5203 do_cmd_save_screen_html_aux(buf, 1);
5208 * Redefinable "save_screen" action
5210 void (*screendump_aux)(void) = NULL;
5214 * Hack -- save a screen dump to a file
5216 void do_cmd_save_screen(void)
5219 if (get_check("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©"))
5221 if (get_check("Save screen dump as HTML? "))
5224 do_cmd_save_screen_html();
5228 /* Do we use a special screendump function ? */
5231 /* Dump the screen to a graphics file */
5232 (*screendump_aux)();
5234 else /* Dump the screen as text */
5246 /* Build the filename */
5247 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5249 /* File type is "TEXT" */
5250 FILE_TYPE(FILE_TYPE_TEXT);
5252 /* Hack -- drop permissions */
5255 /* Append to the file */
5256 fff = my_fopen(buf, "w");
5258 /* Hack -- grab permissions */
5264 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5266 msg_format("Failed to open file %s.", buf);
5273 /* Save the screen */
5277 /* Dump the screen */
5278 for (y = 0; y < 24; y++)
5281 for (x = 0; x < 79; x++)
5283 /* Get the attr/char */
5284 (void)(Term_what(x, y, &a, &c));
5294 fprintf(fff, "%s\n", buf);
5301 /* Dump the screen */
5302 for (y = 0; y < 24; y++)
5305 for (x = 0; x < 79; x++)
5307 /* Get the attr/char */
5308 (void)(Term_what(x, y, &a, &c));
5311 buf[x] = hack[a&0x0F];
5318 fprintf(fff, "%s\n", buf);
5331 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5333 msg_print("Screen dump saved.");
5339 /* Restore the screen */
5346 * Sorting hook -- Comp function -- see below
5348 * We use "u" to point to array of monster indexes,
5349 * and "v" to select the type of sorting to perform on "u".
5351 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5353 u16b *who = (u16b*)(u);
5355 u16b *why = (u16b*)(v);
5363 /* Sort by total kills */
5366 /* Extract total kills */
5367 z1 = a_info[w1].tval;
5368 z2 = a_info[w2].tval;
5370 /* Compare total kills */
5371 if (z1 < z2) return (TRUE);
5372 if (z1 > z2) return (FALSE);
5376 /* Sort by monster level */
5379 /* Extract levels */
5380 z1 = a_info[w1].sval;
5381 z2 = a_info[w2].sval;
5383 /* Compare levels */
5384 if (z1 < z2) return (TRUE);
5385 if (z1 > z2) return (FALSE);
5389 /* Sort by monster experience */
5392 /* Extract experience */
5393 z1 = a_info[w1].level;
5394 z2 = a_info[w2].level;
5396 /* Compare experience */
5397 if (z1 < z2) return (TRUE);
5398 if (z1 > z2) return (FALSE);
5402 /* Compare indexes */
5408 * Sorting hook -- Swap function -- see below
5410 * We use "u" to point to array of monster indexes,
5411 * and "v" to select the type of sorting to perform.
5413 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5415 u16b *who = (u16b*)(u);
5427 * Check the status of "artifacts"
5429 void do_cmd_knowledge_artifacts(void)
5431 int i, k, z, x, y, n = 0;
5437 char file_name[1024];
5439 char base_name[MAX_NLEN];
5443 /* Allocate the "who" array */
5444 C_MAKE(who, max_r_idx, s16b);
5446 /* Allocate the "okay" array */
5447 C_MAKE(okay, max_a_idx, bool);
5449 /* Open a new file */
5450 fff = my_fopen_temp(file_name, 1024);
5453 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5455 msg_format("Failed to create temporary file %s.", file_name);
5461 /* Scan the artifacts */
5462 for (k = 0; k < max_a_idx; k++)
5464 artifact_type *a_ptr = &a_info[k];
5469 /* Skip "empty" artifacts */
5470 if (!a_ptr->name) continue;
5472 /* Skip "uncreated" artifacts */
5473 if (!a_ptr->cur_num) continue;
5479 /* Check the dungeon */
5480 for (y = 0; y < cur_hgt; y++)
5482 for (x = 0; x < cur_wid; x++)
5484 cave_type *c_ptr = &cave[y][x];
5486 s16b this_o_idx, next_o_idx = 0;
5488 /* Scan all objects in the grid */
5489 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5493 /* Acquire object */
5494 o_ptr = &o_list[this_o_idx];
5496 /* Acquire next object */
5497 next_o_idx = o_ptr->next_o_idx;
5499 /* Ignore non-artifacts */
5500 if (!artifact_p(o_ptr)) continue;
5502 /* Ignore known items */
5503 if (object_known_p(o_ptr)) continue;
5505 /* Note the artifact */
5506 okay[o_ptr->name1] = FALSE;
5511 /* Check the inventory and equipment */
5512 for (i = 0; i < INVEN_TOTAL; i++)
5514 object_type *o_ptr = &inventory[i];
5516 /* Ignore non-objects */
5517 if (!o_ptr->k_idx) continue;
5519 /* Ignore non-artifacts */
5520 if (!artifact_p(o_ptr)) continue;
5522 /* Ignore known items */
5523 if (object_known_p(o_ptr)) continue;
5525 /* Note the artifact */
5526 okay[o_ptr->name1] = FALSE;
5529 for (k = 0; k < max_a_idx; k++)
5531 if (okay[k]) who[n++] = k;
5534 /* Select the sort method */
5535 ang_sort_comp = ang_sort_art_comp;
5536 ang_sort_swap = ang_sort_art_swap;
5538 /* Sort the array by dungeon depth of monsters */
5539 ang_sort(who, &why, n);
5541 /* Scan the artifacts */
5542 for (k = 0; k < n; k++)
5544 artifact_type *a_ptr = &a_info[who[k]];
5548 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5550 strcpy(base_name, "Unknown Artifact");
5554 /* Obtain the base object type */
5555 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5563 /* Get local object */
5566 /* Create fake object */
5567 object_prep(q_ptr, z);
5569 /* Make it an artifact */
5570 q_ptr->name1 = (byte)who[k];
5572 /* Describe the artifact */
5573 object_desc_store(base_name, q_ptr, FALSE, 0);
5576 /* Hack -- Build the artifact name */
5578 fprintf(fff, " %s\n", base_name);
5580 fprintf(fff, " The %s\n", base_name);
5585 /* Close the file */
5588 /* Display the file contents */
5590 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5592 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5596 /* Remove the file */
5602 * Display known uniques
5604 static void do_cmd_knowledge_uniques(void)
5612 char file_name[1024];
5614 /* Allocate the "who" array */
5615 C_MAKE(who, max_r_idx, s16b);
5617 /* Open a new file */
5618 fff = my_fopen_temp(file_name, 1024);
5621 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5623 msg_format("Failed to create temporary file %s.", file_name);
5629 /* Scan the monsters */
5630 for (i = 1; i < max_r_idx; i++)
5632 monster_race *r_ptr = &r_info[i];
5634 /* Use that monster */
5635 if (r_ptr->name) who[n++] = i;
5638 /* Select the sort method */
5639 ang_sort_comp = ang_sort_comp_hook;
5640 ang_sort_swap = ang_sort_swap_hook;
5642 /* Sort the array by dungeon depth of monsters */
5643 ang_sort(who, &why, n);
5645 /* Scan the monster races */
5646 for (k = 0; k < n; k++)
5648 monster_race *r_ptr = &r_info[who[k]];
5650 /* Only print Uniques */
5651 if (r_ptr->flags1 & (RF1_UNIQUE))
5653 bool dead = (r_ptr->max_num == 0);
5657 /* Only display "known" uniques */
5658 if (dead || cheat_know || r_ptr->r_sights)
5660 /* Print a message */
5662 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5663 (r_name + r_ptr->name));
5665 fprintf(fff, " %s is alive\n",
5666 (r_name + r_ptr->name));
5673 /* Close the file */
5676 /* Display the file contents */
5678 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5680 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5684 /* Remove the file */
5690 * Display dead uniques
5692 static void do_cmd_knowledge_uniques_dead(void)
5700 char file_name[1024];
5702 /* Allocate the "who" array */
5703 C_MAKE(who, max_r_idx, s16b);
5705 /* Open a new file */
5706 fff = my_fopen_temp(file_name, 1024);
5709 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5711 msg_format("Failed to create temporary file %s.", file_name);
5717 /* Scan the monsters */
5718 for (i = 1; i < max_r_idx; i++)
5720 monster_race *r_ptr = &r_info[i];
5722 /* Use that monster */
5723 if (r_ptr->name) who[n++] = i;
5726 /* Select the sort method */
5727 ang_sort_comp = ang_sort_comp_hook;
5728 ang_sort_swap = ang_sort_swap_hook;
5730 /* Sort the array by dungeon depth of monsters */
5731 ang_sort(who, &why, n);
5733 /* Scan the monster races */
5734 for (k = 0; k < n; k++)
5736 monster_race *r_ptr = &r_info[who[k]];
5738 /* Only print Uniques */
5739 if (r_ptr->flags1 & (RF1_UNIQUE))
5741 bool dead = (r_ptr->max_num == 0);
5743 if (!dead) continue;
5745 /* Only display "known" uniques */
5746 if (dead || cheat_know || r_ptr->r_sights)
5748 /* Print a message */
5750 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5751 (r_name + r_ptr->name));
5753 fprintf(fff, " %s is dead\n",
5754 (r_name + r_ptr->name));
5761 /* Close the file */
5764 /* Display the file contents */
5766 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5768 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5772 /* Remove the file */
5778 * Display weapon-exp
5780 static void do_cmd_knowledge_weapon_exp(void)
5782 int i,j, num, shougou;
5786 char file_name[1024];
5789 /* Open a new file */
5790 fff = my_fopen_temp(file_name, 1024);
5793 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5795 msg_format("Failed to create temporary file %s.", file_name);
5801 for(i = 0; i < 5; i++)
5803 for (num = 0; num < 64; num++)
5805 for (j = 0; j < max_k_idx; j++)
5807 object_kind *k_ptr = &k_info[j];
5809 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
5811 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
5813 if(weapon_exp[4-i][num]<4000) shougou=0;
5814 else if(weapon_exp[4-i][num]<6000) shougou=1;
5815 else if(weapon_exp[4-i][num]<7000) shougou=2;
5816 else if(weapon_exp[4-i][num]<8000) shougou=3;
5819 fprintf(fff,"%-25s ",tmp);
5820 if (weapon_exp[4-i][num] >= weapon_exp_settei[p_ptr->pclass][4-i][num][1]) fprintf(fff,"!");
5821 else fprintf(fff," ");
5822 fprintf(fff,"%s",shougou_moji[shougou]);
5823 if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
5831 /* Close the file */
5834 /* Display the file contents */
5836 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
5838 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
5842 /* Remove the file */
5850 static void do_cmd_knowledge_spell_exp(void)
5857 char file_name[1024];
5859 /* Open a new file */
5860 fff = my_fopen_temp(file_name, 1024);
5863 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5865 msg_format("Failed to create temporary file %s.", file_name);
5871 if(p_ptr->realm1 != REALM_NONE)
5874 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
5876 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
5878 for (i = 0; i < 32; i++)
5880 if (!is_magic(p_ptr->realm1))
5882 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC - 1][i];
5886 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5888 if(s_ptr->slevel == 99) continue;
5889 if(spell_exp[i]<900) shougou=0;
5890 else if(spell_exp[i]<1200) shougou=1;
5891 else if(spell_exp[i]<1400) shougou=2;
5892 else if(spell_exp[i]<1600) shougou=3;
5894 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
5895 if (p_ptr->realm1 == REALM_HISSATSU)
5896 fprintf(fff,"[--]");
5899 if (shougou == 4) fprintf(fff,"!");
5900 else fprintf(fff," ");
5901 fprintf(fff,"%s",shougou_moji[shougou]);
5903 if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
5908 if(p_ptr->realm2 != REALM_NONE)
5910 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
5911 for (i = 0; i < 32; i++)
5913 if (!is_magic(p_ptr->realm1))
5915 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC - 1][i];
5919 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5921 if(s_ptr->slevel == 99) continue;
5923 if(spell_exp[i+32]<900) shougou=0;
5924 else if(spell_exp[i+32]<1200) shougou=1;
5925 else if(spell_exp[i+32]<1400) shougou=2;
5927 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
5928 if (shougou == 3) fprintf(fff,"!");
5929 else fprintf(fff," ");
5930 fprintf(fff,"%s",shougou_moji[shougou]);
5931 if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
5936 /* Close the file */
5939 /* Display the file contents */
5941 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
5943 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
5947 /* Remove the file */
5955 static void do_cmd_knowledge_skill_exp(void)
5961 char file_name[1024];
5963 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
5965 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
5968 /* Open a new file */
5969 fff = my_fopen_temp(file_name, 1024);
5972 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5974 msg_format("Failed to create temporary file %s.", file_name);
5980 for (i = 0; i < 3; i++)
5982 if(i == GINOU_RIDING)
5984 if(skill_exp[i]<500) shougou=0;
5985 else if(skill_exp[i]<2000) shougou=1;
5986 else if(skill_exp[i]<5000) shougou=2;
5987 else if(skill_exp[i]<8000) shougou=3;
5992 if(skill_exp[i]<4000) shougou=0;
5993 else if(skill_exp[i]<6000) shougou=1;
5994 else if(skill_exp[i]<7000) shougou=2;
5995 else if(skill_exp[i]<8000) shougou=3;
5998 fprintf(fff,"%-20s ",skill_name[i]);
5999 if (skill_exp[i] == skill_exp_settei[p_ptr->pclass][i][1]) fprintf(fff,"!");
6000 else fprintf(fff," ");
6001 fprintf(fff,"%s",shougou_moji[shougou]);
6002 if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
6006 /* Close the file */
6009 /* Display the file contents */
6011 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6013 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6017 /* Remove the file */
6023 * Pluralize a monster name
6025 void plural_aux(char *Name)
6027 int NameLen = strlen(Name);
6029 if (strstr(Name, "Disembodied hand"))
6031 strcpy(Name, "Disembodied hands that strangled people");
6033 else if (strstr(Name, "Colour out of space"))
6035 strcpy(Name, "Colours out of space");
6037 else if (strstr(Name, "stairway to hell"))
6039 strcpy(Name, "stairways to hell");
6041 else if (strstr(Name, "Dweller on the threshold"))
6043 strcpy(Name, "Dwellers on the threshold");
6045 else if (strstr(Name, " of "))
6047 cptr aider = strstr(Name, " of ");
6058 if (dummy[i-1] == 's')
6060 strcpy(&(dummy[i]), "es");
6065 strcpy(&(dummy[i]), "s");
6068 strcpy(&(dummy[i+1]), aider);
6069 strcpy(Name, dummy);
6071 else if (strstr(Name, "coins"))
6074 strcpy(dummy, "piles of ");
6075 strcat(dummy, Name);
6076 strcpy(Name, dummy);
6079 else if (strstr(Name, "Manes"))
6083 else if (streq(&(Name[NameLen - 2]), "ey"))
6085 strcpy(&(Name[NameLen - 2]), "eys");
6087 else if (Name[NameLen - 1] == 'y')
6089 strcpy(&(Name[NameLen - 1]), "ies");
6091 else if (streq(&(Name[NameLen - 4]), "ouse"))
6093 strcpy(&(Name[NameLen - 4]), "ice");
6095 else if (streq(&(Name[NameLen - 2]), "us"))
6097 strcpy(&(Name[NameLen - 2]), "i");
6099 else if (streq(&(Name[NameLen - 6]), "kelman"))
6101 strcpy(&(Name[NameLen - 6]), "kelmen");
6103 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6105 strcpy(&(Name[NameLen - 8]), "wordsmen");
6107 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6109 strcpy(&(Name[NameLen - 7]), "oodsmen");
6111 else if (streq(&(Name[NameLen - 7]), "eastman"))
6113 strcpy(&(Name[NameLen - 7]), "eastmen");
6115 else if (streq(&(Name[NameLen - 8]), "izardman"))
6117 strcpy(&(Name[NameLen - 8]), "izardmen");
6119 else if (streq(&(Name[NameLen - 5]), "geist"))
6121 strcpy(&(Name[NameLen - 5]), "geister");
6123 else if (streq(&(Name[NameLen - 2]), "ex"))
6125 strcpy(&(Name[NameLen - 2]), "ices");
6127 else if (streq(&(Name[NameLen - 2]), "lf"))
6129 strcpy(&(Name[NameLen - 2]), "lves");
6131 else if (suffix(Name, "ch") ||
6132 suffix(Name, "sh") ||
6133 suffix(Name, "nx") ||
6134 suffix(Name, "s") ||
6137 strcpy(&(Name[NameLen]), "es");
6141 strcpy(&(Name[NameLen]), "s");
6146 * Display current pets
6148 static void do_cmd_knowledge_pets(void)
6152 monster_type *m_ptr;
6154 int show_upkeep = 0;
6155 char file_name[1024];
6158 /* Open a new file */
6159 fff = my_fopen_temp(file_name, 1024);
6162 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6164 msg_format("Failed to create temporary file %s.", file_name);
6170 /* Process the monsters (backwards) */
6171 for (i = m_max - 1; i >= 1; i--)
6173 monster_race *r_ptr;
6174 /* Access the monster */
6177 /* Ignore "dead" monsters */
6178 if (!m_ptr->r_idx) continue;
6179 r_ptr = &r_info[m_ptr->r_idx];
6181 /* Calculate "upkeep" for pets */
6186 monster_desc(pet_name, m_ptr, 0x88);
6187 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6188 if (p_ptr->riding == i)
6190 fprintf(fff, " ¾èÇÏÃæ");
6192 fprintf(fff, " Riding");
6198 show_upkeep = calculate_upkeep();
6200 fprintf(fff, "----------------------------------------------\n");
6202 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6203 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6205 fprintf(fff, " Total: %d pet%s.\n",
6206 t_friends, (t_friends == 1 ? "" : "s"));
6207 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6212 /* Close the file */
6215 /* Display the file contents */
6217 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6219 show_file(TRUE, file_name, "Current Pets", 0, 0);
6223 /* Remove the file */
6231 * Note that the player ghosts are ignored. XXX XXX XXX
6233 static void do_cmd_knowledge_kill_count(void)
6241 char file_name[1024];
6246 /* Allocate the "who" array */
6247 C_MAKE(who, max_r_idx, s16b);
6249 /* Open a new file */
6250 fff = my_fopen_temp(file_name, 1024);
6253 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6255 msg_format("Failed to create temporary file %s.", file_name);
6262 /* Monsters slain */
6265 for (kk = 1; kk < max_r_idx; kk++)
6267 monster_race *r_ptr = &r_info[kk];
6269 if (r_ptr->flags1 & (RF1_UNIQUE))
6271 bool dead = (r_ptr->max_num == 0);
6280 s16b This = r_ptr->r_pkills;
6291 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6293 fprintf(fff,"You have defeated no enemies yet.\n\n");
6296 else if (Total == 1)
6298 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6300 fprintf(fff,"You have defeated one enemy.\n\n");
6305 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6307 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6314 /* Scan the monsters */
6315 for (i = 1; i < max_r_idx; i++)
6317 monster_race *r_ptr = &r_info[i];
6319 /* Use that monster */
6320 if (r_ptr->name) who[n++] = i;
6323 /* Select the sort method */
6324 ang_sort_comp = ang_sort_comp_hook;
6325 ang_sort_swap = ang_sort_swap_hook;
6327 /* Sort the array by dungeon depth of monsters */
6328 ang_sort(who, &why, n);
6330 /* Scan the monster races */
6331 for (k = 0; k < n; k++)
6333 monster_race *r_ptr = &r_info[who[k]];
6335 if (r_ptr->flags1 & (RF1_UNIQUE))
6337 bool dead = (r_ptr->max_num == 0);
6341 /* Print a message */
6342 fprintf(fff, " %s\n",
6343 (r_name + r_ptr->name));
6349 s16b This = r_ptr->r_pkills;
6354 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6355 if(strchr("pt",r_ptr->d_char))
6356 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6358 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6362 if (strstr(r_name + r_ptr->name, "coins"))
6364 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6368 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6374 strcpy(ToPlural, (r_name + r_ptr->name));
6375 plural_aux(ToPlural);
6376 fprintf(fff, " %d %s\n", This, ToPlural);
6386 fprintf(fff,"----------------------------------------------\n");
6388 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6390 fprintf(fff," Total: %lu creature%s killed.\n",
6391 Total, (Total == 1 ? "" : "s"));
6395 /* Close the file */
6398 /* Display the file contents */
6400 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6402 show_file(TRUE, file_name, "Kill Count", 0, 0);
6406 /* Remove the file */
6412 * Display known objects
6414 static void do_cmd_knowledge_objects(void)
6420 char o_name[MAX_NLEN];
6422 char file_name[1024];
6425 /* Open a new file */
6426 fff = my_fopen_temp(file_name, 1024);
6429 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6431 msg_format("Failed to create temporary file %s.", file_name);
6437 /* Scan the object kinds */
6438 for (k = 1; k < max_k_idx; k++)
6440 object_kind *k_ptr = &k_info[k];
6442 /* Hack -- skip artifacts */
6443 if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
6445 /* List known flavored objects */
6446 if (k_ptr->flavor && k_ptr->aware)
6449 object_type object_type_body;
6451 /* Get local object */
6452 i_ptr = &object_type_body;
6454 /* Create fake object */
6455 object_prep(i_ptr, k);
6457 /* Describe the object */
6458 object_desc_store(o_name, i_ptr, FALSE, 0);
6460 /* Print a message */
6461 fprintf(fff, " %s\n", o_name);
6465 /* Close the file */
6468 /* Display the file contents */
6470 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6472 show_file(TRUE, file_name, "Known Objects", 0, 0);
6476 /* Remove the file */
6482 * List virtues & status
6485 void do_cmd_knowledge_kubi(void)
6490 char file_name[1024];
6493 /* Open a new file */
6494 fff = my_fopen_temp(file_name, 1024);
6497 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6499 msg_format("Failed to create temporary file %s.", file_name);
6508 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6510 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6512 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6514 fprintf(fff, "List of wanted monsters\n");
6516 for (i = 0; i < MAX_KUBI; i++)
6518 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6519 if (kubi_r_idx[i] > 10000)
6521 fprintf(fff, "ºÑ\n");
6523 fprintf(fff, "done\n");
6526 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6530 /* Close the file */
6533 /* Display the file contents */
6535 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6537 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6541 /* Remove the file */
6546 * List virtues & status
6549 void do_cmd_knowledge_virtues(void)
6553 char file_name[1024];
6557 /* Open a new file */
6558 fff = my_fopen_temp(file_name, 1024);
6561 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6563 msg_format("Failed to create temporary file %s.", file_name);
6572 if (p_ptr->align > 150) disp_align = "ÂçÁ±";
6573 else if (p_ptr->align > 50) disp_align = "ÃæÁ±";
6574 else if (p_ptr->align > 10) disp_align = "¾®Á±";
6575 else if (p_ptr->align > -11) disp_align = "ÃæΩ";
6576 else if (p_ptr->align > -51) disp_align = "¾®°";
6577 else if (p_ptr->align > -151) disp_align = "Ãæ°";
6578 else disp_align = "Âç°";
6579 fprintf(fff, "¸½ºß¤Î°À : %s\n", disp_align);
6582 if (p_ptr->align > 150) disp_align = "lawful";
6583 else if (p_ptr->align > 50) disp_align = "good";
6584 else if (p_ptr->align > 10) disp_align = "neutral good";
6585 else if (p_ptr->align > -11) disp_align = "neutral";
6586 else if (p_ptr->align > -51) disp_align = "neutral evil";
6587 else if (p_ptr->align > -151) disp_align = "evil";
6588 else disp_align = "chaotic";
6589 fprintf(fff, "Your alighnment : %s\n", disp_align);
6595 /* Close the file */
6598 /* Display the file contents */
6600 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6602 show_file(TRUE, file_name, "Virtues", 0, 0);
6606 /* Remove the file */
6614 void do_cmd_knowledge_dungeon(void)
6618 char file_name[1024];
6622 /* Open a new file */
6623 fff = my_fopen_temp(file_name, 1024);
6626 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6628 msg_format("Failed to create temporary file %s.", file_name);
6636 for (i = 1; i < max_d_idx; i++)
6640 if (!d_info[i].maxdepth) continue;
6641 if (!max_dlv[i]) continue;
6642 if (d_info[i].final_guardian)
6644 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6646 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6648 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6650 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6655 /* Close the file */
6658 /* Display the file contents */
6660 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6662 show_file(TRUE, file_name, "Dungeon", 0, 0);
6666 /* Remove the file */
6671 * List virtues & status
6674 static void do_cmd_knowledge_stat(void)
6678 char file_name[1024];
6681 /* Open a new file */
6682 fff = my_fopen_temp(file_name, 1024);
6685 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6687 msg_format("Failed to create temporary file %s.", file_name);
6695 percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
6696 (2 * p_ptr->hitdie +
6697 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6700 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6701 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6702 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6704 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6705 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6706 fprintf(fff, "Limits of maximum stats\n\n");
6708 for (v_nr = 0; v_nr < 6; v_nr++)
6710 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);
6711 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6717 /* Close the file */
6720 /* Display the file contents */
6722 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6724 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6728 /* Remove the file */
6733 * Print quest status of all active quests
6735 static void do_cmd_knowledge_quests(void)
6738 char file_name[1024];
6740 char rand_tmp_str[120] = "\0";
6742 monster_race *r_ptr;
6744 int rand_level = 100;
6747 /* Open a new file */
6748 fff = my_fopen_temp(file_name, 1024);
6751 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6753 msg_format("Failed to create temporary file %s.", file_name);
6760 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6762 fprintf(fff, "< Current Quest >\n");
6765 for (i = 1; i < max_quests; i++)
6767 /* No info from "silent" quests */
6768 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6770 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6775 /* Clear the text */
6776 for (j = 0; j < 10; j++)
6778 quest_text[j][0] = '\0';
6781 quest_text_line = 0;
6785 /* Set the quest number temporary */
6786 old_quest = p_ptr->inside_quest;
6787 p_ptr->inside_quest = i;
6789 /* Get the quest text */
6790 init_flags = INIT_SHOW_TEXT;
6792 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6794 /* Reset the old quest number */
6795 p_ptr->inside_quest = old_quest;
6797 if (quest[i].type != QUEST_TYPE_RANDOM)
6799 char note[80] = "\0";
6801 if (quest[i].status == QUEST_STATUS_TAKEN)
6803 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6805 r_ptr = &r_info[quest[i].r_idx];
6806 strcpy(name, r_name + r_ptr->name);
6807 if (quest[i].max_num > 1)
6810 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6813 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
6818 sprintf(note," - %s¤òÅݤ¹¡£",name);
6820 sprintf(note," - kill %s.",name);
6823 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
6826 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
6828 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
6831 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
6833 strcpy(name, a_name + a_info[quest[i].k_idx].name);
6835 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
6837 sprintf(note," - Find out %s.", name);
6840 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
6842 sprintf(note," - õº÷¤¹¤ë¡£");
6844 sprintf(note," - Search.");
6846 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
6848 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
6850 sprintf(note," - Kill all monsters.");
6854 /* Print the quest info */
6856 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
6858 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
6861 quest[i].name, quest[i].level, note);
6863 fprintf(fff, tmp_str);
6865 if (quest[i].status == QUEST_STATUS_COMPLETED)
6868 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
6870 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
6874 fprintf(fff, tmp_str);
6880 while (quest_text[j][0] && j < 10)
6882 fprintf(fff, " %s\n", quest_text[j]);
6887 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
6888 (quest[i].level < rand_level))
6891 rand_level = quest[i].level;
6893 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6895 /* Print the quest info */
6896 r_ptr = &r_info[quest[i].r_idx];
6897 strcpy(name, r_name + r_ptr->name);
6899 if (quest[i].max_num > 1)
6902 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
6903 quest[i].name, quest[i].level,
6904 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6908 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6909 quest[i].name, quest[i].level,
6910 quest[i].max_num, name, quest[i].cur_num);
6917 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
6919 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
6922 quest[i].name, quest[i].level, name);
6929 /* Print the current random quest */
6930 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
6933 if (!total) fprintf(fff, "¤Ê¤·\n");
6935 if (!total) fprintf(fff, "Nothing.\n");
6939 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
6941 fprintf(fff, "\n< Completed Quest >\n");
6944 for (i = 1; i < max_quests; i++)
6946 /* No info from "silent" quests */
6947 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6949 if (quest[i].status == QUEST_STATUS_FINISHED)
6955 if (i < MIN_RANDOM_QUEST)
6957 /* Set the quest number temporary */
6958 old_quest = p_ptr->inside_quest;
6959 p_ptr->inside_quest = i;
6962 init_flags = INIT_ASSIGN;
6964 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6966 /* Reset the old quest number */
6967 p_ptr->inside_quest = old_quest;
6970 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
6972 /* Print the quest info */
6974 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
6976 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
6979 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
6983 /* Print the quest info */
6985 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
6987 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
6990 quest[i].name, quest[i].level, quest[i].complev);
6993 fprintf(fff, tmp_str);
6997 if (!total) fprintf(fff, "¤Ê¤·\n");
6999 if (!total) fprintf(fff, "Nothing.\n");
7003 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7005 fprintf(fff, "\n< Failed Quest >\n");
7008 for (i = 1; i < max_quests; i++)
7010 /* No info from "silent" quests */
7011 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7013 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7019 if (i < MIN_RANDOM_QUEST)
7021 /* Set the quest number temporary */
7022 old_quest = p_ptr->inside_quest;
7023 p_ptr->inside_quest = i;
7025 /* Get the quest text */
7026 init_flags = INIT_ASSIGN;
7028 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7030 /* Reset the old quest number */
7031 p_ptr->inside_quest = old_quest;
7034 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7036 /* Print the quest info */
7038 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7040 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7043 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7047 /* Print the quest info */
7049 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7051 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7054 quest[i].name, quest[i].level, quest[i].complev);
7056 fprintf(fff, tmp_str);
7060 if (!total) fprintf(fff, "¤Ê¤·\n");
7062 if (!total) fprintf(fff, "Nothing.\n");
7067 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7069 fprintf(fff, "\n< Remaining Random Quest >\n");
7072 for (i = 1; i < max_quests; i++)
7074 /* No info from "silent" quests */
7075 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7077 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7081 /* Print the quest info */
7083 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7085 sprintf(tmp_str, "%s (%d, %s)\n",
7088 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7089 fprintf(fff, tmp_str);
7093 if (!total) fprintf(fff, "¤Ê¤·\n");
7095 if (!total) fprintf(fff, "Nothing.\n");
7099 /* Close the file */
7102 /* Display the file contents */
7104 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7106 show_file(TRUE, file_name, "Quest status", 0, 0);
7110 /* Remove the file */
7120 void do_cmd_knowledge_home(void)
7125 char file_name[1024];
7127 char o_name[MAX_NLEN];
7130 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7132 /* Open a new file */
7133 fff = my_fopen_temp(file_name, 1024);
7136 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7138 msg_format("Failed to create temporary file %s.", file_name);
7146 /* Print all homes in the different towns */
7147 st_ptr = &town[1].store[STORE_HOME];
7149 /* Home -- if anything there */
7150 if (st_ptr->stock_num)
7152 /* Header with name of the town */
7154 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7156 fprintf(fff, " [Home Inventory]\n");
7160 /* Dump all available items */
7161 for (i = 0; i < st_ptr->stock_num; i++)
7164 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7165 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7166 if (strlen(o_name) <= 80-3)
7168 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7174 for (n = 0, t = o_name; n < 80-3; n++, t++)
7175 if(iskanji(*t)) {t++; n++;}
7176 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7178 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7179 fprintf(fff, " %.77s\n", o_name+n);
7182 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7183 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7188 /* Add an empty line */
7189 fprintf(fff, "\n\n");
7193 /* Close the file */
7196 /* Display the file contents */
7198 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7200 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7204 /* Remove the file */
7210 * Check the status of "autopick"
7212 static void do_cmd_knowledge_autopick(void)
7216 char file_name[1024];
7218 /* Open a new file */
7219 fff = my_fopen_temp(file_name, 1024);
7224 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7226 msg_format("Failed to create temporary file %s.", file_name);
7235 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7237 fprintf(fff, "No preference for auto picker/destroyer.");
7243 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7245 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7249 for (k = 0; k < max_autopick; k++)
7251 if (!(autopick_action[k] & DO_AUTOPICK))
7254 fprintf(fff, " [ÊüÃÖ]");
7256 fprintf(fff, " [Leave]");
7259 else if ((autopick_action[k] & DO_AUTODESTROY))
7262 fprintf(fff, " [Ç˲õ]");
7264 fprintf(fff, " [Destroy]");
7270 fprintf(fff, " [½¦¤¦]");
7272 fprintf(fff, " [Pickup]");
7276 fprintf(fff, " %s", autopick_name[k]);
7277 if(autopick_insc[k] != NULL)
7278 fprintf(fff, " {%s}", autopick_insc[k]);
7281 /* Close the file */
7283 /* Display the file contents */
7285 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7287 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7290 /* Remove the file */
7297 * Interact with "knowledge"
7299 void do_cmd_knowledge(void)
7302 /* File type is "TEXT" */
7303 FILE_TYPE(FILE_TYPE_TEXT);
7304 /* Save the screen */
7306 /* Interact until done */
7311 /* Ask for a choice */
7313 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7314 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7316 prt(format("page %d/2", (p+1)), 2, 65);
7317 prt("Display current knowledge", 3, 0);
7320 /* Give some choices */
7323 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7324 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7325 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7326 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7327 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7328 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7329 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7330 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7331 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7333 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7334 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7335 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7336 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7337 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7338 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7339 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7340 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7341 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7345 prt("(1) Display known artifacts", 6, 5);
7346 prt("(2) Display known objects", 7, 5);
7347 prt("(3) Display remaining uniques", 8, 5);
7348 prt("(4) Display dead uniques", 9, 5);
7349 prt("(5) Display kill count", 10, 5);
7350 prt("(6) Display wanted monsters", 11, 5);
7351 prt("(7) Display current pets", 12, 5);
7352 prt("(8) Display home inventory", 13, 5);
7353 prt("(9) Display *identified* equip.", 14, 5);
7355 prt("(a) Display about yourself", 6, 5);
7356 prt("(b) Display mutations", 7, 5);
7357 prt("(c) Display weapon proficiency", 8, 5);
7358 prt("(d) Display spell proficiency", 9, 5);
7359 prt("(e) Display misc. proficiency", 10, 5);
7360 prt("(f) Display virtues", 11, 5);
7361 prt("(g) Display dungeons", 12, 5);
7362 prt("(h) Display current quests", 13, 5);
7363 prt("(i) Display auto pick/destroy", 14, 5);
7368 prt("-³¤¯-", 16, 8);
7369 prt("ESC) È´¤±¤ë", 21, 1);
7370 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7371 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7372 prt("¥³¥Þ¥ó¥É:", 20, 0);
7374 prt("-more-", 16, 8);
7375 prt("ESC) Exit menu", 21, 1);
7376 prt("SPACE) Next page", 21, 30);
7377 /*prt("-) Previous page", 21, 60);*/
7378 prt("Command: ", 20, 0);
7384 if (i == ESCAPE) break;
7387 case ' ': /* Page change */
7391 case '1': /* Artifacts */
7392 do_cmd_knowledge_artifacts();
7394 case '2': /* Objects */
7395 do_cmd_knowledge_objects();
7397 case '3': /* Uniques */
7398 do_cmd_knowledge_uniques();
7400 case '4': /* Uniques */
7401 do_cmd_knowledge_uniques_dead();
7403 case '5': /* Kill count */
7404 do_cmd_knowledge_kill_count();
7406 case '6': /* wanted */
7407 do_cmd_knowledge_kubi();
7409 case '7': /* Pets */
7410 do_cmd_knowledge_pets();
7412 case '8': /* Home */
7413 do_cmd_knowledge_home();
7415 case '9': /* Resist list */
7416 do_cmd_knowledge_inven();
7419 case 'a': /* Max stat */
7420 do_cmd_knowledge_stat();
7422 case 'b': /* Mutations */
7423 do_cmd_knowledge_mutations();
7425 case 'c': /* weapon-exp */
7426 do_cmd_knowledge_weapon_exp();
7428 case 'd': /* spell-exp */
7429 do_cmd_knowledge_spell_exp();
7431 case 'e': /* skill-exp */
7432 do_cmd_knowledge_skill_exp();
7434 case 'f': /* Virtues */
7435 do_cmd_knowledge_virtues();
7437 case 'g': /* Dungeon */
7438 do_cmd_knowledge_dungeon();
7440 case 'h': /* Quests */
7441 do_cmd_knowledge_quests();
7443 case 'i': /* Autopick */
7444 do_cmd_knowledge_autopick();
7446 default: /* Unknown option */
7449 /* Flush messages */
7452 /* Restore the screen */
7458 * Check on the status of an active quest
7460 void do_cmd_checkquest(void)
7462 /* File type is "TEXT" */
7463 FILE_TYPE(FILE_TYPE_TEXT);
7465 /* Save the screen */
7469 do_cmd_knowledge_quests();
7471 /* Restore the screen */
7477 * Display the time and date
7479 void do_cmd_time(void)
7481 int day, hour, min, full, start, end, num;
7488 s32b len = 20L * TOWN_DAWN;
7489 s32b tick = turn % len + len / 4;
7491 if ((p_ptr->prace == RACE_VAMPIRE) ||
7492 (p_ptr->prace == RACE_SKELETON) ||
7493 (p_ptr->prace == RACE_ZOMBIE) ||
7494 (p_ptr->prace == RACE_SPECTRE))
7495 day = (turn - (15L * TOWN_DAWN))/ len + 1;
7497 day = (turn + (5L * TOWN_DAWN))/ len + 1;
7498 hour = (24 * tick / len) % 24;
7499 min = (1440 * tick / len) % 60;
7500 full = hour * 100 + min;
7508 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7510 strcpy(desc, "It is a strange time.");
7516 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7518 msg_format("This is day %d. The time is %d:%02d %s.",
7521 day, (hour % 12 == 0) ? 12 : (hour % 12),
7522 min, (hour < 12) ? "AM" : "PM");
7525 if (!rand_int(10) || p_ptr->image)
7528 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7530 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7537 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7539 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7544 /* Open this file */
7545 fff = my_fopen(buf, "rt");
7550 /* Find this time */
7551 while (!my_fgets(fff, buf, 1024))
7553 /* Ignore comments */
7554 if (!buf[0] || (buf[0] == '#')) continue;
7556 /* Ignore invalid lines */
7557 if (buf[1] != ':') continue;
7559 /* Process 'Start' */
7562 /* Extract the starting time */
7563 start = atoi(buf + 2);
7565 /* Assume valid for an hour */
7575 /* Extract the ending time */
7576 end = atoi(buf + 2);
7582 /* Ignore incorrect range */
7583 if ((start > full) || (full > end)) continue;
7585 /* Process 'Description' */
7590 /* Apply the randomizer */
7591 if (!rand_int(num)) strcpy(desc, buf + 2);
7601 /* Close the file */