3 /* Purpose: Interface commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 * mark strings for auto dump
19 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
20 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
23 * Remove old lines automatically generated before.
25 static void remove_auto_dump(cptr orig_file, cptr mark)
27 FILE *tmp_fff, *orig_fff;
31 bool between_mark = FALSE;
34 long header_location = 0;
35 char header_mark_str[80];
36 char footer_mark_str[80];
39 sprintf(header_mark_str, auto_dump_header, mark);
40 sprintf(footer_mark_str, auto_dump_footer, mark);
42 mark_len = strlen(footer_mark_str);
44 /* If original file is not exist, nothing to do */
45 orig_fff = my_fopen(orig_file, "r");
52 tmp_fff = my_fopen_temp(tmp_file, 1024);
55 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
57 msg_format("Failed to create temporary file %s.", tmp_file);
65 if (my_fgets(orig_fff, buf, 1024))
69 fseek(orig_fff, header_location, SEEK_SET);
81 if (!strcmp(buf, header_mark_str))
83 header_location = ftell(orig_fff);
90 fprintf(tmp_fff, "%s\n", buf);
95 if (!strncmp(buf, footer_mark_str, mark_len))
99 if (!sscanf(buf + mark_len, " (%d)", &tmp)
102 fseek(orig_fff, header_location, SEEK_SET);
105 between_mark = FALSE;
118 /* copy contents of temporally file */
120 tmp_fff = my_fopen(tmp_file, "r");
121 orig_fff = my_fopen(orig_file, "w");
123 while (!my_fgets(tmp_fff, buf, 1024))
124 fprintf(orig_fff, "%s\n", buf);
135 * Open file to append auto dump.
137 static FILE *open_auto_dump(cptr buf, cptr mark, int *line)
141 char header_mark_str[80];
146 sprintf(header_mark_str, auto_dump_header, mark);
148 /* Remove old macro dumps */
149 remove_auto_dump(buf, mark);
151 /* Append to the file */
152 fff = my_fopen(buf, "a");
157 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
159 msg_format("Failed to open %s.", buf);
170 fprintf(fff, "%s\n", header_mark_str);
173 fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
174 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
176 fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
177 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
185 * Append foot part and close auto dump.
187 static void close_auto_dump(FILE *fff, cptr mark, int line_num)
189 char footer_mark_str[80];
191 sprintf(footer_mark_str, auto_dump_footer, mark);
195 fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
196 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
198 fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
199 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
203 fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
215 * Take note to the dialy.
218 errr do_cmd_write_nikki(int type, int num, cptr note)
224 cptr note_level = "";
225 bool do_level = TRUE;
227 s32b len = 20L * TOWN_DAWN;
228 s32b tick = turn % len + len / 4;
230 static bool disable_nikki = FALSE;
232 if (disable_nikki) return(-1);
234 if ((p_ptr->prace == RACE_VAMPIRE) ||
235 (p_ptr->prace == RACE_SKELETON) ||
236 (p_ptr->prace == RACE_ZOMBIE) ||
237 (p_ptr->prace == RACE_SPECTRE))
238 day = (turn - (15L * TOWN_DAWN))/ len + 1;
240 day = (turn + (5L * TOWN_DAWN))/ len + 1;
242 hour = (24 * tick / len) % 24;
243 min = (1440 * tick / len) % 60;
245 if (type == NIKKI_FIX_QUEST_C ||
246 type == NIKKI_FIX_QUEST_F ||
247 type == NIKKI_RAND_QUEST_C ||
248 type == NIKKI_RAND_QUEST_F ||
249 type == NIKKI_TO_QUEST)
253 old_quest = p_ptr->inside_quest;
254 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
256 /* Get the quest text */
257 init_flags = INIT_ASSIGN;
259 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
261 /* Reset the old quest number */
262 p_ptr->inside_quest = old_quest;
266 sprintf(file_name,"playrecord-%s.txt",savefile_base);
268 /* different filne name to avoid mixing */
269 sprintf(file_name,"playrec-%s.txt",savefile_base);
272 /* Hack -- drop permissions */
275 /* Build the filename */
276 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
278 /* File type is "TEXT" */
279 FILE_TYPE(FILE_TYPE_TEXT);
281 fff = my_fopen(buf, "a");
286 /* Hack -- grab permissions */
289 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
291 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
300 if (p_ptr->inside_arena)
302 note_level = "¥¢¥ê¡¼¥Ê:";
304 note_level = "Arane:";
308 note_level = "ÃϾå:";
310 note_level = "Surface:";
312 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
314 note_level = "¥¯¥¨¥¹¥È:";
316 note_level = "Quest:";
320 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
322 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
331 fprintf(fff, "%dÆüÌÜ\n",day);
333 fprintf(fff, "Day %d\n",day);
342 fprintf(fff, "%s\n",note);
346 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
352 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
354 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
361 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
363 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
367 case NIKKI_FIX_QUEST_C:
369 if (quest[num].flags & QUEST_FLAG_SILENT) break;
371 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
373 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
377 case NIKKI_FIX_QUEST_F:
379 if (quest[num].flags & QUEST_FLAG_SILENT) break;
381 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
383 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
387 case NIKKI_RAND_QUEST_C:
390 strcpy(name, r_name+r_info[quest[num].r_idx].name);
392 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
394 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
398 case NIKKI_RAND_QUEST_F:
401 strcpy(name, r_name+r_info[quest[num].r_idx].name);
403 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
405 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
409 case NIKKI_MAXDEAPTH:
412 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
414 fprintf(fff, " %2d:%02d %20s reached level %d of %s for the first time.\n", hour, min, note_level, num, d_name+d_info[dungeon_type].name);
421 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
423 fprintf(fff, " %2d:%02d %20s reset recall level of %s to %d %s.\n", hour, min, note_level, d_name + d_info[num].name, max_dlv[num], note);
430 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
441 if (!(dun_level+num)) to = "ÃϾå";
442 else to = format("%d³¬", dun_level+num);
444 if (!(dun_level+num)) to = "the surfice";
445 else to = format("level %d", dun_level+num);
450 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
452 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
460 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
462 fprintf(fff, " %2d:%02d %20s recall to dungeon level %d of %s.\n", hour, min, note_level, max_dlv[dungeon_type], d_name+d_info[dungeon_type].name);
466 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
468 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
474 if (quest[num].flags & QUEST_FLAG_SILENT) break;
476 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
478 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
493 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
504 if (!(dun_level+num)) to = "ÃϾå";
505 else to = format("%d³¬", dun_level+num);
507 if (!(dun_level+num)) to = "surface";
508 else to = format("level %d", dun_level+num);
513 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
515 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
522 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
524 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
531 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
533 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
543 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, p_ptr->arena_number + 1, note);
545 int n = p_ptr->arena_number + 1;
546 fprintf(fff, " %2d:%02d %20s beaten by %s in the %d%s fight.\n", hour, min, note_level, note, n, (n%10==1?"st":n%10==2?"nd":n%10==3?"rd":"th"));
551 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
553 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);
555 if (num == MAX_ARENA_MONS)
558 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
560 fprintf(fff, " win all fight to become a Chanpion.\n");
569 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
571 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
586 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
588 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
592 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
594 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
601 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
603 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
607 case NIKKI_GAMESTART:
609 time_t ct = time((time_t*)0);
613 fprintf(fff, "%s %s",note, ctime(&ct));
616 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
619 case NIKKI_NAMED_PET:
621 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
626 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
628 fprintf(fff, "decide to travel together with %s.\n", note);
633 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
635 fprintf(fff, "unname %s.\n", note);
640 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
642 fprintf(fff, "dismiss %s.\n", note);
647 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
649 fprintf(fff, "%s die.\n", note);
654 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
656 fprintf(fff, "move to other map leaving %s behind.\n", note);
661 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
663 fprintf(fff, "lose sight of %s.\n", note);
668 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
670 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
675 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
677 fprintf(fff, "%s is crushed by falling rocks.\n", note);
692 /* Hack -- grab permissions */
695 if (do_level) write_level = FALSE;
701 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
703 static void do_cmd_disp_nikki(void)
705 char nikki_title[256];
710 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
711 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
722 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
723 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
724 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
725 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
730 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
739 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
741 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
742 "Attack is the best form of defence.",
744 "An unexpected windfall",
745 "A drowning man will catch at a straw",
746 "Don't count your chickens before they are hatched.",
747 "It is no use crying over spilt milk.",
748 "Seeing is believing.",
749 "Strike the iron while it is hot.",
750 "I don't care what follows.",
751 "To dig a well to put out a house on fire.",
752 "Tomorrow is another day.",
753 "Easy come, easy go.",
754 "The more haste, the less speed.",
755 "Where there is life, there is hope.",
756 "There is no royal road to *WINNER*.",
757 "Danger past, God forgotten.",
758 "The best thing to do now is to run away.",
759 "Life is but an empty dream.",
760 "Dead men tell no tales.",
761 "A book that remains shut is but a block.",
762 "Misfortunes never come singly.",
763 "A little knowledge is a dangerous thing.",
764 "History repeats itself.",
765 "*WINNER* was not built in a day.",
766 "Ignorance is bliss.",
767 "To lose is to win?",
768 "No medicine can cure folly.",
769 "All good things come to an end.",
770 "M$ Empire strikes back.",
771 "To see is to believe",
773 "Quest of The World's Greatest Brain"};
776 sprintf(file_name,"playrecord-%s.txt",savefile_base);
778 sprintf(file_name,"playrec-%s.txt",savefile_base);
781 /* Hack -- drop permissions */
784 /* Build the filename */
785 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
787 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
788 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
789 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
790 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
791 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
794 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
795 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
797 sprintf(nikki_title, "Legend of %s %s '%s'",
798 ap_ptr->title, player_name, tmp);
801 /* Display the file contents */
802 show_file(FALSE, buf, nikki_title, -1, 0);
804 /* Hack -- grab permissions */
808 static void do_cmd_bunshou(void)
811 char bunshou[80] = "\0";
814 if (get_string("ÆâÍÆ: ", tmp, 79))
816 if (get_string("diary note: ", tmp, 79))
819 strcpy(bunshou, tmp);
821 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
825 static void do_cmd_last_get(void)
830 if (record_o_name[0] == '\0') return;
833 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
835 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
837 if (!get_check(buf)) return;
842 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
844 sprintf(buf,"descover %s.", record_o_name);
846 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
850 static void do_cmd_erase_nikki(void)
857 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
859 if (!get_check("Do you really want to delete all your record? ")) return;
863 sprintf(file_name,"playrecord-%s.txt",savefile_base);
865 sprintf(file_name,"playrec-%s.txt",savefile_base);
868 /* Hack -- drop permissions */
871 /* Build the filename */
872 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
874 /* Remove the file */
877 fff = my_fopen(buf, "w");
881 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
883 msg_format("deleted record.");
887 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
889 msg_format("failed to delete %s.", buf);
894 /* Hack -- grab permissions */
901 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
907 void do_cmd_nikki(void)
911 /* File type is "TEXT" */
912 FILE_TYPE(FILE_TYPE_TEXT);
914 /* Save the screen */
917 /* Interact until done */
923 /* Ask for a choice */
925 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
927 prt("[ Play Record ]", 2, 0);
931 /* Give some choices */
933 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
934 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
935 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
936 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
938 prt("(1) Display your record", 4, 5);
939 prt("(2) Add record", 5, 5);
940 prt("(3) Record item you last get/identify", 6, 5);
941 prt("(4) Delete your record", 7, 5);
947 prt("¥³¥Þ¥ó¥É:", 18, 0);
949 prt("Command: ", 18, 0);
957 if (i == ESCAPE) break;
971 do_cmd_erase_nikki();
978 default: /* Unknown option */
986 /* Restore the screen */
991 * Hack -- redraw the screen
993 * This command performs various low level updates, clears all the "extra"
994 * windows, does a total redraw of the main window, and requests all of the
995 * interesting updates and redraws that I can think of.
997 * This command is also used to "instantiate" the results of the user
998 * selecting various things, such as graphics mode, so it must call
999 * the "TERM_XTRA_REACT" hook before redrawing the windows.
1001 void do_cmd_redraw(void)
1008 /* Hack -- react to changes */
1009 Term_xtra(TERM_XTRA_REACT, 0);
1012 /* Combine and Reorder the pack (later) */
1013 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1017 p_ptr->update |= (PU_TORCH);
1020 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1022 /* Forget lite/view */
1023 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1025 /* Update lite/view */
1026 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1028 /* Update monsters */
1029 p_ptr->update |= (PU_MONSTERS);
1031 /* Redraw everything */
1032 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1035 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1038 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1042 /* Hack -- update */
1045 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1048 /* Redraw every window */
1049 for (j = 0; j < 8; j++)
1052 if (!angband_term[j]) continue;
1055 Term_activate(angband_term[j]);
1070 * Hack -- change name
1072 void do_cmd_change_name(void)
1081 /* Save the screen */
1089 /* Display the player */
1090 display_player(mode);
1095 display_player(mode);
1100 Term_putstr(2, 23, -1, TERM_WHITE,
1101 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1103 Term_putstr(2, 23, -1, TERM_WHITE,
1104 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1112 if (c == ESCAPE) break;
1123 sprintf(tmp, "%s.txt", player_base);
1125 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1127 if (get_string("File name: ", tmp, 80))
1131 if (tmp[0] && (tmp[0] != ' '))
1133 file_character(tmp, TRUE);
1150 /* Flush messages */
1154 /* Restore the screen */
1157 /* Redraw everything */
1158 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1165 * Recall the most recent message
1167 void do_cmd_message_one(void)
1169 /* Recall one message XXX XXX XXX */
1170 prt(format("> %s", message_str(0)), 0, 0);
1175 * Show previous messages to the user -BEN-
1177 * The screen format uses line 0 and 23 for headers and prompts,
1178 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1180 * This command shows you which commands you are viewing, and allows
1181 * you to "search" for strings in the recall.
1183 * Note that messages may be longer than 80 characters, but they are
1184 * displayed using "infinite" length, with a special sub-command to
1185 * "slide" the virtual display to the left or right.
1187 * Attempt to only hilite the matching portions of the string.
1189 void do_cmd_messages(int num_now)
1205 /* Total messages */
1208 /* Start on first message */
1211 /* Start at leftmost edge */
1214 /* Save the screen */
1217 /* Process requests until done */
1223 /* Dump up to 20 lines of messages */
1224 for (j = 0; (j < 20) && (i + j < n); j++)
1226 cptr msg = message_str(i+j);
1228 /* Apply horizontal scroll */
1229 msg = (strlen(msg) >= q) ? (msg + q) : "";
1231 /* Dump the messages, bottom to top */
1232 Term_putstr(0, 21-j, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1234 /* Hilite "shower" */
1239 /* Display matches */
1240 while ((str = strstr(str, shower)) != NULL)
1242 int len = strlen(shower);
1244 /* Display the match */
1245 Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
1253 /* Display header XXX XXX XXX */
1256 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1257 i, i+j-1, n, q), 0, 0);
1259 prt(format("Message Recall (%d-%d of %d), Offset %d",
1260 i, i+j-1, n, q), 0, 0);
1264 /* Display prompt (not very informative) */
1266 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", 23, 0);
1268 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0);
1275 /* Exit on Escape */
1276 if (k == ESCAPE) break;
1278 /* Hack -- Save the old index */
1281 /* Horizontal scroll */
1285 q = (q >= 40) ? (q - 40) : 0;
1291 /* Horizontal scroll */
1301 /* Hack -- handle show */
1306 prt("¶¯Ä´: ", 23, 0);
1308 prt("Show: ", 23, 0);
1312 /* Get a "shower" string, or continue */
1313 if (!askfor_aux(shower, 80)) continue;
1319 /* Hack -- handle find */
1326 prt("¸¡º÷: ", 23, 0);
1328 prt("Find: ", 23, 0);
1332 /* Get a "finder" string, or continue */
1333 if (!askfor_aux(finder, 80)) continue;
1336 strcpy(shower, finder);
1339 for (z = i + 1; z < n; z++)
1341 cptr msg = message_str(z);
1344 if (strstr(msg, finder))
1355 /* Recall 1 older message */
1356 if ((k == '8') || (k == '\n') || (k == '\r'))
1358 /* Go newer if legal */
1359 if (i + 1 < n) i += 1;
1362 /* Recall 10 older messages */
1365 /* Go older if legal */
1366 if (i + 10 < n) i += 10;
1369 /* Recall 20 older messages */
1370 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1372 /* Go older if legal */
1373 if (i + 20 < n) i += 20;
1376 /* Recall 20 newer messages */
1377 if ((k == 'n') || (k == KTRL('N')))
1379 /* Go newer (if able) */
1380 i = (i >= 20) ? (i - 20) : 0;
1383 /* Recall 10 newer messages */
1386 /* Go newer (if able) */
1387 i = (i >= 20) ? (i - 20) : 0;
1390 /* Recall 1 newer messages */
1393 /* Go newer (if able) */
1394 i = (i >= 1) ? (i - 1) : 0;
1397 /* Hack -- Error of some kind */
1401 /* Restore the screen */
1408 * Number of cheating options
1415 static option_type cheat_info[CHEAT_MAX] =
1417 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1419 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1421 "cheat_peek", "Peek into object creation" },
1425 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1427 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1429 "cheat_hear", "Peek into monster creation" },
1433 { &cheat_room, FALSE, 255, 0x04, 0x00,
1435 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1437 "cheat_room", "Peek into dungeon creation" },
1441 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1443 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1445 "cheat_xtra", "Peek into something else" },
1449 { &cheat_know, FALSE, 255, 0x10, 0x00,
1451 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1453 "cheat_know", "Know complete monster info" },
1457 { &cheat_live, FALSE, 255, 0x20, 0x00,
1459 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1461 "cheat_live", "Allow player to avoid death" }
1467 * Interact with some options for cheating
1469 static void do_cmd_options_cheat(cptr info)
1473 int i, k = 0, n = CHEAT_MAX;
1481 /* Interact with the player */
1484 /* Prompt XXX XXX XXX */
1486 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1488 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1494 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1495 prt(" << Ãí°Õ >>", 11, 0);
1496 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1497 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1498 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1500 /* Display the options */
1501 for (i = 0; i < n; i++)
1503 byte a = TERM_WHITE;
1505 /* Color current option */
1506 if (i == k) a = TERM_L_BLUE;
1508 /* Display the option text */
1509 sprintf(buf, "%-48s: %s (%s)",
1510 cheat_info[i].o_desc,
1512 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1514 (*cheat_info[i].o_var ? "yes" : "no "),
1517 cheat_info[i].o_text);
1518 c_prt(a, buf, i + 2, 0);
1521 /* Hilite current option */
1522 move_cursor(k + 2, 50);
1538 k = (n + k - 1) % n;
1557 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1559 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1561 noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1562 (*cheat_info[k].o_var) = TRUE;
1571 (*cheat_info[k].o_var) = FALSE;
1586 static option_type autosave_info[2] =
1588 { &autosave_l, FALSE, 255, 0x01, 0x00,
1590 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1592 "autosave_l", "Autosave when entering new levels" },
1596 { &autosave_t, FALSE, 255, 0x02, 0x00,
1598 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1600 "autosave_t", "Timed autosave" },
1606 static s16b toggle_frequency(s16b current)
1608 if (current == 0) return 50;
1609 if (current == 50) return 100;
1610 if (current == 100) return 250;
1611 if (current == 250) return 500;
1612 if (current == 500) return 1000;
1613 if (current == 1000) return 2500;
1614 if (current == 2500) return 5000;
1615 if (current == 5000) return 10000;
1616 if (current == 10000) return 25000;
1623 * Interact with some options for cheating
1625 static void do_cmd_options_autosave(cptr info)
1629 int i, k = 0, n = 2;
1637 /* Interact with the player */
1640 /* Prompt XXX XXX XXX */
1642 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1644 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1649 /* Display the options */
1650 for (i = 0; i < n; i++)
1652 byte a = TERM_WHITE;
1654 /* Color current option */
1655 if (i == k) a = TERM_L_BLUE;
1657 /* Display the option text */
1658 sprintf(buf, "%-48s: %s (%s)",
1659 autosave_info[i].o_desc,
1661 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1663 (*autosave_info[i].o_var ? "yes" : "no "),
1666 autosave_info[i].o_text);
1667 c_prt(a, buf, i + 2, 0);
1671 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1673 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1678 /* Hilite current option */
1679 move_cursor(k + 2, 50);
1695 k = (n + k - 1) % n;
1713 (*autosave_info[k].o_var) = TRUE;
1722 (*autosave_info[k].o_var) = FALSE;
1730 autosave_freq = toggle_frequency(autosave_freq);
1732 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1734 prt(format("Timed autosave frequency: every %d turns",
1737 autosave_freq), 5, 0);
1750 #define PAGE_AUTODESTROY 7
1753 * Interact with some options
1755 void do_cmd_options_aux(int page, cptr info)
1758 int i, k = 0, n = 0, l;
1763 /* Lookup the options */
1764 for (i = 0; i < 24; i++) opt[i] = 0;
1766 /* Scan the options */
1767 for (i = 0; option_info[i].o_desc; i++)
1769 /* Notice options on this "page" */
1770 if (option_info[i].o_page == page) opt[n++] = i;
1778 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
1780 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
1783 /* Interact with the player */
1786 /* Prompt XXX XXX XXX */
1788 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1790 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1795 /* Display the options */
1796 for (i = 0; i < n; i++)
1798 byte a = TERM_WHITE;
1800 /* Color current option */
1801 if (i == k) a = TERM_L_BLUE;
1803 /* Display the option text */
1804 sprintf(buf, "%-48s: %s (%.19s)",
1805 option_info[opt[i]].o_desc,
1807 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1809 (*option_info[opt[i]].o_var ? "yes" : "no "),
1812 option_info[opt[i]].o_text);
1813 if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
1814 else c_prt(a, buf, i + 2, 0);
1817 if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
1819 /* Hilite current option */
1820 move_cursor(k + 2 + l, 50);
1838 k = (n + k - 1) % n;
1859 (*option_info[opt[k]].o_var) = TRUE;
1870 (*option_info[opt[k]].o_var) = FALSE;
1878 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1893 * Modify the "window" options
1895 static void do_cmd_options_win(void)
1909 /* Memorize old flags */
1910 for (j = 0; j < 8; j++)
1912 /* Acquire current flags */
1913 old_flag[j] = window_flag[j];
1923 /* Prompt XXX XXX XXX */
1925 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1927 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1931 /* Display the windows */
1932 for (j = 0; j < 8; j++)
1934 byte a = TERM_WHITE;
1936 cptr s = angband_term_name[j];
1939 if (j == x) a = TERM_L_BLUE;
1941 /* Window name, staggered, centered */
1942 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1945 /* Display the options */
1946 for (i = 0; i < 16; i++)
1948 byte a = TERM_WHITE;
1950 cptr str = window_flag_desc[i];
1953 if (i == y) a = TERM_L_BLUE;
1957 if (!str) str = "(̤»ÈÍÑ)";
1959 if (!str) str = "(Unused option)";
1964 Term_putstr(0, i + 5, -1, a, str);
1966 /* Display the windows */
1967 for (j = 0; j < 8; j++)
1969 byte a = TERM_WHITE;
1974 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1977 if (window_flag[j] & (1L << i)) c = 'X';
1980 Term_putch(35 + j * 5, i + 5, a, c);
1985 Term_gotoxy(35 + x * 5, y + 5);
2003 for (j = 0; j < 8; j++)
2005 window_flag[j] &= ~(1L << y);
2009 for (i = 0; i < 16; i++)
2011 window_flag[x] &= ~(1L << i);
2024 window_flag[x] |= (1L << y);
2032 window_flag[x] &= ~(1L << y);
2038 d = get_keymap_dir(ch);
2040 x = (x + ddx[d] + 8) % 8;
2041 y = (y + ddy[d] + 16) % 16;
2048 /* Notice changes */
2049 for (j = 0; j < 8; j++)
2054 if (!angband_term[j]) continue;
2056 /* Ignore non-changes */
2057 if (window_flag[j] == old_flag[j]) continue;
2060 Term_activate(angband_term[j]);
2077 * Set or unset various options.
2079 * The user must use the "Ctrl-R" command to "adapt" to changes
2080 * in any options which control "visual" aspects of the game.
2082 void do_cmd_options(void)
2087 /* Save the screen */
2097 /* Why are we here */
2099 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2101 prt("Options", 2, 0);
2105 /* Give some choices */
2107 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2108 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2109 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2110 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2111 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2112 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2113 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2114 /* Special choices */
2115 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2116 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2117 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2119 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2121 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2123 prt("(1) Input Options", 4, 5);
2124 prt("(2) Output Options", 5, 5);
2125 prt("(3) Game-Play Options", 6, 5);
2126 prt("(4) Disturbance Options", 7, 5);
2127 prt("(5) Efficiency Options", 8, 5);
2128 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2129 prt("(R) Play-record Options", 10, 5);
2131 /* Special choices */
2132 prt("(D) Base Delay Factor", 12, 5);
2133 prt("(H) Hitpoint Warning", 13, 5);
2134 prt("(A) Autosave Options", 14, 5);
2138 prt("(W) Window Flags", 15, 5);
2141 prt("(C) Cheating Options", 16, 5);
2147 prt("¥³¥Þ¥ó¥É:", 18, 0);
2149 prt("Command: ", 18, 0);
2157 if (k == ESCAPE) break;
2162 /* General Options */
2165 /* Process the general options */
2167 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2169 do_cmd_options_aux(1, "Input Options");
2175 /* General Options */
2178 /* Process the general options */
2180 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2182 do_cmd_options_aux(2, "Output Options");
2188 /* Inventory Options */
2193 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2195 do_cmd_options_aux(3, "Game-Play Options");
2201 /* Disturbance Options */
2206 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2208 do_cmd_options_aux(4, "Disturbance Options");
2214 /* Efficiency Options */
2219 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2221 do_cmd_options_aux(5, "Efficiency Options");
2227 /* Object auto-destruction Options */
2232 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2234 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2239 /* Play-record Options */
2245 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2247 do_cmd_options_aux(10, "Play-record Option");
2252 /* Cheating Options */
2257 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2259 do_cmd_options_cheat("Cheaters never win");
2269 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2271 do_cmd_options_autosave("Autosave");
2282 do_cmd_options_win();
2283 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2284 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2285 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2286 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2290 /* Hack -- Delay Speed */
2296 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2298 prt("Command: Base Delay Factor", 18, 0);
2302 /* Get a new value */
2305 int msec = delay_factor * delay_factor * delay_factor;
2307 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2309 prt(format("Current base delay factor: %d (%d msec)",
2312 delay_factor, msec), 22, 0);
2314 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2316 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2320 if (k == ESCAPE) break;
2321 if (isdigit(k)) delay_factor = D2I(k);
2328 /* Hack -- hitpoint warning factor */
2334 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2336 prt("Command: Hitpoint Warning", 18, 0);
2340 /* Get a new value */
2344 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2345 hitpoint_warn), 22, 0);
2347 prt(format("Current hitpoint warning: %d0%%",
2348 hitpoint_warn), 22, 0);
2352 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2354 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2358 if (k == ESCAPE) break;
2359 if (isdigit(k)) hitpoint_warn = D2I(k);
2366 /* Unknown option */
2375 /* Flush messages */
2380 /* Restore the screen */
2383 /* Hack - Redraw equippy chars */
2384 p_ptr->redraw |= (PR_EQUIPPY);
2390 * Ask for a "user pref line" and process it
2392 * XXX XXX XXX Allow absolute file names?
2394 void do_cmd_pref(void)
2401 /* Ask for a "user pref command" */
2403 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2405 if (!get_string("Pref: ", buf, 80)) return;
2409 /* Process that pref command */
2410 (void)process_pref_file_command(buf);
2413 void do_cmd_pickpref(void)
2420 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2422 if(!get_check("Reload auto-pick preference file? ")) return;
2424 /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
2425 for( i = 0; i < max_autopick; i++){
2426 string_free(autopick_name[i]);
2427 string_free(autopick_insc[i]);
2431 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2433 sprintf(buf, "picktype-%s.prf", player_name);
2435 sprintf(buf, "pickpref-%s.prf", player_name);
2437 if( process_pickpref_file(buf) == 0 ){
2440 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2442 msg_format("loaded '%s'.", buf);
2446 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2448 if( process_pickpref_file("picktype.prf") == 0 )
2450 if( process_pickpref_file("pickpref.prf") == 0 )
2455 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2457 msg_print("loaded 'pickpref.prf'.");
2462 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2464 if(err) msg_print("Failed to reload autopick preference.");
2471 * Hack -- append all current macros to the given file
2473 static errr macro_dump(cptr fname)
2475 static cptr mark = "Macro Dump";
2483 /* Build the filename */
2484 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2486 /* File type is "TEXT" */
2487 FILE_TYPE(FILE_TYPE_TEXT);
2489 /* Append to the file */
2490 fff = open_auto_dump(buf, mark, &line_num);
2491 if (!fff) return (-1);
2495 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2497 fprintf(fff, "\n# Automatic macro dump\n\n");
2502 for (i = 0; i < macro__num; i++)
2504 /* Extract the action */
2505 ascii_to_text(buf, macro__act[i]);
2507 /* Dump the macro */
2508 fprintf(fff, "A:%s\n", buf);
2510 /* Extract the action */
2511 ascii_to_text(buf, macro__pat[i]);
2513 /* Dump normal macros */
2514 fprintf(fff, "P:%s\n", buf);
2519 /* count number of lines */
2524 close_auto_dump(fff, mark, line_num);
2532 * Hack -- ask for a "trigger" (see below)
2534 * Note the complex use of the "inkey()" function from "util.c".
2536 * Note that both "flush()" calls are extremely important.
2538 static void do_cmd_macro_aux(char *buf)
2548 /* Do not process macros */
2554 /* Read the pattern */
2560 /* Do not process macros */
2563 /* Do not wait for keys */
2566 /* Attempt to read a key */
2577 /* Convert the trigger */
2578 ascii_to_text(tmp, buf);
2580 /* Hack -- display the trigger */
2581 Term_addstr(-1, TERM_WHITE, tmp);
2588 * Hack -- ask for a keymap "trigger" (see below)
2590 * Note that both "flush()" calls are extremely important. This may
2591 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2593 static void do_cmd_macro_aux_keymap(char *buf)
2607 /* Convert to ascii */
2608 ascii_to_text(tmp, buf);
2610 /* Hack -- display the trigger */
2611 Term_addstr(-1, TERM_WHITE, tmp);
2620 * Hack -- append all keymaps to the given file
2622 static errr keymap_dump(cptr fname)
2624 static cptr mark = "Keymap Dump";
2636 if (rogue_like_commands)
2638 mode = KEYMAP_MODE_ROGUE;
2644 mode = KEYMAP_MODE_ORIG;
2648 /* Build the filename */
2649 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2651 /* File type is "TEXT" */
2652 FILE_TYPE(FILE_TYPE_TEXT);
2654 /* Append to the file */
2655 fff = open_auto_dump(buf, mark, &line_num);
2656 if (!fff) return -1;
2660 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2662 fprintf(fff, "\n# Automatic keymap dump\n\n");
2667 for (i = 0; i < 256; i++)
2671 /* Loop up the keymap */
2672 act = keymap_act[mode][i];
2674 /* Skip empty keymaps */
2677 /* Encode the key */
2680 ascii_to_text(key, buf);
2682 /* Encode the action */
2683 ascii_to_text(buf, act);
2685 /* Dump the macro */
2686 fprintf(fff, "A:%s\n", buf);
2687 fprintf(fff, "C:%d:%s\n", mode, key);
2692 close_auto_dump(fff, mark, line_num);
2701 * Interact with "macros"
2703 * Note that the macro "action" must be defined before the trigger.
2705 * Could use some helpful instructions on this page. XXX XXX XXX
2707 void do_cmd_macros(void)
2719 if (rogue_like_commands)
2721 mode = KEYMAP_MODE_ROGUE;
2727 mode = KEYMAP_MODE_ORIG;
2730 /* File type is "TEXT" */
2731 FILE_TYPE(FILE_TYPE_TEXT);
2738 /* Process requests until done */
2746 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2748 prt("Interact with Macros", 2, 0);
2753 /* Describe that action */
2755 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2757 prt("Current action (if any) shown below:", 20, 0);
2761 /* Analyze the current action */
2762 ascii_to_text(buf, macro__buf);
2764 /* Display the current action */
2770 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2772 prt("(1) Load a user pref file", 4, 5);
2777 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2778 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2779 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2780 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2781 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2782 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2783 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2784 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2785 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2787 prt("(2) Append macros to a file", 5, 5);
2788 prt("(3) Query a macro", 6, 5);
2789 prt("(4) Create a macro", 7, 5);
2790 prt("(5) Remove a macro", 8, 5);
2791 prt("(6) Append keymaps to a file", 9, 5);
2792 prt("(7) Query a keymap", 10, 5);
2793 prt("(8) Create a keymap", 11, 5);
2794 prt("(9) Remove a keymap", 12, 5);
2795 prt("(0) Enter a new action", 13, 5);
2798 #endif /* ALLOW_MACROS */
2802 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2804 prt("Command: ", 16, 0);
2812 if (i == ESCAPE) break;
2814 /* Load a 'macro' file */
2821 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2823 prt("Command: Load a user pref file", 16, 0);
2829 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2831 prt("File: ", 18, 0);
2835 /* Default filename */
2836 sprintf(tmp, "%s.prf", player_name);
2838 /* Ask for a file */
2839 if (!askfor_aux(tmp, 80)) continue;
2841 /* Process the given filename */
2842 err = process_pref_file(tmp);
2846 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2848 msg_format("Loaded default '%s'.", tmp);
2855 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2857 msg_format("Failed to load '%s'!");
2863 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2865 msg_format("Loaded '%s'.", tmp);
2877 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2879 prt("Command: Append macros to a file", 16, 0);
2885 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2887 prt("File: ", 18, 0);
2891 /* Default filename */
2892 sprintf(tmp, "%s.prf", player_name);
2894 /* Ask for a file */
2895 if (!askfor_aux(tmp, 80)) continue;
2897 /* Dump the macros */
2898 (void)macro_dump(tmp);
2902 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2904 msg_print("Appended macros.");
2916 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2918 prt("Command: Query a macro", 16, 0);
2924 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2926 prt("Trigger: ", 18, 0);
2930 /* Get a macro trigger */
2931 do_cmd_macro_aux(buf);
2933 /* Acquire action */
2934 k = macro_find_exact(buf);
2941 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2943 msg_print("Found no macro.");
2951 /* Obtain the action */
2952 strcpy(macro__buf, macro__act[k]);
2954 /* Analyze the current action */
2955 ascii_to_text(buf, macro__buf);
2957 /* Display the current action */
2962 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2964 msg_print("Found a macro.");
2970 /* Create a macro */
2975 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2977 prt("Command: Create a macro", 16, 0);
2983 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2985 prt("Trigger: ", 18, 0);
2989 /* Get a macro trigger */
2990 do_cmd_macro_aux(buf);
2997 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
2999 prt("Action: ", 20, 0);
3003 /* Convert to text */
3004 ascii_to_text(tmp, macro__buf);
3006 /* Get an encoded action */
3007 if (askfor_aux(tmp, 80))
3009 /* Convert to ascii */
3010 text_to_ascii(macro__buf, tmp);
3012 /* Link the macro */
3013 macro_add(buf, macro__buf);
3017 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3019 msg_print("Added a macro.");
3025 /* Remove a macro */
3030 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3032 prt("Command: Remove a macro", 16, 0);
3038 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3040 prt("Trigger: ", 18, 0);
3044 /* Get a macro trigger */
3045 do_cmd_macro_aux(buf);
3047 /* Link the macro */
3048 macro_add(buf, buf);
3052 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3054 msg_print("Removed a macro.");
3064 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3066 prt("Command: Append keymaps to a file", 16, 0);
3072 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3074 prt("File: ", 18, 0);
3078 /* Default filename */
3079 sprintf(tmp, "%s.prf", player_name);
3081 /* Ask for a file */
3082 if (!askfor_aux(tmp, 80)) continue;
3084 /* Dump the macros */
3085 (void)keymap_dump(tmp);
3089 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3091 msg_print("Appended keymaps.");
3096 /* Query a keymap */
3103 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3105 prt("Command: Query a keymap", 16, 0);
3111 prt("²¡¤¹¥¡¼: ", 18, 0);
3113 prt("Keypress: ", 18, 0);
3117 /* Get a keymap trigger */
3118 do_cmd_macro_aux_keymap(buf);
3120 /* Look up the keymap */
3121 act = keymap_act[mode][(byte)(buf[0])];
3128 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3130 msg_print("Found no keymap.");
3138 /* Obtain the action */
3139 strcpy(macro__buf, act);
3141 /* Analyze the current action */
3142 ascii_to_text(buf, macro__buf);
3144 /* Display the current action */
3149 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3151 msg_print("Found a keymap.");
3157 /* Create a keymap */
3162 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3164 prt("Command: Create a keymap", 16, 0);
3170 prt("²¡¤¹¥¡¼: ", 18, 0);
3172 prt("Keypress: ", 18, 0);
3176 /* Get a keymap trigger */
3177 do_cmd_macro_aux_keymap(buf);
3184 prt("¹ÔÆ°: ", 20, 0);
3186 prt("Action: ", 20, 0);
3190 /* Convert to text */
3191 ascii_to_text(tmp, macro__buf);
3193 /* Get an encoded action */
3194 if (askfor_aux(tmp, 80))
3196 /* Convert to ascii */
3197 text_to_ascii(macro__buf, tmp);
3199 /* Free old keymap */
3200 string_free(keymap_act[mode][(byte)(buf[0])]);
3202 /* Make new keymap */
3203 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3207 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3209 msg_print("Added a keymap.");
3215 /* Remove a keymap */
3220 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3222 prt("Command: Remove a keymap", 16, 0);
3228 prt("²¡¤¹¥¡¼: ", 18, 0);
3230 prt("Keypress: ", 18, 0);
3234 /* Get a keymap trigger */
3235 do_cmd_macro_aux_keymap(buf);
3237 /* Free old keymap */
3238 string_free(keymap_act[mode][(byte)(buf[0])]);
3240 /* Make new keymap */
3241 keymap_act[mode][(byte)(buf[0])] = NULL;
3245 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3247 msg_print("Removed a keymap.");
3252 /* Enter a new action */
3257 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3259 prt("Command: Enter a new action", 16, 0);
3263 /* Go to the correct location */
3266 /* Hack -- limit the value */
3269 /* Get an encoded action */
3270 if (!askfor_aux(buf, 80)) continue;
3272 /* Extract an action */
3273 text_to_ascii(macro__buf, buf);
3276 #endif /* ALLOW_MACROS */
3285 /* Flush messages */
3295 * Interact with "visuals"
3297 void do_cmd_visuals(void)
3308 /* File type is "TEXT" */
3309 FILE_TYPE(FILE_TYPE_TEXT);
3312 /* Save the screen */
3316 /* Interact until done */
3322 /* Ask for a choice */
3324 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3326 prt("Interact with Visuals", 2, 0);
3330 /* Give some choices */
3332 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3334 prt("(1) Load a user pref file", 4, 5);
3337 #ifdef ALLOW_VISUALS
3339 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3340 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3341 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3342 prt("(5) (̤»ÈÍÑ)", 8, 5);
3343 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3344 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3345 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3346 prt("(9) (̤»ÈÍÑ)", 12, 5);
3348 prt("(2) Dump monster attr/chars", 5, 5);
3349 prt("(3) Dump object attr/chars", 6, 5);
3350 prt("(4) Dump feature attr/chars", 7, 5);
3351 prt("(5) (unused)", 8, 5);
3352 prt("(6) Change monster attr/chars", 9, 5);
3353 prt("(7) Change object attr/chars", 10, 5);
3354 prt("(8) Change feature attr/chars", 11, 5);
3355 prt("(9) (unused)", 12, 5);
3360 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3362 prt("(0) Reset visuals", 13, 5);
3368 prt("¥³¥Þ¥ó¥É:", 18, 0);
3370 prt("Command: ", 15, 0);
3378 if (i == ESCAPE) break;
3380 /* Load a 'pref' file */
3385 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3387 prt("Command: Load a user pref file", 15, 0);
3393 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3395 prt("File: ", 17, 0);
3399 /* Default filename */
3400 sprintf(tmp, "%s.prf", player_name);
3403 if (!askfor_aux(tmp, 70)) continue;
3405 /* Process the given filename */
3406 (void)process_pref_file(tmp);
3409 #ifdef ALLOW_VISUALS
3411 /* Dump monster attr/chars */
3414 static cptr mark = "Monster attr/chars";
3419 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3421 prt("Command: Dump monster attr/chars", 15, 0);
3427 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3429 prt("File: ", 17, 0);
3433 /* Default filename */
3434 sprintf(tmp, "%s.prf", player_name);
3436 /* Get a filename */
3437 if (!askfor_aux(tmp, 70)) continue;
3439 /* Build the filename */
3440 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3442 /* Append to the file */
3443 fff = open_auto_dump(buf, mark, &line_num);
3448 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3450 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3455 for (i = 0; i < max_r_idx; i++)
3457 monster_race *r_ptr = &r_info[i];
3459 /* Skip non-entries */
3460 if (!r_ptr->name) continue;
3462 /* Dump a comment */
3463 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3466 /* Dump the monster attr/char info */
3467 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3468 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3473 close_auto_dump(fff, mark, line_num);
3477 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3479 msg_print("Dumped monster attr/chars.");
3484 /* Dump object attr/chars */
3487 static cptr mark = "Object attr/chars";
3492 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3494 prt("Command: Dump object attr/chars", 15, 0);
3500 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3502 prt("File: ", 17, 0);
3506 /* Default filename */
3507 sprintf(tmp, "%s.prf", player_name);
3509 /* Get a filename */
3510 if (!askfor_aux(tmp, 70)) continue;
3512 /* Build the filename */
3513 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3515 /* Append to the file */
3516 fff = open_auto_dump(buf, mark, &line_num);
3521 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3523 fprintf(fff, "\n# Object attr/char definitions\n\n");
3528 for (i = 0; i < max_k_idx; i++)
3530 object_kind *k_ptr = &k_info[i];
3532 /* Skip non-entries */
3533 if (!k_ptr->name) continue;
3535 /* Dump a comment */
3536 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3539 /* Dump the object attr/char info */
3540 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3541 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3546 close_auto_dump(fff, mark, line_num);
3550 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3552 msg_print("Dumped object attr/chars.");
3557 /* Dump feature attr/chars */
3560 static cptr mark = "Feature attr/chars";
3565 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3567 prt("Command: Dump feature attr/chars", 15, 0);
3573 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3575 prt("File: ", 17, 0);
3579 /* Default filename */
3580 sprintf(tmp, "%s.prf", player_name);
3582 /* Get a filename */
3583 if (!askfor_aux(tmp, 70)) continue;
3585 /* Build the filename */
3586 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3588 /* Append to the file */
3589 fff = open_auto_dump(buf, mark, &line_num);
3594 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3596 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3601 for (i = 0; i < max_f_idx; i++)
3603 feature_type *f_ptr = &f_info[i];
3605 /* Skip non-entries */
3606 if (!f_ptr->name) continue;
3608 /* Dump a comment */
3609 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3612 /* Dump the feature attr/char info */
3613 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3614 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3619 close_auto_dump(fff, mark, line_num);
3623 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3625 msg_print("Dumped feature attr/chars.");
3630 /* Modify monster attr/chars */
3637 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3639 prt("Command: Change monster attr/chars", 15, 0);
3643 /* Hack -- query until done */
3646 monster_race *r_ptr = &r_info[r];
3648 byte da = (r_ptr->d_attr);
3649 byte dc = (r_ptr->d_char);
3650 byte ca = (r_ptr->x_attr);
3651 byte cc = (r_ptr->x_char);
3653 /* Label the object */
3655 Term_putstr(5, 17, -1, TERM_WHITE,
3656 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3657 r, (r_name + r_ptr->name)));
3659 Term_putstr(5, 17, -1, TERM_WHITE,
3660 format("Monster = %d, Name = %-40.40s",
3661 r, (r_name + r_ptr->name)));
3665 /* Label the Default values */
3667 Term_putstr(10, 19, -1, TERM_WHITE,
3668 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3670 Term_putstr(10, 19, -1, TERM_WHITE,
3671 format("Default attr/char = %3u / %3u", da, dc));
3674 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3675 Term_putch(43, 19, da, dc);
3677 /* Label the Current values */
3679 Term_putstr(10, 20, -1, TERM_WHITE,
3680 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3682 Term_putstr(10, 20, -1, TERM_WHITE,
3683 format("Current attr/char = %3u / %3u", ca, cc));
3686 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3687 Term_putch(43, 20, ca, cc);
3691 Term_putstr(0, 22, -1, TERM_WHITE,
3692 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3694 Term_putstr(0, 22, -1, TERM_WHITE,
3695 "Command (n/N/a/A/c/C): ");
3703 if (i == ESCAPE) break;
3706 if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx;
3707 if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx;
3708 if (i == 'a') r_ptr->x_attr = (byte)(ca + 1);
3709 if (i == 'A') r_ptr->x_attr = (byte)(ca - 1);
3710 if (i == 'c') r_ptr->x_char = (byte)(cc + 1);
3711 if (i == 'C') r_ptr->x_char = (byte)(cc - 1);
3715 /* Modify object attr/chars */
3722 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3724 prt("Command: Change object attr/chars", 15, 0);
3728 /* Hack -- query until done */
3731 object_kind *k_ptr = &k_info[k];
3733 byte da = (byte)k_ptr->d_attr;
3734 byte dc = (byte)k_ptr->d_char;
3735 byte ca = (byte)k_ptr->x_attr;
3736 byte cc = (byte)k_ptr->x_char;
3738 /* Label the object */
3740 Term_putstr(5, 17, -1, TERM_WHITE,
3741 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3742 k, (k_name + k_ptr->name)));
3744 Term_putstr(5, 17, -1, TERM_WHITE,
3745 format("Object = %d, Name = %-40.40s",
3746 k, (k_name + k_ptr->name)));
3750 /* Label the Default values */
3752 Term_putstr(10, 19, -1, TERM_WHITE,
3753 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3755 Term_putstr(10, 19, -1, TERM_WHITE,
3756 format("Default attr/char = %3d / %3d", da, dc));
3759 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3760 Term_putch(43, 19, da, dc);
3762 /* Label the Current values */
3764 Term_putstr(10, 20, -1, TERM_WHITE,
3765 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3767 Term_putstr(10, 20, -1, TERM_WHITE,
3768 format("Current attr/char = %3d / %3d", ca, cc));
3771 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3772 Term_putch(43, 20, ca, cc);
3776 Term_putstr(0, 22, -1, TERM_WHITE,
3777 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3779 Term_putstr(0, 22, -1, TERM_WHITE,
3780 "Command (n/N/a/A/c/C): ");
3788 if (i == ESCAPE) break;
3791 if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx;
3792 if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx;
3793 if (i == 'a') k_info[k].x_attr = (byte)(ca + 1);
3794 if (i == 'A') k_info[k].x_attr = (byte)(ca - 1);
3795 if (i == 'c') k_info[k].x_char = (byte)(cc + 1);
3796 if (i == 'C') k_info[k].x_char = (byte)(cc - 1);
3800 /* Modify feature attr/chars */
3807 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3809 prt("Command: Change feature attr/chars", 15, 0);
3813 /* Hack -- query until done */
3816 feature_type *f_ptr = &f_info[f];
3818 byte da = (byte)f_ptr->d_attr;
3819 byte dc = (byte)f_ptr->d_char;
3820 byte ca = (byte)f_ptr->x_attr;
3821 byte cc = (byte)f_ptr->x_char;
3823 /* Label the object */
3825 Term_putstr(5, 17, -1, TERM_WHITE,
3826 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3827 f, (f_name + f_ptr->name)));
3829 Term_putstr(5, 17, -1, TERM_WHITE,
3830 format("Terrain = %d, Name = %-40.40s",
3831 f, (f_name + f_ptr->name)));
3835 /* Label the Default values */
3837 Term_putstr(10, 19, -1, TERM_WHITE,
3838 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3840 Term_putstr(10, 19, -1, TERM_WHITE,
3841 format("Default attr/char = %3d / %3d", da, dc));
3844 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3845 Term_putch(43, 19, da, dc);
3847 /* Label the Current values */
3849 Term_putstr(10, 20, -1, TERM_WHITE,
3850 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3852 Term_putstr(10, 20, -1, TERM_WHITE,
3853 format("Current attr/char = %3d / %3d", ca, cc));
3856 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3857 Term_putch(43, 20, ca, cc);
3861 Term_putstr(0, 22, -1, TERM_WHITE,
3862 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3864 Term_putstr(0, 22, -1, TERM_WHITE,
3865 "Command (n/N/a/A/c/C): ");
3873 if (i == ESCAPE) break;
3876 if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx;
3877 if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx;
3878 if (i == 'a') f_info[f].x_attr = (byte)(ca + 1);
3879 if (i == 'A') f_info[f].x_attr = (byte)(ca - 1);
3880 if (i == 'c') f_info[f].x_char = (byte)(cc + 1);
3881 if (i == 'C') f_info[f].x_char = (byte)(cc - 1);
3895 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
3897 msg_print("Visual attr/char tables reset.");
3902 /* Unknown option */
3908 /* Flush messages */
3913 /* Restore the screen */
3919 * Interact with "colors"
3921 void do_cmd_colors(void)
3932 /* File type is "TEXT" */
3933 FILE_TYPE(FILE_TYPE_TEXT);
3936 /* Save the screen */
3940 /* Interact until done */
3946 /* Ask for a choice */
3948 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
3950 prt("Interact with Colors", 2, 0);
3954 /* Give some choices */
3956 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3958 prt("(1) Load a user pref file", 4, 5);
3963 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3964 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
3966 prt("(2) Dump colors", 5, 5);
3967 prt("(3) Modify colors", 6, 5);
3974 prt("¥³¥Þ¥ó¥É: ", 8, 0);
3976 prt("Command: ", 8, 0);
3984 if (i == ESCAPE) break;
3986 /* Load a 'pref' file */
3991 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
3993 prt("Command: Load a user pref file", 8, 0);
3999 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4001 prt("File: ", 10, 0);
4006 sprintf(tmp, "%s.prf", player_name);
4009 if (!askfor_aux(tmp, 70)) continue;
4011 /* Process the given filename */
4012 (void)process_pref_file(tmp);
4014 /* Mega-Hack -- react to changes */
4015 Term_xtra(TERM_XTRA_REACT, 0);
4017 /* Mega-Hack -- redraw */
4026 static cptr mark = "Colors";
4031 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4033 prt("Command: Dump colors", 8, 0);
4039 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4041 prt("File: ", 10, 0);
4045 /* Default filename */
4046 sprintf(tmp, "%s.prf", player_name);
4048 /* Get a filename */
4049 if (!askfor_aux(tmp, 70)) continue;
4051 /* Build the filename */
4052 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
4054 /* Append to the file */
4055 fff = open_auto_dump(buf, mark, &line_num);
4060 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4062 fprintf(fff, "\n# Color redefinitions\n\n");
4067 for (i = 0; i < 256; i++)
4069 int kv = angband_color_table[i][0];
4070 int rv = angband_color_table[i][1];
4071 int gv = angband_color_table[i][2];
4072 int bv = angband_color_table[i][3];
4077 cptr name = "unknown";
4081 /* Skip non-entries */
4082 if (!kv && !rv && !gv && !bv) continue;
4084 /* Extract the color name */
4085 if (i < 16) name = color_names[i];
4087 /* Dump a comment */
4089 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4091 fprintf(fff, "# Color '%s'\n", name);
4095 /* Dump the monster attr/char info */
4096 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4102 close_auto_dump(fff, mark, line_num);
4106 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4108 msg_print("Dumped color redefinitions.");
4120 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4122 prt("Command: Modify colors", 8, 0);
4126 /* Hack -- query until done */
4135 /* Exhibit the normal colors */
4136 for (j = 0; j < 16; j++)
4138 /* Exhibit this color */
4139 Term_putstr(j*4, 20, -1, a, "###");
4141 /* Exhibit all colors */
4142 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4145 /* Describe the color */
4147 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4149 name = ((a < 16) ? color_names[a] : "undefined");
4153 /* Describe the color */
4155 Term_putstr(5, 10, -1, TERM_WHITE,
4156 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4158 Term_putstr(5, 10, -1, TERM_WHITE,
4159 format("Color = %d, Name = %s", a, name));
4163 /* Label the Current values */
4164 Term_putstr(5, 12, -1, TERM_WHITE,
4165 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4166 angband_color_table[a][0],
4167 angband_color_table[a][1],
4168 angband_color_table[a][2],
4169 angband_color_table[a][3]));
4173 Term_putstr(0, 14, -1, TERM_WHITE,
4174 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4176 Term_putstr(0, 14, -1, TERM_WHITE,
4177 "Command (n/N/k/K/r/R/g/G/b/B): ");
4185 if (i == ESCAPE) break;
4188 if (i == 'n') a = (byte)(a + 1);
4189 if (i == 'N') a = (byte)(a - 1);
4190 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4191 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4192 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4193 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4194 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4195 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4196 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4197 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4199 /* Hack -- react to changes */
4200 Term_xtra(TERM_XTRA_REACT, 0);
4202 /* Hack -- redraw */
4209 /* Unknown option */
4215 /* Flush messages */
4220 /* Restore the screen */
4226 * Note something in the message recall
4228 void do_cmd_note(void)
4237 if (!get_string("¥á¥â: ", buf, 60)) return;
4239 if (!get_string("Note: ", buf, 60)) return;
4243 /* Ignore empty notes */
4244 if (!buf[0] || (buf[0] == ' ')) return;
4246 /* Add the note to the message recall */
4248 msg_format("¥á¥â: %s", buf);
4250 msg_format("Note: %s", buf);
4257 * Mention the current version
4259 void do_cmd_version(void)
4263 #ifndef FAKE_VERSION
4264 msg_format("You are playing Angband %d.%d.%d.",
4265 VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
4268 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4269 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4271 msg_format("You are playing Hengband %d.%d.%d.",
4272 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4282 * Array of feeling strings
4284 static cptr do_cmd_feeling_text[11] =
4287 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4289 "Looks like any other level.",
4293 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4295 "You feel there is something special about this level.",
4299 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4301 "You nearly faint as horrible visions of death fill your mind!",
4305 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4307 "This level looks very dangerous.",
4311 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4313 "You have a very bad feeling...",
4317 "°¤¤Í½´¶¤¬¤¹¤ë...",
4319 "You have a bad feeling...",
4325 "You feel nervous.",
4329 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4331 "You feel your luck is turning...",
4335 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4337 "You don't like the look of this place.",
4341 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4343 "This level looks reasonably safe.",
4347 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4349 "What a boring place..."
4354 static cptr do_cmd_feeling_text_combat[11] =
4357 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4359 "Looks like any other level.",
4363 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4365 "You feel there is something special about this level.",
4369 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4371 "You nearly faint as horrible visions of death fill your mind!",
4375 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4377 "This level looks very dangerous.",
4381 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4383 "You have a very bad feeling...",
4387 "°¤¤Í½´¶¤¬¤¹¤ë...",
4389 "You have a bad feeling...",
4395 "You feel nervous.",
4399 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4401 "You feel your luck is turning...",
4405 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4407 "You don't like the look of this place.",
4411 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4413 "This level looks reasonably safe.",
4417 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4419 "What a boring place..."
4424 static cptr do_cmd_feeling_text_lucky[11] =
4427 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4428 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4429 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4430 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4431 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4432 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4433 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4434 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4435 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4436 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4437 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4439 "Looks like any other level.",
4440 "You feel there is something special about this level.",
4441 "You have a superb feeling about this level.",
4442 "You have an excellent feeling...",
4443 "You have a very good feeling...",
4444 "You have a good feeling...",
4445 "You feel strangely lucky...",
4446 "You feel your luck is turning...",
4447 "You like the look of this place...",
4448 "This level can't be all bad...",
4449 "What a boring place..."
4455 * Note that "feeling" is set to zero unless some time has passed.
4456 * Note that this is done when the level is GENERATED, not entered.
4458 void do_cmd_feeling(void)
4460 /* Verify the feeling */
4461 if (feeling > 10) feeling = 10;
4463 /* No useful feeling in quests */
4464 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4467 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4469 msg_print("Looks like a typical quest level.");
4475 /* No useful feeling in town */
4476 else if (p_ptr->town_num && !dun_level)
4479 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4481 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4485 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4487 msg_print("Looks like a strange wilderness.");
4495 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4497 msg_print("Looks like a typical town.");
4504 /* No useful feeling in the wilderness */
4505 else if (!dun_level)
4508 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4510 msg_print("Looks like a typical wilderness.");
4516 /* Display the feeling */
4517 if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
4519 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4521 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4522 msg_print(do_cmd_feeling_text_combat[feeling]);
4524 msg_print(do_cmd_feeling_text[feeling]);
4529 msg_print(do_cmd_feeling_text[0]);
4538 * Encode the screen colors
4540 static char hack[17] = "dwsorgbuDWvyRGBU";
4543 static errr photo_fgets(FILE *fff, char *buf, huge n)
4552 if (fgets(tmp, 1024, fff))
4554 /* Convert weirdness */
4555 for (s = tmp; *s; s++)
4557 /* Handle newline */
4568 else if (*s == '\t')
4570 /* Hack -- require room */
4571 if (i + 8 >= n) break;
4573 /* Append a space */
4576 /* Append some more spaces */
4577 while (!(i % 8)) buf[i++] = ' ';
4581 else if (iskanji(*s))
4588 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4589 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4596 /* Handle printables */
4617 * Hack -- load a screen dump from a file
4619 void do_cmd_load_screen(void)
4633 /* Hack -- drop permissions */
4636 /* Build the filename */
4637 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4639 /* Append to the file */
4640 fff = my_fopen(buf, "r");
4645 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4647 msg_format("Failed to open %s.", buf);
4654 /* Save the screen */
4657 /* Clear the screen */
4661 /* Load the screen */
4662 for (y = 0; okay && (y < 24); y++)
4664 /* Get a line of data */
4665 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4668 for (x = 0; x < 79; x++)
4670 /* Put the attr/char */
4671 Term_draw(x, y, TERM_WHITE, buf[x]);
4675 /* Get the blank line */
4676 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4679 /* Dump the screen */
4680 for (y = 0; okay && (y < 24); y++)
4682 /* Get a line of data */
4683 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4686 for (x = 0; x < 79; x++)
4688 /* Get the attr/char */
4689 (void)(Term_what(x, y, &a, &c));
4691 /* Look up the attr */
4692 for (i = 0; i < 16; i++)
4694 /* Use attr matches */
4695 if (hack[i] == buf[x]) a = i;
4698 /* Put the attr/char */
4699 Term_draw(x, y, a, c);
4704 /* Get the blank line */
4705 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4711 /* Hack -- grab permissions */
4717 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4719 msg_print("Screen dump loaded.");
4726 /* Restore the screen */
4733 cptr inven_res_label =
4735 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4737 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4740 /* XTRA HACK RESLIST */
4741 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4742 int *j, byte tval, char *where)
4744 char o_name[MAX_NLEN];
4747 if (!o_ptr->k_idx)return;
4748 if (o_ptr->tval != tval)return;
4751 * HACK:Ring of Lordly protection and Dragon shield/helm
4752 * have random resistances.
4754 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4755 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4756 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4757 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4758 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4759 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4760 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4763 object_desc(o_name, o_ptr, TRUE, 0);
4765 while ( o_name[i] && i < 26 ){
4767 if (iskanji(o_name[i])) i++;
4771 if(i<28) while(i<28){o_name[i]=' ';i++;}
4774 fprintf(fff,"%s %s", where, o_name);
4776 if (!(o_ptr->ident & (IDENT_MENTAL)))
4779 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4781 fprintf(fff, "-------unknown------------ -------unknown------\n");
4785 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4788 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4789 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4790 else fprintf(fff,"¡¦");
4792 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4793 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4794 else fprintf(fff,"¡¦");
4796 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4797 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4798 else fprintf(fff,"¡¦");
4800 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4801 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4802 else fprintf(fff,"¡¦");
4804 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4805 else fprintf(fff,"¡¦");
4807 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4808 else fprintf(fff,"¡¦");
4810 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4811 else fprintf(fff,"¡¦");
4813 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4814 else fprintf(fff,"¡¦");
4816 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4817 else fprintf(fff,"¡¦");
4819 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4820 else fprintf(fff,"¡¦");
4822 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4823 else fprintf(fff,"¡¦");
4825 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4826 else fprintf(fff,"¡¦");
4828 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4829 else fprintf(fff,"¡¦");
4833 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4834 else fprintf(fff,"¡¦");
4836 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4837 else fprintf(fff,"¡¦");
4839 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4840 else fprintf(fff,"¡¦");
4842 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4843 else fprintf(fff,"¡¦");
4845 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4846 else fprintf(fff,"¡¦");
4848 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4849 else fprintf(fff,"¡¦");
4851 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4852 else fprintf(fff,"¡¦");
4854 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4855 else fprintf(fff,"¡¦");
4858 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4859 else fprintf(fff,"¡¦");
4861 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4862 else fprintf(fff,"¡¦");
4864 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4865 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4866 else fprintf(fff,". ");
4868 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4869 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4870 else fprintf(fff,". ");
4872 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4873 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4874 else fprintf(fff,". ");
4876 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4877 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4878 else fprintf(fff,". ");
4880 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4881 else fprintf(fff,". ");
4883 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4884 else fprintf(fff,". ");
4886 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
4887 else fprintf(fff,". ");
4889 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
4890 else fprintf(fff,". ");
4892 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
4893 else fprintf(fff,". ");
4895 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
4896 else fprintf(fff,". ");
4898 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
4899 else fprintf(fff,". ");
4901 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
4902 else fprintf(fff,". ");
4904 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
4905 else fprintf(fff,". ");
4909 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
4910 else fprintf(fff,". ");
4912 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
4913 else fprintf(fff,". ");
4915 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
4916 else fprintf(fff,". ");
4918 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
4919 else fprintf(fff,". ");
4921 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
4922 else fprintf(fff,". ");
4924 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
4925 else fprintf(fff,". ");
4927 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
4928 else fprintf(fff,". ");
4930 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
4931 else fprintf(fff,". ");
4934 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
4935 else fprintf(fff,". ");
4937 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
4938 else fprintf(fff,". ");
4946 fprintf(fff,"%s\n", inven_res_label);
4952 * Display *ID* ed weapons/armors's resistances
4954 static void do_cmd_knowledge_inven(void)
4959 char file_name[1024];
4970 /* Open a new file */
4971 fff = my_fopen_temp(file_name, 1024);
4974 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
4976 msg_format("Failed to create temporally file %s.", file_name);
4981 fprintf(fff,"%s\n",inven_res_label);
4983 for (tval=TV_BOW; tval <= TV_RING; tval++){
4986 for (;j<9;j++) fprintf(fff, "\n");
4988 fprintf(fff,"%s\n",inven_res_label);
4992 strcpy(where, "Áõ");
4994 strcpy(where, "E ");
4996 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4998 o_ptr = &inventory[i];
4999 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5003 strcpy(where, "»ý");
5005 strcpy(where, "I ");
5007 for (i = 0; i < INVEN_PACK; i++)
5009 o_ptr = &inventory[i];
5010 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5014 /* Print all homes in the different towns */
5015 st_ptr = &town[1].store[STORE_HOME];
5017 strcpy(where, "²È");
5019 strcpy(where, "H ");/*nanka*/
5022 /* Dump all available items */
5023 for (i = 0; i < st_ptr->stock_num; i++)
5025 o_ptr = &st_ptr->stock[i];
5026 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5030 /* Close the file */
5033 /* Display the file contents */
5035 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5037 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5040 /* Remove the file */
5045 void do_cmd_save_screen_html_aux(char *filename, int message)
5049 byte a = 0, old_a = 0;
5063 char *html_head[] = {
5064 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5068 char *html_foot[] = {
5070 "</body>\n</html>\n",
5074 /* File type is "TEXT" */
5075 FILE_TYPE(FILE_TYPE_TEXT);
5077 /* Append to the file */
5078 fff = my_fopen(filename, "w");
5084 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5086 msg_format("Failed to open file %s.", filename);
5094 /* Save the screen */
5098 /* Build the filename */
5099 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
5100 tmpfff = my_fopen(buf, "r");
5102 for (i = 0; html_head[i]; i++)
5103 fprintf(fff, html_head[i]);
5107 while (!my_fgets(tmpfff, buf, 1024)) {
5109 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5113 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5115 fprintf(fff, "%s\n", buf);
5120 /* Dump the screen */
5121 for (y = 0; y < 24; y++)
5128 for (x = 0; x < 79; x++)
5132 /* Get the attr/char */
5133 (void)(Term_what(x, y, &a, &c));
5137 case '&': cc = "&"; break;
5138 case '<': cc = "<"; break;
5139 case '>': cc = ">"; break;
5141 case 0x1f: c = '.'; break;
5142 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5147 if ((y == 0 && x == 0) || a != old_a) {
5148 rv = angband_color_table[a][1];
5149 gv = angband_color_table[a][2];
5150 bv = angband_color_table[a][3];
5151 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5152 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5156 fprintf(fff, "%s", cc);
5158 fprintf(fff, "%c", c);
5161 fprintf(fff, "</font>");
5164 for (i = 0; html_foot[i]; i++)
5165 fprintf(fff, html_foot[i]);
5170 while (!my_fgets(tmpfff, buf, 1024)) {
5172 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5176 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5178 fprintf(fff, "%s\n", buf);
5193 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5195 msg_print("Screen dump saved.");
5200 /* Restore the screen */
5206 * Hack -- save a screen dump to a file
5208 void do_cmd_save_screen_html(void)
5210 char buf[1024], tmp[256] = "screen.html";
5213 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5215 if (!get_string("File name: ", tmp, 80))
5219 /* Build the filename */
5220 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5224 /* Hack -- drop permissions */
5227 do_cmd_save_screen_html_aux(buf, 1);
5229 /* Hack -- grab permissions */
5235 * Redefinable "save_screen" action
5237 void (*screendump_aux)(void) = NULL;
5241 * Hack -- save a screen dump to a file
5243 void do_cmd_save_screen(void)
5246 if (get_check("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©"))
5248 if (get_check("Save screen dump as HTML? "))
5251 do_cmd_save_screen_html();
5255 /* Do we use a special screendump function ? */
5258 /* Dump the screen to a graphics file */
5259 (*screendump_aux)();
5261 else /* Dump the screen as text */
5273 /* Hack -- drop permissions */
5276 /* Build the filename */
5277 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5279 /* File type is "TEXT" */
5280 FILE_TYPE(FILE_TYPE_TEXT);
5282 /* Append to the file */
5283 fff = my_fopen(buf, "w");
5288 /* Hack -- grab permissions */
5291 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5293 msg_format("Failed to open file %s.", buf);
5300 /* Save the screen */
5304 /* Dump the screen */
5305 for (y = 0; y < 24; y++)
5308 for (x = 0; x < 79; x++)
5310 /* Get the attr/char */
5311 (void)(Term_what(x, y, &a, &c));
5321 fprintf(fff, "%s\n", buf);
5328 /* Dump the screen */
5329 for (y = 0; y < 24; y++)
5332 for (x = 0; x < 79; x++)
5334 /* Get the attr/char */
5335 (void)(Term_what(x, y, &a, &c));
5338 buf[x] = hack[a&0x0F];
5345 fprintf(fff, "%s\n", buf);
5355 /* Hack -- grab permissions */
5360 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5362 msg_print("Screen dump saved.");
5368 /* Restore the screen */
5375 * Sorting hook -- Comp function -- see below
5377 * We use "u" to point to array of monster indexes,
5378 * and "v" to select the type of sorting to perform on "u".
5380 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5382 u16b *who = (u16b*)(u);
5384 u16b *why = (u16b*)(v);
5392 /* Sort by total kills */
5395 /* Extract total kills */
5396 z1 = a_info[w1].tval;
5397 z2 = a_info[w2].tval;
5399 /* Compare total kills */
5400 if (z1 < z2) return (TRUE);
5401 if (z1 > z2) return (FALSE);
5405 /* Sort by monster level */
5408 /* Extract levels */
5409 z1 = a_info[w1].sval;
5410 z2 = a_info[w2].sval;
5412 /* Compare levels */
5413 if (z1 < z2) return (TRUE);
5414 if (z1 > z2) return (FALSE);
5418 /* Sort by monster experience */
5421 /* Extract experience */
5422 z1 = a_info[w1].level;
5423 z2 = a_info[w2].level;
5425 /* Compare experience */
5426 if (z1 < z2) return (TRUE);
5427 if (z1 > z2) return (FALSE);
5431 /* Compare indexes */
5437 * Sorting hook -- Swap function -- see below
5439 * We use "u" to point to array of monster indexes,
5440 * and "v" to select the type of sorting to perform.
5442 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5444 u16b *who = (u16b*)(u);
5456 * Check the status of "artifacts"
5458 void do_cmd_knowledge_artifacts(void)
5460 int i, k, z, x, y, n = 0;
5466 char file_name[1024];
5468 char base_name[MAX_NLEN];
5472 /* Open a new file */
5473 fff = my_fopen_temp(file_name, 1024);
5477 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5479 msg_format("Failed to create temporary file %s.", file_name);
5485 /* Allocate the "who" array */
5486 C_MAKE(who, max_r_idx, s16b);
5488 /* Allocate the "okay" array */
5489 C_MAKE(okay, max_a_idx, bool);
5491 /* Scan the artifacts */
5492 for (k = 0; k < max_a_idx; k++)
5494 artifact_type *a_ptr = &a_info[k];
5499 /* Skip "empty" artifacts */
5500 if (!a_ptr->name) continue;
5502 /* Skip "uncreated" artifacts */
5503 if (!a_ptr->cur_num) continue;
5509 /* Check the dungeon */
5510 for (y = 0; y < cur_hgt; y++)
5512 for (x = 0; x < cur_wid; x++)
5514 cave_type *c_ptr = &cave[y][x];
5516 s16b this_o_idx, next_o_idx = 0;
5518 /* Scan all objects in the grid */
5519 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5523 /* Acquire object */
5524 o_ptr = &o_list[this_o_idx];
5526 /* Acquire next object */
5527 next_o_idx = o_ptr->next_o_idx;
5529 /* Ignore non-artifacts */
5530 if (!artifact_p(o_ptr)) continue;
5532 /* Ignore known items */
5533 if (object_known_p(o_ptr)) continue;
5535 /* Note the artifact */
5536 okay[o_ptr->name1] = FALSE;
5541 /* Check the inventory and equipment */
5542 for (i = 0; i < INVEN_TOTAL; i++)
5544 object_type *o_ptr = &inventory[i];
5546 /* Ignore non-objects */
5547 if (!o_ptr->k_idx) continue;
5549 /* Ignore non-artifacts */
5550 if (!artifact_p(o_ptr)) continue;
5552 /* Ignore known items */
5553 if (object_known_p(o_ptr)) continue;
5555 /* Note the artifact */
5556 okay[o_ptr->name1] = FALSE;
5559 for (k = 0; k < max_a_idx; k++)
5561 if (okay[k]) who[n++] = k;
5564 /* Select the sort method */
5565 ang_sort_comp = ang_sort_art_comp;
5566 ang_sort_swap = ang_sort_art_swap;
5568 /* Sort the array by dungeon depth of monsters */
5569 ang_sort(who, &why, n);
5571 /* Scan the artifacts */
5572 for (k = 0; k < n; k++)
5574 artifact_type *a_ptr = &a_info[who[k]];
5578 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5580 strcpy(base_name, "Unknown Artifact");
5584 /* Obtain the base object type */
5585 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5593 /* Get local object */
5596 /* Create fake object */
5597 object_prep(q_ptr, z);
5599 /* Make it an artifact */
5600 q_ptr->name1 = (byte)who[k];
5602 /* Describe the artifact */
5603 object_desc_store(base_name, q_ptr, FALSE, 0);
5606 /* Hack -- Build the artifact name */
5608 fprintf(fff, " %s\n", base_name);
5610 fprintf(fff, " The %s\n", base_name);
5615 /* Free the "who" array */
5616 C_KILL(who, max_r_idx, s16b);
5618 /* Free the "okay" array */
5619 C_KILL(okay, max_a_idx, bool);
5621 /* Close the file */
5624 /* Display the file contents */
5626 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5628 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5632 /* Remove the file */
5638 * Display known uniques
5640 static void do_cmd_knowledge_uniques(void)
5648 char file_name[1024];
5650 /* Open a new file */
5651 fff = my_fopen_temp(file_name, 1024);
5655 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5657 msg_format("Failed to create temporary file %s.", file_name);
5663 /* Allocate the "who" array */
5664 C_MAKE(who, max_r_idx, s16b);
5666 /* Scan the monsters */
5667 for (i = 1; i < max_r_idx; i++)
5669 monster_race *r_ptr = &r_info[i];
5671 /* Use that monster */
5672 if (r_ptr->name) who[n++] = i;
5675 /* Select the sort method */
5676 ang_sort_comp = ang_sort_comp_hook;
5677 ang_sort_swap = ang_sort_swap_hook;
5679 /* Sort the array by dungeon depth of monsters */
5680 ang_sort(who, &why, n);
5682 /* Scan the monster races */
5683 for (k = 0; k < n; k++)
5685 monster_race *r_ptr = &r_info[who[k]];
5687 /* Only print Uniques */
5688 if (r_ptr->flags1 & (RF1_UNIQUE))
5690 bool dead = (r_ptr->max_num == 0);
5694 /* Only display "known" uniques */
5695 if (dead || cheat_know || r_ptr->r_sights)
5697 /* Print a message */
5699 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5700 (r_name + r_ptr->name));
5702 fprintf(fff, " %s is alive\n",
5703 (r_name + r_ptr->name));
5710 /* Free the "who" array */
5711 C_KILL(who, max_r_idx, s16b);
5713 /* Close the file */
5716 /* Display the file contents */
5718 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5720 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5724 /* Remove the file */
5730 * Display dead uniques
5732 static void do_cmd_knowledge_uniques_dead(void)
5740 char file_name[1024];
5742 /* Open a new file */
5743 fff = my_fopen_temp(file_name, 1024);
5747 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5749 msg_format("Failed to create temporary file %s.", file_name);
5755 /* Allocate the "who" array */
5756 C_MAKE(who, max_r_idx, s16b);
5758 /* Scan the monsters */
5759 for (i = 1; i < max_r_idx; i++)
5761 monster_race *r_ptr = &r_info[i];
5763 /* Use that monster */
5764 if (r_ptr->name) who[n++] = i;
5767 /* Select the sort method */
5768 ang_sort_comp = ang_sort_comp_hook;
5769 ang_sort_swap = ang_sort_swap_hook;
5771 /* Sort the array by dungeon depth of monsters */
5772 ang_sort(who, &why, n);
5774 /* Scan the monster races */
5775 for (k = 0; k < n; k++)
5777 monster_race *r_ptr = &r_info[who[k]];
5779 /* Only print Uniques */
5780 if (r_ptr->flags1 & (RF1_UNIQUE))
5782 bool dead = (r_ptr->max_num == 0);
5784 if (!dead) continue;
5786 /* Only display "known" uniques */
5787 if (dead || cheat_know || r_ptr->r_sights)
5789 /* Print a message */
5791 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5792 (r_name + r_ptr->name));
5794 fprintf(fff, " %s is dead\n",
5795 (r_name + r_ptr->name));
5802 /* Free the "who" array */
5803 C_KILL(who, max_r_idx, s16b);
5805 /* Close the file */
5808 /* Display the file contents */
5810 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5812 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5816 /* Remove the file */
5822 * Display weapon-exp
5824 static void do_cmd_knowledge_weapon_exp(void)
5826 int i,j, num, shougou;
5830 char file_name[1024];
5833 /* Open a new file */
5834 fff = my_fopen_temp(file_name, 1024);
5837 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5839 msg_format("Failed to create temporary file %s.", file_name);
5845 for(i = 0; i < 5; i++)
5847 for (num = 0; num < 64; num++)
5849 for (j = 0; j < max_k_idx; j++)
5851 object_kind *k_ptr = &k_info[j];
5853 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
5855 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
5857 if(weapon_exp[4-i][num]<4000) shougou=0;
5858 else if(weapon_exp[4-i][num]<6000) shougou=1;
5859 else if(weapon_exp[4-i][num]<7000) shougou=2;
5860 else if(weapon_exp[4-i][num]<8000) shougou=3;
5863 fprintf(fff,"%-25s ",tmp);
5864 if (weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
5865 else fprintf(fff," ");
5866 fprintf(fff,"%s",shougou_moji[shougou]);
5867 if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
5875 /* Close the file */
5878 /* Display the file contents */
5880 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
5882 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
5886 /* Remove the file */
5894 static void do_cmd_knowledge_spell_exp(void)
5901 char file_name[1024];
5903 /* Open a new file */
5904 fff = my_fopen_temp(file_name, 1024);
5907 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5909 msg_format("Failed to create temporary file %s.", file_name);
5915 if(p_ptr->realm1 != REALM_NONE)
5918 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
5920 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
5922 for (i = 0; i < 32; i++)
5924 if (!is_magic(p_ptr->realm1))
5926 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC - 1][i];
5930 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5932 if(s_ptr->slevel == 99) continue;
5933 if(spell_exp[i]<900) shougou=0;
5934 else if(spell_exp[i]<1200) shougou=1;
5935 else if(spell_exp[i]<1400) shougou=2;
5936 else if(spell_exp[i]<1600) shougou=3;
5938 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
5939 if (p_ptr->realm1 == REALM_HISSATSU)
5940 fprintf(fff,"[--]");
5943 if (shougou == 4) fprintf(fff,"!");
5944 else fprintf(fff," ");
5945 fprintf(fff,"%s",shougou_moji[shougou]);
5947 if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
5952 if(p_ptr->realm2 != REALM_NONE)
5954 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
5955 for (i = 0; i < 32; i++)
5957 if (!is_magic(p_ptr->realm1))
5959 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC - 1][i];
5963 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5965 if(s_ptr->slevel == 99) continue;
5967 if(spell_exp[i+32]<900) shougou=0;
5968 else if(spell_exp[i+32]<1200) shougou=1;
5969 else if(spell_exp[i+32]<1400) shougou=2;
5971 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
5972 if (shougou == 3) fprintf(fff,"!");
5973 else fprintf(fff," ");
5974 fprintf(fff,"%s",shougou_moji[shougou]);
5975 if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
5980 /* Close the file */
5983 /* Display the file contents */
5985 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
5987 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
5991 /* Remove the file */
5999 static void do_cmd_knowledge_skill_exp(void)
6005 char file_name[1024];
6007 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6009 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6012 /* Open a new file */
6013 fff = my_fopen_temp(file_name, 1024);
6016 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6018 msg_format("Failed to create temporary file %s.", file_name);
6024 for (i = 0; i < 3; i++)
6026 if(i == GINOU_RIDING)
6028 if(skill_exp[i]<500) shougou=0;
6029 else if(skill_exp[i]<2000) shougou=1;
6030 else if(skill_exp[i]<5000) shougou=2;
6031 else if(skill_exp[i]<8000) shougou=3;
6036 if(skill_exp[i]<4000) shougou=0;
6037 else if(skill_exp[i]<6000) shougou=1;
6038 else if(skill_exp[i]<7000) shougou=2;
6039 else if(skill_exp[i]<8000) shougou=3;
6042 fprintf(fff,"%-20s ",skill_name[i]);
6043 if (skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6044 else fprintf(fff," ");
6045 fprintf(fff,"%s",shougou_moji[shougou]);
6046 if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
6050 /* Close the file */
6053 /* Display the file contents */
6055 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6057 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6061 /* Remove the file */
6067 * Pluralize a monster name
6069 void plural_aux(char *Name)
6071 int NameLen = strlen(Name);
6073 if (strstr(Name, "Disembodied hand"))
6075 strcpy(Name, "Disembodied hands that strangled people");
6077 else if (strstr(Name, "Colour out of space"))
6079 strcpy(Name, "Colours out of space");
6081 else if (strstr(Name, "stairway to hell"))
6083 strcpy(Name, "stairways to hell");
6085 else if (strstr(Name, "Dweller on the threshold"))
6087 strcpy(Name, "Dwellers on the threshold");
6089 else if (strstr(Name, " of "))
6091 cptr aider = strstr(Name, " of ");
6102 if (dummy[i-1] == 's')
6104 strcpy(&(dummy[i]), "es");
6109 strcpy(&(dummy[i]), "s");
6112 strcpy(&(dummy[i+1]), aider);
6113 strcpy(Name, dummy);
6115 else if (strstr(Name, "coins"))
6118 strcpy(dummy, "piles of ");
6119 strcat(dummy, Name);
6120 strcpy(Name, dummy);
6123 else if (strstr(Name, "Manes"))
6127 else if (streq(&(Name[NameLen - 2]), "ey"))
6129 strcpy(&(Name[NameLen - 2]), "eys");
6131 else if (Name[NameLen - 1] == 'y')
6133 strcpy(&(Name[NameLen - 1]), "ies");
6135 else if (streq(&(Name[NameLen - 4]), "ouse"))
6137 strcpy(&(Name[NameLen - 4]), "ice");
6139 else if (streq(&(Name[NameLen - 2]), "us"))
6141 strcpy(&(Name[NameLen - 2]), "i");
6143 else if (streq(&(Name[NameLen - 6]), "kelman"))
6145 strcpy(&(Name[NameLen - 6]), "kelmen");
6147 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6149 strcpy(&(Name[NameLen - 8]), "wordsmen");
6151 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6153 strcpy(&(Name[NameLen - 7]), "oodsmen");
6155 else if (streq(&(Name[NameLen - 7]), "eastman"))
6157 strcpy(&(Name[NameLen - 7]), "eastmen");
6159 else if (streq(&(Name[NameLen - 8]), "izardman"))
6161 strcpy(&(Name[NameLen - 8]), "izardmen");
6163 else if (streq(&(Name[NameLen - 5]), "geist"))
6165 strcpy(&(Name[NameLen - 5]), "geister");
6167 else if (streq(&(Name[NameLen - 2]), "ex"))
6169 strcpy(&(Name[NameLen - 2]), "ices");
6171 else if (streq(&(Name[NameLen - 2]), "lf"))
6173 strcpy(&(Name[NameLen - 2]), "lves");
6175 else if (suffix(Name, "ch") ||
6176 suffix(Name, "sh") ||
6177 suffix(Name, "nx") ||
6178 suffix(Name, "s") ||
6181 strcpy(&(Name[NameLen]), "es");
6185 strcpy(&(Name[NameLen]), "s");
6190 * Display current pets
6192 static void do_cmd_knowledge_pets(void)
6196 monster_type *m_ptr;
6198 int show_upkeep = 0;
6199 char file_name[1024];
6202 /* Open a new file */
6203 fff = my_fopen_temp(file_name, 1024);
6206 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6208 msg_format("Failed to create temporary file %s.", file_name);
6214 /* Process the monsters (backwards) */
6215 for (i = m_max - 1; i >= 1; i--)
6217 monster_race *r_ptr;
6218 /* Access the monster */
6221 /* Ignore "dead" monsters */
6222 if (!m_ptr->r_idx) continue;
6223 r_ptr = &r_info[m_ptr->r_idx];
6225 /* Calculate "upkeep" for pets */
6230 monster_desc(pet_name, m_ptr, 0x88);
6231 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6232 if (p_ptr->riding == i)
6234 fprintf(fff, " ¾èÇÏÃæ");
6236 fprintf(fff, " Riding");
6242 show_upkeep = calculate_upkeep();
6244 fprintf(fff, "----------------------------------------------\n");
6246 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6247 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6249 fprintf(fff, " Total: %d pet%s.\n",
6250 t_friends, (t_friends == 1 ? "" : "s"));
6251 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6256 /* Close the file */
6259 /* Display the file contents */
6261 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6263 show_file(TRUE, file_name, "Current Pets", 0, 0);
6267 /* Remove the file */
6275 * Note that the player ghosts are ignored. XXX XXX XXX
6277 static void do_cmd_knowledge_kill_count(void)
6285 char file_name[1024];
6290 /* Open a new file */
6291 fff = my_fopen_temp(file_name, 1024);
6295 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6297 msg_format("Failed to create temporary file %s.", file_name);
6303 /* Allocate the "who" array */
6304 C_MAKE(who, max_r_idx, s16b);
6307 /* Monsters slain */
6310 for (kk = 1; kk < max_r_idx; kk++)
6312 monster_race *r_ptr = &r_info[kk];
6314 if (r_ptr->flags1 & (RF1_UNIQUE))
6316 bool dead = (r_ptr->max_num == 0);
6325 s16b This = r_ptr->r_pkills;
6336 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6338 fprintf(fff,"You have defeated no enemies yet.\n\n");
6341 else if (Total == 1)
6343 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6345 fprintf(fff,"You have defeated one enemy.\n\n");
6350 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6352 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6359 /* Scan the monsters */
6360 for (i = 1; i < max_r_idx; i++)
6362 monster_race *r_ptr = &r_info[i];
6364 /* Use that monster */
6365 if (r_ptr->name) who[n++] = i;
6368 /* Select the sort method */
6369 ang_sort_comp = ang_sort_comp_hook;
6370 ang_sort_swap = ang_sort_swap_hook;
6372 /* Sort the array by dungeon depth of monsters */
6373 ang_sort(who, &why, n);
6375 /* Scan the monster races */
6376 for (k = 0; k < n; k++)
6378 monster_race *r_ptr = &r_info[who[k]];
6380 if (r_ptr->flags1 & (RF1_UNIQUE))
6382 bool dead = (r_ptr->max_num == 0);
6386 /* Print a message */
6387 fprintf(fff, " %s\n",
6388 (r_name + r_ptr->name));
6394 s16b This = r_ptr->r_pkills;
6399 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6400 if(strchr("pt",r_ptr->d_char))
6401 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6403 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6407 if (strstr(r_name + r_ptr->name, "coins"))
6409 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6413 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6419 strcpy(ToPlural, (r_name + r_ptr->name));
6420 plural_aux(ToPlural);
6421 fprintf(fff, " %d %s\n", This, ToPlural);
6431 fprintf(fff,"----------------------------------------------\n");
6433 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6435 fprintf(fff," Total: %lu creature%s killed.\n",
6436 Total, (Total == 1 ? "" : "s"));
6440 /* Free the "who" array */
6441 C_KILL(who, max_r_idx, s16b);
6443 /* Close the file */
6446 /* Display the file contents */
6448 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6450 show_file(TRUE, file_name, "Kill Count", 0, 0);
6454 /* Remove the file */
6460 * Display known objects
6462 static void do_cmd_knowledge_objects(void)
6468 char o_name[MAX_NLEN];
6470 char file_name[1024];
6473 /* Open a new file */
6474 fff = my_fopen_temp(file_name, 1024);
6477 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6479 msg_format("Failed to create temporary file %s.", file_name);
6485 /* Scan the object kinds */
6486 for (k = 1; k < max_k_idx; k++)
6488 object_kind *k_ptr = &k_info[k];
6490 /* Hack -- skip artifacts */
6491 if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
6493 /* List known flavored objects */
6494 if (k_ptr->flavor && k_ptr->aware)
6497 object_type object_type_body;
6499 /* Get local object */
6500 i_ptr = &object_type_body;
6502 /* Create fake object */
6503 object_prep(i_ptr, k);
6505 /* Describe the object */
6506 object_desc_store(o_name, i_ptr, FALSE, 0);
6508 /* Print a message */
6509 fprintf(fff, " %s\n", o_name);
6513 /* Close the file */
6516 /* Display the file contents */
6518 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6520 show_file(TRUE, file_name, "Known Objects", 0, 0);
6524 /* Remove the file */
6530 * List virtues & status
6533 void do_cmd_knowledge_kubi(void)
6538 char file_name[1024];
6541 /* Open a new file */
6542 fff = my_fopen_temp(file_name, 1024);
6545 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6547 msg_format("Failed to create temporary file %s.", file_name);
6556 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6558 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6560 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6562 fprintf(fff, "List of wanted monsters\n");
6564 for (i = 0; i < MAX_KUBI; i++)
6566 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6567 if (kubi_r_idx[i] > 10000)
6569 fprintf(fff, "ºÑ\n");
6571 fprintf(fff, "done\n");
6574 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6578 /* Close the file */
6581 /* Display the file contents */
6583 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6585 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6589 /* Remove the file */
6594 * List virtues & status
6597 void do_cmd_knowledge_virtues(void)
6601 char file_name[1024];
6604 /* Open a new file */
6605 fff = my_fopen_temp(file_name, 1024);
6608 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6610 msg_format("Failed to create temporary file %s.", file_name);
6619 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6621 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6626 /* Close the file */
6629 /* Display the file contents */
6631 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6633 show_file(TRUE, file_name, "Virtues", 0, 0);
6637 /* Remove the file */
6645 void do_cmd_knowledge_dungeon(void)
6649 char file_name[1024];
6653 /* Open a new file */
6654 fff = my_fopen_temp(file_name, 1024);
6657 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6659 msg_format("Failed to create temporary file %s.", file_name);
6667 for (i = 1; i < max_d_idx; i++)
6671 if (!d_info[i].maxdepth) continue;
6672 if (!max_dlv[i]) continue;
6673 if (d_info[i].final_guardian)
6675 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6677 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6679 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6681 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6686 /* Close the file */
6689 /* Display the file contents */
6691 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6693 show_file(TRUE, file_name, "Dungeon", 0, 0);
6697 /* Remove the file */
6702 * List virtues & status
6705 static void do_cmd_knowledge_stat(void)
6709 char file_name[1024];
6712 /* Open a new file */
6713 fff = my_fopen_temp(file_name, 1024);
6716 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6718 msg_format("Failed to create temporary file %s.", file_name);
6726 percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
6727 (2 * p_ptr->hitdie +
6728 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6731 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6732 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6733 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6735 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6736 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6737 fprintf(fff, "Limits of maximum stats\n\n");
6739 for (v_nr = 0; v_nr < 6; v_nr++)
6741 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);
6742 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6748 /* Close the file */
6751 /* Display the file contents */
6753 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6755 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6759 /* Remove the file */
6764 * Print quest status of all active quests
6766 static void do_cmd_knowledge_quests(void)
6769 char file_name[1024];
6771 char rand_tmp_str[120] = "\0";
6773 monster_race *r_ptr;
6775 int rand_level = 100;
6778 /* Open a new file */
6779 fff = my_fopen_temp(file_name, 1024);
6782 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6784 msg_format("Failed to create temporary file %s.", file_name);
6791 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6793 fprintf(fff, "< Current Quest >\n");
6796 for (i = 1; i < max_quests; i++)
6798 /* No info from "silent" quests */
6799 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6801 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6806 /* Clear the text */
6807 for (j = 0; j < 10; j++)
6809 quest_text[j][0] = '\0';
6812 quest_text_line = 0;
6816 /* Set the quest number temporary */
6817 old_quest = p_ptr->inside_quest;
6818 p_ptr->inside_quest = i;
6820 /* Get the quest text */
6821 init_flags = INIT_SHOW_TEXT;
6823 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6825 /* Reset the old quest number */
6826 p_ptr->inside_quest = old_quest;
6828 if (quest[i].type != QUEST_TYPE_RANDOM)
6830 char note[80] = "\0";
6832 if (quest[i].status == QUEST_STATUS_TAKEN)
6834 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6836 r_ptr = &r_info[quest[i].r_idx];
6837 strcpy(name, r_name + r_ptr->name);
6838 if (quest[i].max_num > 1)
6841 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6844 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
6849 sprintf(note," - %s¤òÅݤ¹¡£",name);
6851 sprintf(note," - kill %s.",name);
6854 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
6857 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
6859 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
6862 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
6864 strcpy(name, a_name + a_info[quest[i].k_idx].name);
6866 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
6868 sprintf(note," - Find out %s.", name);
6871 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
6873 sprintf(note," - õº÷¤¹¤ë¡£");
6875 sprintf(note," - Search.");
6877 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
6879 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
6881 sprintf(note," - Kill all monsters.");
6885 /* Print the quest info */
6887 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
6889 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
6892 quest[i].name, quest[i].level, note);
6894 fprintf(fff, tmp_str);
6896 if (quest[i].status == QUEST_STATUS_COMPLETED)
6899 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
6901 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
6905 fprintf(fff, tmp_str);
6911 while (quest_text[j][0] && j < 10)
6913 fprintf(fff, " %s\n", quest_text[j]);
6918 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
6919 (quest[i].level < rand_level))
6922 rand_level = quest[i].level;
6924 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6926 /* Print the quest info */
6927 r_ptr = &r_info[quest[i].r_idx];
6928 strcpy(name, r_name + r_ptr->name);
6930 if (quest[i].max_num > 1)
6933 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
6934 quest[i].name, quest[i].level,
6935 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6939 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6940 quest[i].name, quest[i].level,
6941 quest[i].max_num, name, quest[i].cur_num);
6948 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
6950 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
6953 quest[i].name, quest[i].level, name);
6960 /* Print the current random quest */
6961 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
6964 if (!total) fprintf(fff, "¤Ê¤·\n");
6966 if (!total) fprintf(fff, "Nothing.\n");
6970 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
6972 fprintf(fff, "\n< Completed Quest >\n");
6975 for (i = 1; i < max_quests; i++)
6977 /* No info from "silent" quests */
6978 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6980 if (quest[i].status == QUEST_STATUS_FINISHED)
6986 if (i < MIN_RANDOM_QUEST)
6988 /* Set the quest number temporary */
6989 old_quest = p_ptr->inside_quest;
6990 p_ptr->inside_quest = i;
6993 init_flags = INIT_ASSIGN;
6995 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6997 /* Reset the old quest number */
6998 p_ptr->inside_quest = old_quest;
7001 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7003 /* Print the quest info */
7005 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7007 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7010 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7014 /* Print the quest info */
7016 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7018 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7021 quest[i].name, quest[i].level, quest[i].complev);
7024 fprintf(fff, tmp_str);
7028 if (!total) fprintf(fff, "¤Ê¤·\n");
7030 if (!total) fprintf(fff, "Nothing.\n");
7034 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7036 fprintf(fff, "\n< Failed Quest >\n");
7039 for (i = 1; i < max_quests; i++)
7041 /* No info from "silent" quests */
7042 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7044 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7050 if (i < MIN_RANDOM_QUEST)
7052 /* Set the quest number temporary */
7053 old_quest = p_ptr->inside_quest;
7054 p_ptr->inside_quest = i;
7056 /* Get the quest text */
7057 init_flags = INIT_ASSIGN;
7059 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7061 /* Reset the old quest number */
7062 p_ptr->inside_quest = old_quest;
7065 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7067 /* Print the quest info */
7069 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7071 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7074 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7078 /* Print the quest info */
7080 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7082 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7085 quest[i].name, quest[i].level, quest[i].complev);
7087 fprintf(fff, tmp_str);
7091 if (!total) fprintf(fff, "¤Ê¤·\n");
7093 if (!total) fprintf(fff, "Nothing.\n");
7098 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7100 fprintf(fff, "\n< Remaining Random Quest >\n");
7103 for (i = 1; i < max_quests; i++)
7105 /* No info from "silent" quests */
7106 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7108 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7112 /* Print the quest info */
7114 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7116 sprintf(tmp_str, "%s (%d, %s)\n",
7119 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7120 fprintf(fff, tmp_str);
7124 if (!total) fprintf(fff, "¤Ê¤·\n");
7126 if (!total) fprintf(fff, "Nothing.\n");
7130 /* Close the file */
7133 /* Display the file contents */
7135 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7137 show_file(TRUE, file_name, "Quest status", 0, 0);
7141 /* Remove the file */
7151 void do_cmd_knowledge_home(void)
7156 char file_name[1024];
7158 char o_name[MAX_NLEN];
7161 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7163 /* Open a new file */
7164 fff = my_fopen_temp(file_name, 1024);
7167 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7169 msg_format("Failed to create temporary file %s.", file_name);
7177 /* Print all homes in the different towns */
7178 st_ptr = &town[1].store[STORE_HOME];
7180 /* Home -- if anything there */
7181 if (st_ptr->stock_num)
7183 /* Header with name of the town */
7185 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7187 fprintf(fff, " [Home Inventory]\n");
7191 /* Dump all available items */
7192 for (i = 0; i < st_ptr->stock_num; i++)
7195 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7196 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7197 if (strlen(o_name) <= 80-3)
7199 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7205 for (n = 0, t = o_name; n < 80-3; n++, t++)
7206 if(iskanji(*t)) {t++; n++;}
7207 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7209 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7210 fprintf(fff, " %.77s\n", o_name+n);
7213 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7214 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7219 /* Add an empty line */
7220 fprintf(fff, "\n\n");
7224 /* Close the file */
7227 /* Display the file contents */
7229 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7231 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7235 /* Remove the file */
7241 * Check the status of "autopick"
7243 static void do_cmd_knowledge_autopick(void)
7247 char file_name[1024];
7249 /* Open a new file */
7250 fff = my_fopen_temp(file_name, 1024);
7255 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7257 msg_format("Failed to create temporary file %s.", file_name);
7266 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7268 fprintf(fff, "No preference for auto picker/destroyer.");
7274 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7276 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7280 for (k = 0; k < max_autopick; k++)
7283 byte act = autopick_action[k];
7284 if (act & DONT_AUTOPICK)
7292 else if (act & DO_AUTODESTROY)
7309 if (act & DO_DISPLAY)
7310 fprintf(fff, "%11s", format("[%s]", tmp));
7312 fprintf(fff, "%11s", format("(%s)", tmp));
7314 fprintf(fff, " %s", autopick_name[k]);
7315 if(autopick_insc[k] != NULL)
7316 fprintf(fff, " {%s}", autopick_insc[k]);
7319 /* Close the file */
7321 /* Display the file contents */
7323 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7325 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7328 /* Remove the file */
7335 * Interact with "knowledge"
7337 void do_cmd_knowledge(void)
7340 /* File type is "TEXT" */
7341 FILE_TYPE(FILE_TYPE_TEXT);
7342 /* Save the screen */
7344 /* Interact until done */
7349 /* Ask for a choice */
7351 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7352 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7354 prt(format("page %d/2", (p+1)), 2, 65);
7355 prt("Display current knowledge", 3, 0);
7358 /* Give some choices */
7361 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7362 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7363 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7364 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7365 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7366 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7367 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7368 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7369 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7371 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7372 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7373 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7374 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7375 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7376 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7377 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7378 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7379 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7383 prt("(1) Display known artifacts", 6, 5);
7384 prt("(2) Display known objects", 7, 5);
7385 prt("(3) Display remaining uniques", 8, 5);
7386 prt("(4) Display dead uniques", 9, 5);
7387 prt("(5) Display kill count", 10, 5);
7388 prt("(6) Display wanted monsters", 11, 5);
7389 prt("(7) Display current pets", 12, 5);
7390 prt("(8) Display home inventory", 13, 5);
7391 prt("(9) Display *identified* equip.", 14, 5);
7393 prt("(a) Display about yourself", 6, 5);
7394 prt("(b) Display mutations", 7, 5);
7395 prt("(c) Display weapon proficiency", 8, 5);
7396 prt("(d) Display spell proficiency", 9, 5);
7397 prt("(e) Display misc. proficiency", 10, 5);
7398 prt("(f) Display virtues", 11, 5);
7399 prt("(g) Display dungeons", 12, 5);
7400 prt("(h) Display current quests", 13, 5);
7401 prt("(i) Display auto pick/destroy", 14, 5);
7406 prt("-³¤¯-", 16, 8);
7407 prt("ESC) È´¤±¤ë", 21, 1);
7408 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7409 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7410 prt("¥³¥Þ¥ó¥É:", 20, 0);
7412 prt("-more-", 16, 8);
7413 prt("ESC) Exit menu", 21, 1);
7414 prt("SPACE) Next page", 21, 30);
7415 /*prt("-) Previous page", 21, 60);*/
7416 prt("Command: ", 20, 0);
7422 if (i == ESCAPE) break;
7425 case ' ': /* Page change */
7429 case '1': /* Artifacts */
7430 do_cmd_knowledge_artifacts();
7432 case '2': /* Objects */
7433 do_cmd_knowledge_objects();
7435 case '3': /* Uniques */
7436 do_cmd_knowledge_uniques();
7438 case '4': /* Uniques */
7439 do_cmd_knowledge_uniques_dead();
7441 case '5': /* Kill count */
7442 do_cmd_knowledge_kill_count();
7444 case '6': /* wanted */
7445 do_cmd_knowledge_kubi();
7447 case '7': /* Pets */
7448 do_cmd_knowledge_pets();
7450 case '8': /* Home */
7451 do_cmd_knowledge_home();
7453 case '9': /* Resist list */
7454 do_cmd_knowledge_inven();
7457 case 'a': /* Max stat */
7458 do_cmd_knowledge_stat();
7460 case 'b': /* Mutations */
7461 do_cmd_knowledge_mutations();
7463 case 'c': /* weapon-exp */
7464 do_cmd_knowledge_weapon_exp();
7466 case 'd': /* spell-exp */
7467 do_cmd_knowledge_spell_exp();
7469 case 'e': /* skill-exp */
7470 do_cmd_knowledge_skill_exp();
7472 case 'f': /* Virtues */
7473 do_cmd_knowledge_virtues();
7475 case 'g': /* Dungeon */
7476 do_cmd_knowledge_dungeon();
7478 case 'h': /* Quests */
7479 do_cmd_knowledge_quests();
7481 case 'i': /* Autopick */
7482 do_cmd_knowledge_autopick();
7484 default: /* Unknown option */
7487 /* Flush messages */
7490 /* Restore the screen */
7496 * Check on the status of an active quest
7498 void do_cmd_checkquest(void)
7500 /* File type is "TEXT" */
7501 FILE_TYPE(FILE_TYPE_TEXT);
7503 /* Save the screen */
7507 do_cmd_knowledge_quests();
7509 /* Restore the screen */
7515 * Display the time and date
7517 void do_cmd_time(void)
7519 int day, hour, min, full, start, end, num;
7526 s32b len = 20L * TOWN_DAWN;
7527 s32b tick = turn % len + len / 4;
7529 if ((p_ptr->prace == RACE_VAMPIRE) ||
7530 (p_ptr->prace == RACE_SKELETON) ||
7531 (p_ptr->prace == RACE_ZOMBIE) ||
7532 (p_ptr->prace == RACE_SPECTRE))
7533 day = (turn - (15L * TOWN_DAWN))/ len + 1;
7535 day = (turn + (5L * TOWN_DAWN))/ len + 1;
7536 hour = (24 * tick / len) % 24;
7537 min = (1440 * tick / len) % 60;
7538 full = hour * 100 + min;
7546 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7548 strcpy(desc, "It is a strange time.");
7554 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7556 msg_format("This is day %d. The time is %d:%02d %s.",
7559 day, (hour % 12 == 0) ? 12 : (hour % 12),
7560 min, (hour < 12) ? "AM" : "PM");
7563 if (!randint0(10) || p_ptr->image)
7566 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7568 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7575 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7577 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7582 /* Open this file */
7583 fff = my_fopen(buf, "rt");
7588 /* Find this time */
7589 while (!my_fgets(fff, buf, 1024))
7591 /* Ignore comments */
7592 if (!buf[0] || (buf[0] == '#')) continue;
7594 /* Ignore invalid lines */
7595 if (buf[1] != ':') continue;
7597 /* Process 'Start' */
7600 /* Extract the starting time */
7601 start = atoi(buf + 2);
7603 /* Assume valid for an hour */
7613 /* Extract the ending time */
7614 end = atoi(buf + 2);
7620 /* Ignore incorrect range */
7621 if ((start > full) || (full > end)) continue;
7623 /* Process 'Description' */
7628 /* Apply the randomizer */
7629 if (!randint0(num)) strcpy(desc, buf + 2);
7639 /* Close the file */