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 static bool disable_nikki = FALSE;
229 extract_day_hour_min(&day, &hour, &min);
231 if (disable_nikki) return(-1);
233 if (type == NIKKI_FIX_QUEST_C ||
234 type == NIKKI_FIX_QUEST_F ||
235 type == NIKKI_RAND_QUEST_C ||
236 type == NIKKI_RAND_QUEST_F ||
237 type == NIKKI_TO_QUEST)
241 old_quest = p_ptr->inside_quest;
242 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
244 /* Get the quest text */
245 init_flags = INIT_ASSIGN;
247 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
249 /* Reset the old quest number */
250 p_ptr->inside_quest = old_quest;
254 sprintf(file_name,"playrecord-%s.txt",savefile_base);
256 /* different filne name to avoid mixing */
257 sprintf(file_name,"playrec-%s.txt",savefile_base);
260 /* Hack -- drop permissions */
263 /* Build the filename */
264 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
266 /* File type is "TEXT" */
267 FILE_TYPE(FILE_TYPE_TEXT);
269 fff = my_fopen(buf, "a");
274 /* Hack -- grab permissions */
277 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
279 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
288 if (p_ptr->inside_arena)
290 note_level = "¥¢¥ê¡¼¥Ê:";
292 note_level = "Arane:";
296 note_level = "ÃϾå:";
298 note_level = "Surface:";
300 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
302 note_level = "¥¯¥¨¥¹¥È:";
304 note_level = "Quest:";
308 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
310 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
319 fprintf(fff, "%dÆüÌÜ\n",day);
321 fprintf(fff, "Day %d\n",day);
330 fprintf(fff, "%s\n",note);
334 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
340 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
342 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
349 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
351 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
355 case NIKKI_FIX_QUEST_C:
357 if (quest[num].flags & QUEST_FLAG_SILENT) break;
359 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
361 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
365 case NIKKI_FIX_QUEST_F:
367 if (quest[num].flags & QUEST_FLAG_SILENT) break;
369 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
371 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
375 case NIKKI_RAND_QUEST_C:
378 strcpy(name, r_name+r_info[quest[num].r_idx].name);
380 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
382 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
386 case NIKKI_RAND_QUEST_F:
389 strcpy(name, r_name+r_info[quest[num].r_idx].name);
391 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
393 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
397 case NIKKI_MAXDEAPTH:
400 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
402 fprintf(fff, " %2d:%02d %20s reached level %d of %s for the first time.\n", hour, min, note_level, num, d_name+d_info[dungeon_type].name);
409 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
411 fprintf(fff, " %2d:%02d %20s reset recall level of %s to %d %s.\n", hour, min, note_level, d_name + d_info[num].name, max_dlv[num], note);
418 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
429 if (!(dun_level+num)) to = "ÃϾå";
430 else to = format("%d³¬", dun_level+num);
432 if (!(dun_level+num)) to = "the surfice";
433 else to = format("level %d", dun_level+num);
438 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
440 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
448 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
450 fprintf(fff, " %2d:%02d %20s recall to dungeon level %d of %s.\n", hour, min, note_level, max_dlv[dungeon_type], d_name+d_info[dungeon_type].name);
454 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
456 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
462 if (quest[num].flags & QUEST_FLAG_SILENT) break;
464 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
466 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
481 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
492 if (!(dun_level+num)) to = "ÃϾå";
493 else to = format("%d³¬", dun_level+num);
495 if (!(dun_level+num)) to = "surface";
496 else to = format("level %d", dun_level+num);
501 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
503 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
510 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
512 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
519 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
521 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
531 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, p_ptr->arena_number + 1, note);
533 int n = p_ptr->arena_number + 1;
534 fprintf(fff, " %2d:%02d %20s beaten by %s in the %d%s fight.\n", hour, min, note_level, note, n, (n%10==1?"st":n%10==2?"nd":n%10==3?"rd":"th"));
539 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
541 fprintf(fff, " %2d:%02d %20s win the %d%s fight (%s).\n", hour, min, note_level, num, (num%10==1?"st":num%10==2?"nd":num%10==3?"rd":"th"), note);
543 if (num == MAX_ARENA_MONS)
546 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
548 fprintf(fff, " win all fight to become a Chanpion.\n");
557 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
559 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
574 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
576 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
580 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
582 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
589 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
591 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
595 case NIKKI_GAMESTART:
597 time_t ct = time((time_t*)0);
601 fprintf(fff, "%s %s",note, ctime(&ct));
604 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
607 case NIKKI_NAMED_PET:
609 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
614 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
616 fprintf(fff, "decide to travel together with %s.\n", note);
621 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
623 fprintf(fff, "unname %s.\n", note);
628 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
630 fprintf(fff, "dismiss %s.\n", note);
635 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
637 fprintf(fff, "%s die.\n", note);
642 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
644 fprintf(fff, "move to other map leaving %s behind.\n", note);
649 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
651 fprintf(fff, "lose sight of %s.\n", note);
656 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
658 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
663 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
665 fprintf(fff, "%s is crushed by falling rocks.\n", note);
680 /* Hack -- grab permissions */
683 if (do_level) write_level = FALSE;
689 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
691 static void do_cmd_disp_nikki(void)
693 char nikki_title[256];
698 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
699 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
710 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
711 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
712 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
713 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
718 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
727 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
729 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
730 "Attack is the best form of defence.",
732 "An unexpected windfall",
733 "A drowning man will catch at a straw",
734 "Don't count your chickens before they are hatched.",
735 "It is no use crying over spilt milk.",
736 "Seeing is believing.",
737 "Strike the iron while it is hot.",
738 "I don't care what follows.",
739 "To dig a well to put out a house on fire.",
740 "Tomorrow is another day.",
741 "Easy come, easy go.",
742 "The more haste, the less speed.",
743 "Where there is life, there is hope.",
744 "There is no royal road to *WINNER*.",
745 "Danger past, God forgotten.",
746 "The best thing to do now is to run away.",
747 "Life is but an empty dream.",
748 "Dead men tell no tales.",
749 "A book that remains shut is but a block.",
750 "Misfortunes never come singly.",
751 "A little knowledge is a dangerous thing.",
752 "History repeats itself.",
753 "*WINNER* was not built in a day.",
754 "Ignorance is bliss.",
755 "To lose is to win?",
756 "No medicine can cure folly.",
757 "All good things come to an end.",
758 "M$ Empire strikes back.",
759 "To see is to believe",
761 "Quest of The World's Greatest Brain"};
764 sprintf(file_name,"playrecord-%s.txt",savefile_base);
766 sprintf(file_name,"playrec-%s.txt",savefile_base);
769 /* Hack -- drop permissions */
772 /* Build the filename */
773 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
775 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
776 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
777 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
778 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
779 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
782 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
783 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
785 sprintf(nikki_title, "Legend of %s %s '%s'",
786 ap_ptr->title, player_name, tmp);
789 /* Display the file contents */
790 show_file(FALSE, buf, nikki_title, -1, 0);
792 /* Hack -- grab permissions */
796 static void do_cmd_bunshou(void)
799 char bunshou[80] = "\0";
802 if (get_string("ÆâÍÆ: ", tmp, 79))
804 if (get_string("diary note: ", tmp, 79))
807 strcpy(bunshou, tmp);
809 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
813 static void do_cmd_last_get(void)
818 if (record_o_name[0] == '\0') return;
821 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
823 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
825 if (!get_check(buf)) return;
830 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
832 sprintf(buf,"descover %s.", record_o_name);
834 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
838 static void do_cmd_erase_nikki(void)
845 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
847 if (!get_check("Do you really want to delete all your record? ")) return;
851 sprintf(file_name,"playrecord-%s.txt",savefile_base);
853 sprintf(file_name,"playrec-%s.txt",savefile_base);
856 /* Hack -- drop permissions */
859 /* Build the filename */
860 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
862 /* Remove the file */
865 fff = my_fopen(buf, "w");
869 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
871 msg_format("deleted record.");
875 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
877 msg_format("failed to delete %s.", buf);
882 /* Hack -- grab permissions */
889 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
895 void do_cmd_nikki(void)
899 /* File type is "TEXT" */
900 FILE_TYPE(FILE_TYPE_TEXT);
902 /* Save the screen */
905 /* Interact until done */
911 /* Ask for a choice */
913 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
915 prt("[ Play Record ]", 2, 0);
919 /* Give some choices */
921 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
922 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
923 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
924 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
926 prt("(1) Display your record", 4, 5);
927 prt("(2) Add record", 5, 5);
928 prt("(3) Record item you last get/identify", 6, 5);
929 prt("(4) Delete your record", 7, 5);
935 prt("¥³¥Þ¥ó¥É:", 18, 0);
937 prt("Command: ", 18, 0);
945 if (i == ESCAPE) break;
959 do_cmd_erase_nikki();
966 default: /* Unknown option */
974 /* Restore the screen */
979 * Hack -- redraw the screen
981 * This command performs various low level updates, clears all the "extra"
982 * windows, does a total redraw of the main window, and requests all of the
983 * interesting updates and redraws that I can think of.
985 * This command is also used to "instantiate" the results of the user
986 * selecting various things, such as graphics mode, so it must call
987 * the "TERM_XTRA_REACT" hook before redrawing the windows.
989 void do_cmd_redraw(void)
996 /* Hack -- react to changes */
997 Term_xtra(TERM_XTRA_REACT, 0);
1000 /* Combine and Reorder the pack (later) */
1001 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1005 p_ptr->update |= (PU_TORCH);
1008 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1010 /* Forget lite/view */
1011 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1013 /* Update lite/view */
1014 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1016 /* Update monsters */
1017 p_ptr->update |= (PU_MONSTERS);
1019 /* Redraw everything */
1020 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1023 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1026 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1030 /* Hack -- update */
1033 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1036 /* Redraw every window */
1037 for (j = 0; j < 8; j++)
1040 if (!angband_term[j]) continue;
1043 Term_activate(angband_term[j]);
1058 * Hack -- change name
1060 void do_cmd_change_name(void)
1069 /* Save the screen */
1077 /* Display the player */
1078 display_player(mode);
1083 display_player(mode);
1088 Term_putstr(2, 23, -1, TERM_WHITE,
1089 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1091 Term_putstr(2, 23, -1, TERM_WHITE,
1092 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1100 if (c == ESCAPE) break;
1111 sprintf(tmp, "%s.txt", player_base);
1113 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1115 if (get_string("File name: ", tmp, 80))
1119 if (tmp[0] && (tmp[0] != ' '))
1121 file_character(tmp, TRUE);
1138 /* Flush messages */
1142 /* Restore the screen */
1145 /* Redraw everything */
1146 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1153 * Recall the most recent message
1155 void do_cmd_message_one(void)
1157 /* Recall one message XXX XXX XXX */
1158 prt(format("> %s", message_str(0)), 0, 0);
1163 * Show previous messages to the user -BEN-
1165 * The screen format uses line 0 and 23 for headers and prompts,
1166 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1168 * This command shows you which commands you are viewing, and allows
1169 * you to "search" for strings in the recall.
1171 * Note that messages may be longer than 80 characters, but they are
1172 * displayed using "infinite" length, with a special sub-command to
1173 * "slide" the virtual display to the left or right.
1175 * Attempt to only hilite the matching portions of the string.
1177 void do_cmd_messages(int num_now)
1188 Term_get_size(&wid, &hgt);
1197 /* Total messages */
1200 /* Start on first message */
1203 /* Start at leftmost edge */
1206 /* Save the screen */
1209 /* Process requests until done */
1215 /* Dump up to 20 lines of messages */
1216 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1218 cptr msg = message_str(i+j);
1220 /* Apply horizontal scroll */
1221 msg = (strlen(msg) >= q) ? (msg + q) : "";
1223 /* Dump the messages, bottom to top */
1224 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1226 /* Hilite "shower" */
1231 /* Display matches */
1232 while ((str = strstr(str, shower)) != NULL)
1234 int len = strlen(shower);
1236 /* Display the match */
1237 Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
1245 /* Display header XXX XXX XXX */
1248 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1249 i, i+j-1, n, q), 0, 0);
1251 prt(format("Message Recall (%d-%d of %d), Offset %d",
1252 i, i+j-1, n, q), 0, 0);
1256 /* Display prompt (not very informative) */
1258 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1260 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1267 /* Exit on Escape */
1268 if (k == ESCAPE) break;
1270 /* Hack -- Save the old index */
1273 /* Horizontal scroll */
1277 q = (q >= 40) ? (q - 40) : 0;
1283 /* Horizontal scroll */
1293 /* Hack -- handle show */
1298 prt("¶¯Ä´: ", hgt - 1, 0);
1300 prt("Show: ", hgt - 1, 0);
1304 /* Get a "shower" string, or continue */
1305 if (!askfor_aux(shower, 80)) continue;
1311 /* Hack -- handle find */
1318 prt("¸¡º÷: ", hgt - 1, 0);
1320 prt("Find: ", hgt - 1, 0);
1324 /* Get a "finder" string, or continue */
1325 if (!askfor_aux(finder, 80)) continue;
1328 strcpy(shower, finder);
1331 for (z = i + 1; z < n; z++)
1333 cptr msg = message_str(z);
1336 if (strstr(msg, finder))
1347 /* Recall 1 older message */
1348 if ((k == '8') || (k == '\n') || (k == '\r'))
1350 /* Go newer if legal */
1351 if (i + 1 < n) i += 1;
1354 /* Recall 10 older messages */
1357 /* Go older if legal */
1358 if (i + 10 < n) i += 10;
1361 /* Recall 20 older messages */
1362 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1364 /* Go older if legal */
1365 if (i + 20 < n) i += 20;
1368 /* Recall 20 newer messages */
1369 if ((k == 'n') || (k == KTRL('N')))
1371 /* Go newer (if able) */
1372 i = (i >= 20) ? (i - 20) : 0;
1375 /* Recall 10 newer messages */
1378 /* Go newer (if able) */
1379 i = (i >= 20) ? (i - 20) : 0;
1382 /* Recall 1 newer messages */
1385 /* Go newer (if able) */
1386 i = (i >= 1) ? (i - 1) : 0;
1389 /* Hack -- Error of some kind */
1393 /* Restore the screen */
1400 * Number of cheating options
1407 static option_type cheat_info[CHEAT_MAX] =
1409 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1411 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1413 "cheat_peek", "Peek into object creation" },
1417 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1419 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1421 "cheat_hear", "Peek into monster creation" },
1425 { &cheat_room, FALSE, 255, 0x04, 0x00,
1427 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1429 "cheat_room", "Peek into dungeon creation" },
1433 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1435 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1437 "cheat_xtra", "Peek into something else" },
1441 { &cheat_know, FALSE, 255, 0x10, 0x00,
1443 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1445 "cheat_know", "Know complete monster info" },
1449 { &cheat_live, FALSE, 255, 0x20, 0x00,
1451 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1453 "cheat_live", "Allow player to avoid death" }
1459 * Interact with some options for cheating
1461 static void do_cmd_options_cheat(cptr info)
1465 int i, k = 0, n = CHEAT_MAX;
1473 /* Interact with the player */
1476 /* Prompt XXX XXX XXX */
1478 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1480 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1486 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1487 prt(" << Ãí°Õ >>", 11, 0);
1488 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1489 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1490 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1492 /* Display the options */
1493 for (i = 0; i < n; i++)
1495 byte a = TERM_WHITE;
1497 /* Color current option */
1498 if (i == k) a = TERM_L_BLUE;
1500 /* Display the option text */
1501 sprintf(buf, "%-48s: %s (%s)",
1502 cheat_info[i].o_desc,
1504 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1506 (*cheat_info[i].o_var ? "yes" : "no "),
1509 cheat_info[i].o_text);
1510 c_prt(a, buf, i + 2, 0);
1513 /* Hilite current option */
1514 move_cursor(k + 2, 50);
1530 k = (n + k - 1) % n;
1549 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1551 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1553 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1554 (*cheat_info[k].o_var) = TRUE;
1563 (*cheat_info[k].o_var) = FALSE;
1578 static option_type autosave_info[2] =
1580 { &autosave_l, FALSE, 255, 0x01, 0x00,
1582 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1584 "autosave_l", "Autosave when entering new levels" },
1588 { &autosave_t, FALSE, 255, 0x02, 0x00,
1590 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1592 "autosave_t", "Timed autosave" },
1598 static s16b toggle_frequency(s16b current)
1600 if (current == 0) return 50;
1601 if (current == 50) return 100;
1602 if (current == 100) return 250;
1603 if (current == 250) return 500;
1604 if (current == 500) return 1000;
1605 if (current == 1000) return 2500;
1606 if (current == 2500) return 5000;
1607 if (current == 5000) return 10000;
1608 if (current == 10000) return 25000;
1615 * Interact with some options for cheating
1617 static void do_cmd_options_autosave(cptr info)
1621 int i, k = 0, n = 2;
1629 /* Interact with the player */
1632 /* Prompt XXX XXX XXX */
1634 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1636 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1641 /* Display the options */
1642 for (i = 0; i < n; i++)
1644 byte a = TERM_WHITE;
1646 /* Color current option */
1647 if (i == k) a = TERM_L_BLUE;
1649 /* Display the option text */
1650 sprintf(buf, "%-48s: %s (%s)",
1651 autosave_info[i].o_desc,
1653 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1655 (*autosave_info[i].o_var ? "yes" : "no "),
1658 autosave_info[i].o_text);
1659 c_prt(a, buf, i + 2, 0);
1663 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1665 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1670 /* Hilite current option */
1671 move_cursor(k + 2, 50);
1687 k = (n + k - 1) % n;
1705 (*autosave_info[k].o_var) = TRUE;
1714 (*autosave_info[k].o_var) = FALSE;
1722 autosave_freq = toggle_frequency(autosave_freq);
1724 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1726 prt(format("Timed autosave frequency: every %d turns",
1729 autosave_freq), 5, 0);
1742 #define PAGE_AUTODESTROY 7
1745 * Interact with some options
1747 void do_cmd_options_aux(int page, cptr info)
1750 int i, k = 0, n = 0, l;
1755 /* Lookup the options */
1756 for (i = 0; i < 24; i++) opt[i] = 0;
1758 /* Scan the options */
1759 for (i = 0; option_info[i].o_desc; i++)
1761 /* Notice options on this "page" */
1762 if (option_info[i].o_page == page) opt[n++] = i;
1770 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
1772 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
1775 /* Interact with the player */
1778 /* Prompt XXX XXX XXX */
1780 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1782 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1787 /* Display the options */
1788 for (i = 0; i < n; i++)
1790 byte a = TERM_WHITE;
1792 /* Color current option */
1793 if (i == k) a = TERM_L_BLUE;
1795 /* Display the option text */
1796 sprintf(buf, "%-48s: %s (%.19s)",
1797 option_info[opt[i]].o_desc,
1799 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1801 (*option_info[opt[i]].o_var ? "yes" : "no "),
1804 option_info[opt[i]].o_text);
1805 if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
1806 else c_prt(a, buf, i + 2, 0);
1809 if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
1811 /* Hilite current option */
1812 move_cursor(k + 2 + l, 50);
1830 k = (n + k - 1) % n;
1851 (*option_info[opt[k]].o_var) = TRUE;
1862 (*option_info[opt[k]].o_var) = FALSE;
1870 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1885 * Modify the "window" options
1887 static void do_cmd_options_win(void)
1901 /* Memorize old flags */
1902 for (j = 0; j < 8; j++)
1904 /* Acquire current flags */
1905 old_flag[j] = window_flag[j];
1915 /* Prompt XXX XXX XXX */
1917 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1919 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1923 /* Display the windows */
1924 for (j = 0; j < 8; j++)
1926 byte a = TERM_WHITE;
1928 cptr s = angband_term_name[j];
1931 if (j == x) a = TERM_L_BLUE;
1933 /* Window name, staggered, centered */
1934 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1937 /* Display the options */
1938 for (i = 0; i < 16; i++)
1940 byte a = TERM_WHITE;
1942 cptr str = window_flag_desc[i];
1945 if (i == y) a = TERM_L_BLUE;
1949 if (!str) str = "(̤»ÈÍÑ)";
1951 if (!str) str = "(Unused option)";
1956 Term_putstr(0, i + 5, -1, a, str);
1958 /* Display the windows */
1959 for (j = 0; j < 8; j++)
1961 byte a = TERM_WHITE;
1966 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1969 if (window_flag[j] & (1L << i)) c = 'X';
1972 Term_putch(35 + j * 5, i + 5, a, c);
1977 Term_gotoxy(35 + x * 5, y + 5);
1995 for (j = 0; j < 8; j++)
1997 window_flag[j] &= ~(1L << y);
2001 for (i = 0; i < 16; i++)
2003 window_flag[x] &= ~(1L << i);
2016 window_flag[x] |= (1L << y);
2024 window_flag[x] &= ~(1L << y);
2030 d = get_keymap_dir(ch);
2032 x = (x + ddx[d] + 8) % 8;
2033 y = (y + ddy[d] + 16) % 16;
2040 /* Notice changes */
2041 for (j = 0; j < 8; j++)
2046 if (!angband_term[j]) continue;
2048 /* Ignore non-changes */
2049 if (window_flag[j] == old_flag[j]) continue;
2052 Term_activate(angband_term[j]);
2069 * Set or unset various options.
2071 * The user must use the "Ctrl-R" command to "adapt" to changes
2072 * in any options which control "visual" aspects of the game.
2074 void do_cmd_options(void)
2079 /* Save the screen */
2089 /* Why are we here */
2091 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2093 prt("Options", 2, 0);
2097 /* Give some choices */
2099 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2100 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2101 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2102 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2103 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2104 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2105 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2106 /* Special choices */
2107 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2108 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2109 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2111 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2113 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2115 prt("(1) Input Options", 4, 5);
2116 prt("(2) Output Options", 5, 5);
2117 prt("(3) Game-Play Options", 6, 5);
2118 prt("(4) Disturbance Options", 7, 5);
2119 prt("(5) Efficiency Options", 8, 5);
2120 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2121 prt("(R) Play-record Options", 10, 5);
2123 /* Special choices */
2124 prt("(D) Base Delay Factor", 12, 5);
2125 prt("(H) Hitpoint Warning", 13, 5);
2126 prt("(A) Autosave Options", 14, 5);
2130 prt("(W) Window Flags", 15, 5);
2133 prt("(C) Cheating Options", 16, 5);
2139 prt("¥³¥Þ¥ó¥É:", 18, 0);
2141 prt("Command: ", 18, 0);
2149 if (k == ESCAPE) break;
2154 /* General Options */
2157 /* Process the general options */
2159 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2161 do_cmd_options_aux(1, "Input Options");
2167 /* General Options */
2170 /* Process the general options */
2172 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2174 do_cmd_options_aux(2, "Output Options");
2180 /* Inventory Options */
2185 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2187 do_cmd_options_aux(3, "Game-Play Options");
2193 /* Disturbance Options */
2198 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2200 do_cmd_options_aux(4, "Disturbance Options");
2206 /* Efficiency Options */
2211 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2213 do_cmd_options_aux(5, "Efficiency Options");
2219 /* Object auto-destruction Options */
2224 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2226 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2231 /* Play-record Options */
2237 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2239 do_cmd_options_aux(10, "Play-record Option");
2244 /* Cheating Options */
2249 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2251 do_cmd_options_cheat("Cheaters never win");
2261 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2263 do_cmd_options_autosave("Autosave");
2274 do_cmd_options_win();
2275 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2276 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2277 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2278 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2282 /* Hack -- Delay Speed */
2288 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2290 prt("Command: Base Delay Factor", 18, 0);
2294 /* Get a new value */
2297 int msec = delay_factor * delay_factor * delay_factor;
2299 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2301 prt(format("Current base delay factor: %d (%d msec)",
2304 delay_factor, msec), 22, 0);
2306 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2308 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2312 if (k == ESCAPE) break;
2313 if (isdigit(k)) delay_factor = D2I(k);
2320 /* Hack -- hitpoint warning factor */
2326 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2328 prt("Command: Hitpoint Warning", 18, 0);
2332 /* Get a new value */
2336 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2337 hitpoint_warn), 22, 0);
2339 prt(format("Current hitpoint warning: %d0%%",
2340 hitpoint_warn), 22, 0);
2344 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2346 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2350 if (k == ESCAPE) break;
2351 if (isdigit(k)) hitpoint_warn = D2I(k);
2358 /* Unknown option */
2367 /* Flush messages */
2372 /* Restore the screen */
2375 /* Hack - Redraw equippy chars */
2376 p_ptr->redraw |= (PR_EQUIPPY);
2382 * Ask for a "user pref line" and process it
2384 * XXX XXX XXX Allow absolute file names?
2386 void do_cmd_pref(void)
2393 /* Ask for a "user pref command" */
2395 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2397 if (!get_string("Pref: ", buf, 80)) return;
2401 /* Process that pref command */
2402 (void)process_pref_file_command(buf);
2405 void do_cmd_pickpref(void)
2411 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2413 if(!get_check("Reload auto-pick preference file? ")) return;
2416 /* Free old entries */
2419 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2421 sprintf(buf, "picktype-%s.prf", player_name);
2423 sprintf(buf, "pickpref-%s.prf", player_name);
2425 err = process_pickpref_file(buf);
2430 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2432 msg_format("loaded '%s'.", buf);
2436 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2438 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2442 err = process_pickpref_file("picktype.prf");
2444 err = process_pickpref_file("pickpref.prf");
2450 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2452 msg_print("loaded 'pickpref.prf'.");
2459 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2461 if(err) msg_print("Failed to reload autopick preference.");
2468 * Hack -- append all current macros to the given file
2470 static errr macro_dump(cptr fname)
2472 static cptr mark = "Macro Dump";
2480 /* Build the filename */
2481 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2483 /* File type is "TEXT" */
2484 FILE_TYPE(FILE_TYPE_TEXT);
2486 /* Append to the file */
2487 fff = open_auto_dump(buf, mark, &line_num);
2488 if (!fff) return (-1);
2492 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2494 fprintf(fff, "\n# Automatic macro dump\n\n");
2499 for (i = 0; i < macro__num; i++)
2501 /* Extract the action */
2502 ascii_to_text(buf, macro__act[i]);
2504 /* Dump the macro */
2505 fprintf(fff, "A:%s\n", buf);
2507 /* Extract the action */
2508 ascii_to_text(buf, macro__pat[i]);
2510 /* Dump normal macros */
2511 fprintf(fff, "P:%s\n", buf);
2516 /* count number of lines */
2521 close_auto_dump(fff, mark, line_num);
2529 * Hack -- ask for a "trigger" (see below)
2531 * Note the complex use of the "inkey()" function from "util.c".
2533 * Note that both "flush()" calls are extremely important.
2535 static void do_cmd_macro_aux(char *buf)
2545 /* Do not process macros */
2551 /* Read the pattern */
2557 /* Do not process macros */
2560 /* Do not wait for keys */
2563 /* Attempt to read a key */
2574 /* Convert the trigger */
2575 ascii_to_text(tmp, buf);
2577 /* Hack -- display the trigger */
2578 Term_addstr(-1, TERM_WHITE, tmp);
2585 * Hack -- ask for a keymap "trigger" (see below)
2587 * Note that both "flush()" calls are extremely important. This may
2588 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2590 static void do_cmd_macro_aux_keymap(char *buf)
2604 /* Convert to ascii */
2605 ascii_to_text(tmp, buf);
2607 /* Hack -- display the trigger */
2608 Term_addstr(-1, TERM_WHITE, tmp);
2617 * Hack -- append all keymaps to the given file
2619 static errr keymap_dump(cptr fname)
2621 static cptr mark = "Keymap Dump";
2633 if (rogue_like_commands)
2635 mode = KEYMAP_MODE_ROGUE;
2641 mode = KEYMAP_MODE_ORIG;
2645 /* Build the filename */
2646 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2648 /* File type is "TEXT" */
2649 FILE_TYPE(FILE_TYPE_TEXT);
2651 /* Append to the file */
2652 fff = open_auto_dump(buf, mark, &line_num);
2653 if (!fff) return -1;
2657 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2659 fprintf(fff, "\n# Automatic keymap dump\n\n");
2664 for (i = 0; i < 256; i++)
2668 /* Loop up the keymap */
2669 act = keymap_act[mode][i];
2671 /* Skip empty keymaps */
2674 /* Encode the key */
2677 ascii_to_text(key, buf);
2679 /* Encode the action */
2680 ascii_to_text(buf, act);
2682 /* Dump the macro */
2683 fprintf(fff, "A:%s\n", buf);
2684 fprintf(fff, "C:%d:%s\n", mode, key);
2689 close_auto_dump(fff, mark, line_num);
2698 * Interact with "macros"
2700 * Note that the macro "action" must be defined before the trigger.
2702 * Could use some helpful instructions on this page. XXX XXX XXX
2704 void do_cmd_macros(void)
2716 if (rogue_like_commands)
2718 mode = KEYMAP_MODE_ROGUE;
2724 mode = KEYMAP_MODE_ORIG;
2727 /* File type is "TEXT" */
2728 FILE_TYPE(FILE_TYPE_TEXT);
2735 /* Process requests until done */
2743 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2745 prt("Interact with Macros", 2, 0);
2750 /* Describe that action */
2752 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2754 prt("Current action (if any) shown below:", 20, 0);
2758 /* Analyze the current action */
2759 ascii_to_text(buf, macro__buf);
2761 /* Display the current action */
2767 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2769 prt("(1) Load a user pref file", 4, 5);
2774 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2775 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2776 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2777 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2778 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2779 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2780 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2781 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2782 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2784 prt("(2) Append macros to a file", 5, 5);
2785 prt("(3) Query a macro", 6, 5);
2786 prt("(4) Create a macro", 7, 5);
2787 prt("(5) Remove a macro", 8, 5);
2788 prt("(6) Append keymaps to a file", 9, 5);
2789 prt("(7) Query a keymap", 10, 5);
2790 prt("(8) Create a keymap", 11, 5);
2791 prt("(9) Remove a keymap", 12, 5);
2792 prt("(0) Enter a new action", 13, 5);
2795 #endif /* ALLOW_MACROS */
2799 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2801 prt("Command: ", 16, 0);
2809 if (i == ESCAPE) break;
2811 /* Load a 'macro' file */
2818 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2820 prt("Command: Load a user pref file", 16, 0);
2826 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2828 prt("File: ", 18, 0);
2832 /* Default filename */
2833 sprintf(tmp, "%s.prf", player_name);
2835 /* Ask for a file */
2836 if (!askfor_aux(tmp, 80)) continue;
2838 /* Process the given filename */
2839 err = process_pref_file(tmp);
2843 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2845 msg_format("Loaded default '%s'.", tmp);
2852 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2854 msg_format("Failed to load '%s'!");
2860 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2862 msg_format("Loaded '%s'.", tmp);
2874 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2876 prt("Command: Append macros to a file", 16, 0);
2882 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2884 prt("File: ", 18, 0);
2888 /* Default filename */
2889 sprintf(tmp, "%s.prf", player_name);
2891 /* Ask for a file */
2892 if (!askfor_aux(tmp, 80)) continue;
2894 /* Dump the macros */
2895 (void)macro_dump(tmp);
2899 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2901 msg_print("Appended macros.");
2913 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2915 prt("Command: Query a macro", 16, 0);
2921 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2923 prt("Trigger: ", 18, 0);
2927 /* Get a macro trigger */
2928 do_cmd_macro_aux(buf);
2930 /* Acquire action */
2931 k = macro_find_exact(buf);
2938 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2940 msg_print("Found no macro.");
2948 /* Obtain the action */
2949 strcpy(macro__buf, macro__act[k]);
2951 /* Analyze the current action */
2952 ascii_to_text(buf, macro__buf);
2954 /* Display the current action */
2959 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2961 msg_print("Found a macro.");
2967 /* Create a macro */
2972 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2974 prt("Command: Create a macro", 16, 0);
2980 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2982 prt("Trigger: ", 18, 0);
2986 /* Get a macro trigger */
2987 do_cmd_macro_aux(buf);
2994 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
2996 prt("Action: ", 20, 0);
3000 /* Convert to text */
3001 ascii_to_text(tmp, macro__buf);
3003 /* Get an encoded action */
3004 if (askfor_aux(tmp, 80))
3006 /* Convert to ascii */
3007 text_to_ascii(macro__buf, tmp);
3009 /* Link the macro */
3010 macro_add(buf, macro__buf);
3014 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3016 msg_print("Added a macro.");
3022 /* Remove a macro */
3027 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3029 prt("Command: Remove a macro", 16, 0);
3035 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3037 prt("Trigger: ", 18, 0);
3041 /* Get a macro trigger */
3042 do_cmd_macro_aux(buf);
3044 /* Link the macro */
3045 macro_add(buf, buf);
3049 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3051 msg_print("Removed a macro.");
3061 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3063 prt("Command: Append keymaps to a file", 16, 0);
3069 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3071 prt("File: ", 18, 0);
3075 /* Default filename */
3076 sprintf(tmp, "%s.prf", player_name);
3078 /* Ask for a file */
3079 if (!askfor_aux(tmp, 80)) continue;
3081 /* Dump the macros */
3082 (void)keymap_dump(tmp);
3086 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3088 msg_print("Appended keymaps.");
3093 /* Query a keymap */
3100 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3102 prt("Command: Query a keymap", 16, 0);
3108 prt("²¡¤¹¥¡¼: ", 18, 0);
3110 prt("Keypress: ", 18, 0);
3114 /* Get a keymap trigger */
3115 do_cmd_macro_aux_keymap(buf);
3117 /* Look up the keymap */
3118 act = keymap_act[mode][(byte)(buf[0])];
3125 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3127 msg_print("Found no keymap.");
3135 /* Obtain the action */
3136 strcpy(macro__buf, act);
3138 /* Analyze the current action */
3139 ascii_to_text(buf, macro__buf);
3141 /* Display the current action */
3146 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3148 msg_print("Found a keymap.");
3154 /* Create a keymap */
3159 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3161 prt("Command: Create a keymap", 16, 0);
3167 prt("²¡¤¹¥¡¼: ", 18, 0);
3169 prt("Keypress: ", 18, 0);
3173 /* Get a keymap trigger */
3174 do_cmd_macro_aux_keymap(buf);
3181 prt("¹ÔÆ°: ", 20, 0);
3183 prt("Action: ", 20, 0);
3187 /* Convert to text */
3188 ascii_to_text(tmp, macro__buf);
3190 /* Get an encoded action */
3191 if (askfor_aux(tmp, 80))
3193 /* Convert to ascii */
3194 text_to_ascii(macro__buf, tmp);
3196 /* Free old keymap */
3197 string_free(keymap_act[mode][(byte)(buf[0])]);
3199 /* Make new keymap */
3200 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3204 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3206 msg_print("Added a keymap.");
3212 /* Remove a keymap */
3217 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3219 prt("Command: Remove a keymap", 16, 0);
3225 prt("²¡¤¹¥¡¼: ", 18, 0);
3227 prt("Keypress: ", 18, 0);
3231 /* Get a keymap trigger */
3232 do_cmd_macro_aux_keymap(buf);
3234 /* Free old keymap */
3235 string_free(keymap_act[mode][(byte)(buf[0])]);
3237 /* Make new keymap */
3238 keymap_act[mode][(byte)(buf[0])] = NULL;
3242 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3244 msg_print("Removed a keymap.");
3249 /* Enter a new action */
3254 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3256 prt("Command: Enter a new action", 16, 0);
3260 /* Go to the correct location */
3263 /* Hack -- limit the value */
3266 /* Get an encoded action */
3267 if (!askfor_aux(buf, 80)) continue;
3269 /* Extract an action */
3270 text_to_ascii(macro__buf, buf);
3273 #endif /* ALLOW_MACROS */
3282 /* Flush messages */
3291 static void cmd_visuals_aux(int i, int *num, int max)
3298 sprintf(str, "%d", *num);
3300 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3303 tmp = strtol(str, NULL, 0);
3304 if (tmp >= 0 && tmp < max)
3308 else if (isupper(i))
3309 *num = (*num + max - 1) % max;
3311 *num = (*num + 1) % max;
3317 * Interact with "visuals"
3319 void do_cmd_visuals(void)
3330 /* File type is "TEXT" */
3331 FILE_TYPE(FILE_TYPE_TEXT);
3334 /* Save the screen */
3338 /* Interact until done */
3344 /* Ask for a choice */
3346 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3348 prt("Interact with Visuals", 2, 0);
3352 /* Give some choices */
3354 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3356 prt("(1) Load a user pref file", 4, 5);
3359 #ifdef ALLOW_VISUALS
3361 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3362 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3363 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3364 prt("(5) (̤»ÈÍÑ)", 8, 5);
3365 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3366 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3367 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3368 prt("(9) (̤»ÈÍÑ)", 12, 5);
3370 prt("(2) Dump monster attr/chars", 5, 5);
3371 prt("(3) Dump object attr/chars", 6, 5);
3372 prt("(4) Dump feature attr/chars", 7, 5);
3373 prt("(5) (unused)", 8, 5);
3374 prt("(6) Change monster attr/chars", 9, 5);
3375 prt("(7) Change object attr/chars", 10, 5);
3376 prt("(8) Change feature attr/chars", 11, 5);
3377 prt("(9) (unused)", 12, 5);
3382 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3384 prt("(0) Reset visuals", 13, 5);
3390 prt("¥³¥Þ¥ó¥É:", 18, 0);
3392 prt("Command: ", 15, 0);
3400 if (i == ESCAPE) break;
3402 /* Load a 'pref' file */
3407 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3409 prt("Command: Load a user pref file", 15, 0);
3415 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3417 prt("File: ", 17, 0);
3421 /* Default filename */
3422 sprintf(tmp, "%s.prf", player_name);
3425 if (!askfor_aux(tmp, 70)) continue;
3427 /* Process the given filename */
3428 (void)process_pref_file(tmp);
3431 #ifdef ALLOW_VISUALS
3433 /* Dump monster attr/chars */
3436 static cptr mark = "Monster attr/chars";
3441 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3443 prt("Command: Dump monster attr/chars", 15, 0);
3449 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3451 prt("File: ", 17, 0);
3455 /* Default filename */
3456 sprintf(tmp, "%s.prf", player_name);
3458 /* Get a filename */
3459 if (!askfor_aux(tmp, 70)) continue;
3461 /* Build the filename */
3462 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3464 /* Append to the file */
3465 fff = open_auto_dump(buf, mark, &line_num);
3470 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3472 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3477 for (i = 0; i < max_r_idx; i++)
3479 monster_race *r_ptr = &r_info[i];
3481 /* Skip non-entries */
3482 if (!r_ptr->name) continue;
3484 /* Dump a comment */
3485 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3488 /* Dump the monster attr/char info */
3489 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3490 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3495 close_auto_dump(fff, mark, line_num);
3499 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3501 msg_print("Dumped monster attr/chars.");
3506 /* Dump object attr/chars */
3509 static cptr mark = "Object attr/chars";
3514 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3516 prt("Command: Dump object attr/chars", 15, 0);
3522 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3524 prt("File: ", 17, 0);
3528 /* Default filename */
3529 sprintf(tmp, "%s.prf", player_name);
3531 /* Get a filename */
3532 if (!askfor_aux(tmp, 70)) continue;
3534 /* Build the filename */
3535 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3537 /* Append to the file */
3538 fff = open_auto_dump(buf, mark, &line_num);
3543 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3545 fprintf(fff, "\n# Object attr/char definitions\n\n");
3550 for (i = 0; i < max_k_idx; i++)
3552 object_kind *k_ptr = &k_info[i];
3554 /* Skip non-entries */
3555 if (!k_ptr->name) continue;
3557 /* Dump a comment */
3558 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3561 /* Dump the object attr/char info */
3562 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3563 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3568 close_auto_dump(fff, mark, line_num);
3572 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3574 msg_print("Dumped object attr/chars.");
3579 /* Dump feature attr/chars */
3582 static cptr mark = "Feature attr/chars";
3587 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3589 prt("Command: Dump feature attr/chars", 15, 0);
3595 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3597 prt("File: ", 17, 0);
3601 /* Default filename */
3602 sprintf(tmp, "%s.prf", player_name);
3604 /* Get a filename */
3605 if (!askfor_aux(tmp, 70)) continue;
3607 /* Build the filename */
3608 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3610 /* Append to the file */
3611 fff = open_auto_dump(buf, mark, &line_num);
3616 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3618 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3623 for (i = 0; i < max_f_idx; i++)
3625 feature_type *f_ptr = &f_info[i];
3627 /* Skip non-entries */
3628 if (!f_ptr->name) continue;
3630 /* Dump a comment */
3631 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3634 /* Dump the feature attr/char info */
3635 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3636 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3641 close_auto_dump(fff, mark, line_num);
3645 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3647 msg_print("Dumped feature attr/chars.");
3652 /* Modify monster attr/chars */
3659 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3661 prt("Command: Change monster attr/chars", 15, 0);
3665 /* Hack -- query until done */
3668 monster_race *r_ptr = &r_info[r];
3672 byte da = (r_ptr->d_attr);
3673 byte dc = (r_ptr->d_char);
3674 byte ca = (r_ptr->x_attr);
3675 byte cc = (r_ptr->x_char);
3677 /* Label the object */
3679 Term_putstr(5, 17, -1, TERM_WHITE,
3680 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3681 r, (r_name + r_ptr->name)));
3683 Term_putstr(5, 17, -1, TERM_WHITE,
3684 format("Monster = %d, Name = %-40.40s",
3685 r, (r_name + r_ptr->name)));
3689 /* Label the Default values */
3691 Term_putstr(10, 19, -1, TERM_WHITE,
3692 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3694 Term_putstr(10, 19, -1, TERM_WHITE,
3695 format("Default attr/char = %3u / %3u", da, dc));
3698 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3699 Term_putch(43, 19, da, dc);
3703 Term_putch(44, 19, 255, -1);
3705 Term_putch(44, 19, 0, ' ');
3708 /* Label the Current values */
3710 Term_putstr(10, 20, -1, TERM_WHITE,
3711 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3713 Term_putstr(10, 20, -1, TERM_WHITE,
3714 format("Current attr/char = %3u / %3u", ca, cc));
3717 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3718 Term_putch(43, 20, ca, cc);
3722 Term_putch(44, 20, 255, -1);
3724 Term_putch(44, 20, 0, ' ');
3729 Term_putstr(0, 22, -1, TERM_WHITE,
3730 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3732 Term_putstr(0, 22, -1, TERM_WHITE,
3733 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3740 if (i == ESCAPE) break;
3742 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3743 else if (isupper(i)) c = 'a' + i - 'A';
3749 cmd_visuals_aux(i, &r, max_r_idx);
3752 t = (int)r_ptr->x_attr;
3753 cmd_visuals_aux(i, &t, 256);
3754 r_ptr->x_attr = (byte)t;
3757 t = (int)r_ptr->x_char;
3758 cmd_visuals_aux(i, &t, 256);
3759 r_ptr->x_char = (byte)t;
3765 /* Modify object attr/chars */
3772 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3774 prt("Command: Change object attr/chars", 15, 0);
3778 /* Hack -- query until done */
3781 object_kind *k_ptr = &k_info[k];
3785 byte da = (byte)k_ptr->d_attr;
3786 byte dc = (byte)k_ptr->d_char;
3787 byte ca = (byte)k_ptr->x_attr;
3788 byte cc = (byte)k_ptr->x_char;
3790 /* Label the object */
3792 Term_putstr(5, 17, -1, TERM_WHITE,
3793 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3794 k, (k_name + k_ptr->name)));
3796 Term_putstr(5, 17, -1, TERM_WHITE,
3797 format("Object = %d, Name = %-40.40s",
3798 k, (k_name + k_ptr->name)));
3802 /* Label the Default values */
3804 Term_putstr(10, 19, -1, TERM_WHITE,
3805 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3807 Term_putstr(10, 19, -1, TERM_WHITE,
3808 format("Default attr/char = %3d / %3d", da, dc));
3811 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3812 Term_putch(43, 19, da, dc);
3816 Term_putch(44, 19, 255, -1);
3818 Term_putch(44, 19, 0, ' ');
3821 /* Label the Current values */
3823 Term_putstr(10, 20, -1, TERM_WHITE,
3824 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3826 Term_putstr(10, 20, -1, TERM_WHITE,
3827 format("Current attr/char = %3d / %3d", ca, cc));
3830 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3831 Term_putch(43, 20, ca, cc);
3835 Term_putch(44, 20, 255, -1);
3837 Term_putch(44, 20, 0, ' ');
3842 Term_putstr(0, 22, -1, TERM_WHITE,
3843 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3845 Term_putstr(0, 22, -1, TERM_WHITE,
3846 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3853 if (i == ESCAPE) break;
3855 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3856 else if (isupper(i)) c = 'a' + i - 'A';
3862 cmd_visuals_aux(i, &k, max_k_idx);
3865 t = (int)k_info[k].x_attr;
3866 cmd_visuals_aux(i, &t, 256);
3867 k_info[k].x_attr = (byte)t;
3870 t = (int)k_info[k].x_char;
3871 cmd_visuals_aux(i, &t, 256);
3872 k_info[k].x_char = (byte)t;
3878 /* Modify feature attr/chars */
3885 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3887 prt("Command: Change feature attr/chars", 15, 0);
3891 /* Hack -- query until done */
3894 feature_type *f_ptr = &f_info[f];
3898 byte da = (byte)f_ptr->d_attr;
3899 byte dc = (byte)f_ptr->d_char;
3900 byte ca = (byte)f_ptr->x_attr;
3901 byte cc = (byte)f_ptr->x_char;
3903 /* Label the object */
3905 Term_putstr(5, 17, -1, TERM_WHITE,
3906 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3907 f, (f_name + f_ptr->name)));
3909 Term_putstr(5, 17, -1, TERM_WHITE,
3910 format("Terrain = %d, Name = %-40.40s",
3911 f, (f_name + f_ptr->name)));
3915 /* Label the Default values */
3917 Term_putstr(10, 19, -1, TERM_WHITE,
3918 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3920 Term_putstr(10, 19, -1, TERM_WHITE,
3921 format("Default attr/char = %3d / %3d", da, dc));
3924 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3925 Term_putch(43, 19, da, dc);
3929 Term_putch(44, 19, 255, -1);
3931 Term_putch(44, 19, 0, ' ');
3934 /* Label the Current values */
3936 Term_putstr(10, 20, -1, TERM_WHITE,
3937 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3939 Term_putstr(10, 20, -1, TERM_WHITE,
3940 format("Current attr/char = %3d / %3d", ca, cc));
3943 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3944 Term_putch(43, 20, ca, cc);
3948 Term_putch(44, 20, 255, -1);
3950 Term_putch(44, 20, 0, ' ');
3955 Term_putstr(0, 22, -1, TERM_WHITE,
3956 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3958 Term_putstr(0, 22, -1, TERM_WHITE,
3959 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3966 if (i == ESCAPE) break;
3968 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3969 else if (isupper(i)) c = 'a' + i - 'A';
3975 cmd_visuals_aux(i, &f, max_f_idx);
3978 t = (int)f_info[f].x_attr;
3979 cmd_visuals_aux(i, &t, 256);
3980 f_info[f].x_attr = (byte)t;
3983 t = (int)f_info[f].x_char;
3984 cmd_visuals_aux(i, &t, 256);
3985 f_info[f].x_char = (byte)t;
4001 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4003 msg_print("Visual attr/char tables reset.");
4008 /* Unknown option */
4014 /* Flush messages */
4019 /* Restore the screen */
4025 * Interact with "colors"
4027 void do_cmd_colors(void)
4038 /* File type is "TEXT" */
4039 FILE_TYPE(FILE_TYPE_TEXT);
4042 /* Save the screen */
4046 /* Interact until done */
4052 /* Ask for a choice */
4054 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4056 prt("Interact with Colors", 2, 0);
4060 /* Give some choices */
4062 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4064 prt("(1) Load a user pref file", 4, 5);
4069 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4070 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4072 prt("(2) Dump colors", 5, 5);
4073 prt("(3) Modify colors", 6, 5);
4080 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4082 prt("Command: ", 8, 0);
4090 if (i == ESCAPE) break;
4092 /* Load a 'pref' file */
4097 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4099 prt("Command: Load a user pref file", 8, 0);
4105 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4107 prt("File: ", 10, 0);
4112 sprintf(tmp, "%s.prf", player_name);
4115 if (!askfor_aux(tmp, 70)) continue;
4117 /* Process the given filename */
4118 (void)process_pref_file(tmp);
4120 /* Mega-Hack -- react to changes */
4121 Term_xtra(TERM_XTRA_REACT, 0);
4123 /* Mega-Hack -- redraw */
4132 static cptr mark = "Colors";
4137 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4139 prt("Command: Dump colors", 8, 0);
4145 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4147 prt("File: ", 10, 0);
4151 /* Default filename */
4152 sprintf(tmp, "%s.prf", player_name);
4154 /* Get a filename */
4155 if (!askfor_aux(tmp, 70)) continue;
4157 /* Build the filename */
4158 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
4160 /* Append to the file */
4161 fff = open_auto_dump(buf, mark, &line_num);
4166 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4168 fprintf(fff, "\n# Color redefinitions\n\n");
4173 for (i = 0; i < 256; i++)
4175 int kv = angband_color_table[i][0];
4176 int rv = angband_color_table[i][1];
4177 int gv = angband_color_table[i][2];
4178 int bv = angband_color_table[i][3];
4183 cptr name = "unknown";
4187 /* Skip non-entries */
4188 if (!kv && !rv && !gv && !bv) continue;
4190 /* Extract the color name */
4191 if (i < 16) name = color_names[i];
4193 /* Dump a comment */
4195 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4197 fprintf(fff, "# Color '%s'\n", name);
4201 /* Dump the monster attr/char info */
4202 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4208 close_auto_dump(fff, mark, line_num);
4212 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4214 msg_print("Dumped color redefinitions.");
4226 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4228 prt("Command: Modify colors", 8, 0);
4232 /* Hack -- query until done */
4241 /* Exhibit the normal colors */
4242 for (j = 0; j < 16; j++)
4244 /* Exhibit this color */
4245 Term_putstr(j*4, 20, -1, a, "###");
4247 /* Exhibit all colors */
4248 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4251 /* Describe the color */
4253 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4255 name = ((a < 16) ? color_names[a] : "undefined");
4259 /* Describe the color */
4261 Term_putstr(5, 10, -1, TERM_WHITE,
4262 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4264 Term_putstr(5, 10, -1, TERM_WHITE,
4265 format("Color = %d, Name = %s", a, name));
4269 /* Label the Current values */
4270 Term_putstr(5, 12, -1, TERM_WHITE,
4271 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4272 angband_color_table[a][0],
4273 angband_color_table[a][1],
4274 angband_color_table[a][2],
4275 angband_color_table[a][3]));
4279 Term_putstr(0, 14, -1, TERM_WHITE,
4280 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4282 Term_putstr(0, 14, -1, TERM_WHITE,
4283 "Command (n/N/k/K/r/R/g/G/b/B): ");
4291 if (i == ESCAPE) break;
4294 if (i == 'n') a = (byte)(a + 1);
4295 if (i == 'N') a = (byte)(a - 1);
4296 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4297 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4298 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4299 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4300 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4301 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4302 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4303 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4305 /* Hack -- react to changes */
4306 Term_xtra(TERM_XTRA_REACT, 0);
4308 /* Hack -- redraw */
4315 /* Unknown option */
4321 /* Flush messages */
4326 /* Restore the screen */
4332 * Note something in the message recall
4334 void do_cmd_note(void)
4343 if (!get_string("¥á¥â: ", buf, 60)) return;
4345 if (!get_string("Note: ", buf, 60)) return;
4349 /* Ignore empty notes */
4350 if (!buf[0] || (buf[0] == ' ')) return;
4352 /* Add the note to the message recall */
4354 msg_format("¥á¥â: %s", buf);
4356 msg_format("Note: %s", buf);
4363 * Mention the current version
4365 void do_cmd_version(void)
4370 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4371 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4373 msg_format("You are playing Hengband %d.%d.%d.",
4374 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4381 * Array of feeling strings
4383 static cptr do_cmd_feeling_text[11] =
4386 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4388 "Looks like any other level.",
4392 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4394 "You feel there is something special about this level.",
4398 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4400 "You nearly faint as horrible visions of death fill your mind!",
4404 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4406 "This level looks very dangerous.",
4410 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4412 "You have a very bad feeling...",
4416 "°¤¤Í½´¶¤¬¤¹¤ë...",
4418 "You have a bad feeling...",
4424 "You feel nervous.",
4428 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4430 "You feel your luck is turning...",
4434 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4436 "You don't like the look of this place.",
4440 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4442 "This level looks reasonably safe.",
4446 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4448 "What a boring place..."
4453 static cptr do_cmd_feeling_text_combat[11] =
4456 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4458 "Looks like any other level.",
4462 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4464 "You feel there is something special about this level.",
4468 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4470 "You nearly faint as horrible visions of death fill your mind!",
4474 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4476 "This level looks very dangerous.",
4480 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4482 "You have a very bad feeling...",
4486 "°¤¤Í½´¶¤¬¤¹¤ë...",
4488 "You have a bad feeling...",
4494 "You feel nervous.",
4498 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4500 "You feel your luck is turning...",
4504 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4506 "You don't like the look of this place.",
4510 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4512 "This level looks reasonably safe.",
4516 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4518 "What a boring place..."
4523 static cptr do_cmd_feeling_text_lucky[11] =
4526 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4527 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4528 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4529 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4530 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4531 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4532 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4533 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4534 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4535 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4536 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4538 "Looks like any other level.",
4539 "You feel there is something special about this level.",
4540 "You have a superb feeling about this level.",
4541 "You have an excellent feeling...",
4542 "You have a very good feeling...",
4543 "You have a good feeling...",
4544 "You feel strangely lucky...",
4545 "You feel your luck is turning...",
4546 "You like the look of this place...",
4547 "This level can't be all bad...",
4548 "What a boring place..."
4554 * Note that "feeling" is set to zero unless some time has passed.
4555 * Note that this is done when the level is GENERATED, not entered.
4557 void do_cmd_feeling(void)
4559 /* Verify the feeling */
4560 if (feeling > 10) feeling = 10;
4562 /* No useful feeling in quests */
4563 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4566 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4568 msg_print("Looks like a typical quest level.");
4574 /* No useful feeling in town */
4575 else if (p_ptr->town_num && !dun_level)
4578 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4580 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4584 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4586 msg_print("Looks like a strange wilderness.");
4594 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4596 msg_print("Looks like a typical town.");
4603 /* No useful feeling in the wilderness */
4604 else if (!dun_level)
4607 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4609 msg_print("Looks like a typical wilderness.");
4615 /* Display the feeling */
4616 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4618 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4620 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4621 msg_print(do_cmd_feeling_text_combat[feeling]);
4623 msg_print(do_cmd_feeling_text[feeling]);
4628 msg_print(do_cmd_feeling_text[0]);
4637 * Encode the screen colors
4639 static char hack[17] = "dwsorgbuDWvyRGBU";
4642 static errr photo_fgets(FILE *fff, char *buf, huge n)
4651 if (fgets(tmp, 1024, fff))
4653 /* Convert weirdness */
4654 for (s = tmp; *s; s++)
4656 /* Handle newline */
4667 else if (*s == '\t')
4669 /* Hack -- require room */
4670 if (i + 8 >= n) break;
4672 /* Append a space */
4675 /* Append some more spaces */
4676 while (!(i % 8)) buf[i++] = ' ';
4680 else if (iskanji(*s))
4687 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4688 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4695 /* Handle printables */
4716 * Hack -- load a screen dump from a file
4718 void do_cmd_load_screen(void)
4733 Term_get_size(&wid, &hgt);
4735 /* Hack -- drop permissions */
4738 /* Build the filename */
4739 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4741 /* Append to the file */
4742 fff = my_fopen(buf, "r");
4747 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4749 msg_format("Failed to open %s.", buf);
4756 /* Save the screen */
4759 /* Clear the screen */
4763 /* Load the screen */
4764 for (y = 0; okay && (y < hgt); y++)
4766 /* Get a line of data */
4767 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4770 for (x = 0; x < wid - 1; x++)
4772 /* Put the attr/char */
4773 Term_draw(x, y, TERM_WHITE, buf[x]);
4777 /* Get the blank line */
4778 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4781 /* Dump the screen */
4782 for (y = 0; okay && (y < hgt); y++)
4784 /* Get a line of data */
4785 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4788 for (x = 0; x < wid - 1; x++)
4790 /* Get the attr/char */
4791 (void)(Term_what(x, y, &a, &c));
4793 /* Look up the attr */
4794 for (i = 0; i < 16; i++)
4796 /* Use attr matches */
4797 if (hack[i] == buf[x]) a = i;
4800 /* Put the attr/char */
4801 Term_draw(x, y, a, c);
4806 /* Get the blank line */
4807 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4813 /* Hack -- grab permissions */
4819 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4821 msg_print("Screen dump loaded.");
4828 /* Restore the screen */
4835 cptr inven_res_label =
4837 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4839 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4842 /* XTRA HACK RESLIST */
4843 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4844 int *j, byte tval, char *where)
4846 char o_name[MAX_NLEN];
4849 if (!o_ptr->k_idx)return;
4850 if (o_ptr->tval != tval)return;
4853 * HACK:Ring of Lordly protection and Dragon shield/helm
4854 * have random resistances.
4856 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4857 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4858 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4859 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4860 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4861 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4862 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4865 object_desc(o_name, o_ptr, TRUE, 0);
4867 while ( o_name[i] && i < 26 ){
4869 if (iskanji(o_name[i])) i++;
4873 if(i<28) while(i<28){o_name[i]=' ';i++;}
4876 fprintf(fff,"%s %s", where, o_name);
4878 if (!(o_ptr->ident & (IDENT_MENTAL)))
4881 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4883 fprintf(fff, "-------unknown------------ -------unknown------\n");
4887 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4890 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4891 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4892 else fprintf(fff,"¡¦");
4894 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4895 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4896 else fprintf(fff,"¡¦");
4898 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4899 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4900 else fprintf(fff,"¡¦");
4902 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4903 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4904 else fprintf(fff,"¡¦");
4906 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4907 else fprintf(fff,"¡¦");
4909 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4910 else fprintf(fff,"¡¦");
4912 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4913 else fprintf(fff,"¡¦");
4915 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4916 else fprintf(fff,"¡¦");
4918 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4919 else fprintf(fff,"¡¦");
4921 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4922 else fprintf(fff,"¡¦");
4924 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4925 else fprintf(fff,"¡¦");
4927 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4928 else fprintf(fff,"¡¦");
4930 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4931 else fprintf(fff,"¡¦");
4935 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4936 else fprintf(fff,"¡¦");
4938 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4939 else fprintf(fff,"¡¦");
4941 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4942 else fprintf(fff,"¡¦");
4944 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4945 else fprintf(fff,"¡¦");
4947 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4948 else fprintf(fff,"¡¦");
4950 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4951 else fprintf(fff,"¡¦");
4953 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4954 else fprintf(fff,"¡¦");
4956 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4957 else fprintf(fff,"¡¦");
4960 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4961 else fprintf(fff,"¡¦");
4963 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4964 else fprintf(fff,"¡¦");
4966 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4967 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4968 else fprintf(fff,". ");
4970 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4971 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4972 else fprintf(fff,". ");
4974 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4975 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4976 else fprintf(fff,". ");
4978 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4979 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4980 else fprintf(fff,". ");
4982 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4983 else fprintf(fff,". ");
4985 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4986 else fprintf(fff,". ");
4988 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
4989 else fprintf(fff,". ");
4991 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
4992 else fprintf(fff,". ");
4994 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
4995 else fprintf(fff,". ");
4997 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
4998 else fprintf(fff,". ");
5000 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
5001 else fprintf(fff,". ");
5003 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
5004 else fprintf(fff,". ");
5006 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
5007 else fprintf(fff,". ");
5011 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
5012 else fprintf(fff,". ");
5014 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
5015 else fprintf(fff,". ");
5017 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
5018 else fprintf(fff,". ");
5020 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
5021 else fprintf(fff,". ");
5023 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
5024 else fprintf(fff,". ");
5026 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
5027 else fprintf(fff,". ");
5029 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
5030 else fprintf(fff,". ");
5032 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
5033 else fprintf(fff,". ");
5036 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
5037 else fprintf(fff,". ");
5039 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
5040 else fprintf(fff,". ");
5048 fprintf(fff,"%s\n", inven_res_label);
5054 * Display *ID* ed weapons/armors's resistances
5056 static void do_cmd_knowledge_inven(void)
5061 char file_name[1024];
5072 /* Open a new file */
5073 fff = my_fopen_temp(file_name, 1024);
5076 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5078 msg_format("Failed to create temporally file %s.", file_name);
5083 fprintf(fff,"%s\n",inven_res_label);
5085 for (tval=TV_BOW; tval <= TV_RING; tval++){
5088 for (;j<9;j++) fprintf(fff, "\n");
5090 fprintf(fff,"%s\n",inven_res_label);
5094 strcpy(where, "Áõ");
5096 strcpy(where, "E ");
5098 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5100 o_ptr = &inventory[i];
5101 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5105 strcpy(where, "»ý");
5107 strcpy(where, "I ");
5109 for (i = 0; i < INVEN_PACK; i++)
5111 o_ptr = &inventory[i];
5112 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5116 /* Print all homes in the different towns */
5117 st_ptr = &town[1].store[STORE_HOME];
5119 strcpy(where, "²È");
5121 strcpy(where, "H ");
5124 /* Dump all available items */
5125 for (i = 0; i < st_ptr->stock_num; i++)
5127 o_ptr = &st_ptr->stock[i];
5128 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5132 /* Close the file */
5135 /* Display the file contents */
5137 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5139 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5142 /* Remove the file */
5147 void do_cmd_save_screen_html_aux(char *filename, int message)
5151 byte a = 0, old_a = 0;
5165 cptr html_head[] = {
5166 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5170 cptr html_foot[] = {
5172 "</body>\n</html>\n",
5178 Term_get_size(&wid, &hgt);
5180 /* File type is "TEXT" */
5181 FILE_TYPE(FILE_TYPE_TEXT);
5183 /* Append to the file */
5184 fff = my_fopen(filename, "w");
5190 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5192 msg_format("Failed to open file %s.", filename);
5200 /* Save the screen */
5204 /* Build the filename */
5205 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
5206 tmpfff = my_fopen(buf, "r");
5208 for (i = 0; html_head[i]; i++)
5209 fprintf(fff, html_head[i]);
5213 while (!my_fgets(tmpfff, buf, 1024)) {
5215 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5219 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5221 fprintf(fff, "%s\n", buf);
5226 /* Dump the screen */
5227 for (y = 0; y < hgt; y++)
5234 for (x = 0; x < wid - 1; x++)
5238 /* Get the attr/char */
5239 (void)(Term_what(x, y, &a, &c));
5243 case '&': cc = "&"; break;
5244 case '<': cc = "<"; break;
5245 case '>': cc = ">"; break;
5247 case 0x1f: c = '.'; break;
5248 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5253 if ((y == 0 && x == 0) || a != old_a) {
5254 rv = angband_color_table[a][1];
5255 gv = angband_color_table[a][2];
5256 bv = angband_color_table[a][3];
5257 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5258 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5262 fprintf(fff, "%s", cc);
5264 fprintf(fff, "%c", c);
5267 fprintf(fff, "</font>");
5270 for (i = 0; html_foot[i]; i++)
5271 fprintf(fff, html_foot[i]);
5276 while (!my_fgets(tmpfff, buf, 1024)) {
5278 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5282 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5284 fprintf(fff, "%s\n", buf);
5299 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5301 msg_print("Screen dump saved.");
5306 /* Restore the screen */
5312 * Hack -- save a screen dump to a file
5314 static void do_cmd_save_screen_html(void)
5316 char buf[1024], tmp[256] = "screen.html";
5319 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5321 if (!get_string("File name: ", tmp, 80))
5325 /* Build the filename */
5326 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5330 /* Hack -- drop permissions */
5333 do_cmd_save_screen_html_aux(buf, 1);
5335 /* Hack -- grab permissions */
5341 * Redefinable "save_screen" action
5343 void (*screendump_aux)(void) = NULL;
5347 * Hack -- save a screen dump to a file
5349 void do_cmd_save_screen(void)
5351 bool old_use_graphics = use_graphics;
5352 bool html_dump = FALSE;
5357 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
5359 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
5364 if (c == 'Y' || c == 'y')
5366 else if (c == 'H' || c == 'h')
5378 Term_get_size(&wid, &hgt);
5380 if (old_use_graphics)
5382 use_graphics = FALSE;
5385 /* Redraw everything */
5386 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5388 /* Hack -- update */
5394 do_cmd_save_screen_html();
5398 /* Do we use a special screendump function ? */
5399 else if (screendump_aux)
5401 /* Dump the screen to a graphics file */
5402 (*screendump_aux)();
5404 else /* Dump the screen as text */
5416 /* Hack -- drop permissions */
5419 /* Build the filename */
5420 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5422 /* File type is "TEXT" */
5423 FILE_TYPE(FILE_TYPE_TEXT);
5425 /* Append to the file */
5426 fff = my_fopen(buf, "w");
5431 /* Hack -- grab permissions */
5434 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5436 msg_format("Failed to open file %s.", buf);
5443 /* Save the screen */
5447 /* Dump the screen */
5448 for (y = 0; y < hgt; y++)
5451 for (x = 0; x < wid - 1; x++)
5453 /* Get the attr/char */
5454 (void)(Term_what(x, y, &a, &c));
5464 fprintf(fff, "%s\n", buf);
5471 /* Dump the screen */
5472 for (y = 0; y < hgt; y++)
5475 for (x = 0; x < wid - 1; x++)
5477 /* Get the attr/char */
5478 (void)(Term_what(x, y, &a, &c));
5481 buf[x] = hack[a&0x0F];
5488 fprintf(fff, "%s\n", buf);
5498 /* Hack -- grab permissions */
5503 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5505 msg_print("Screen dump saved.");
5511 /* Restore the screen */
5515 if (old_use_graphics)
5517 use_graphics = TRUE;
5520 /* Redraw everything */
5521 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5523 /* Hack -- update */
5530 * Sorting hook -- Comp function -- see below
5532 * We use "u" to point to array of monster indexes,
5533 * and "v" to select the type of sorting to perform on "u".
5535 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5537 u16b *who = (u16b*)(u);
5539 u16b *why = (u16b*)(v);
5547 /* Sort by total kills */
5550 /* Extract total kills */
5551 z1 = a_info[w1].tval;
5552 z2 = a_info[w2].tval;
5554 /* Compare total kills */
5555 if (z1 < z2) return (TRUE);
5556 if (z1 > z2) return (FALSE);
5560 /* Sort by monster level */
5563 /* Extract levels */
5564 z1 = a_info[w1].sval;
5565 z2 = a_info[w2].sval;
5567 /* Compare levels */
5568 if (z1 < z2) return (TRUE);
5569 if (z1 > z2) return (FALSE);
5573 /* Sort by monster experience */
5576 /* Extract experience */
5577 z1 = a_info[w1].level;
5578 z2 = a_info[w2].level;
5580 /* Compare experience */
5581 if (z1 < z2) return (TRUE);
5582 if (z1 > z2) return (FALSE);
5586 /* Compare indexes */
5592 * Sorting hook -- Swap function -- see below
5594 * We use "u" to point to array of monster indexes,
5595 * and "v" to select the type of sorting to perform.
5597 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5599 u16b *who = (u16b*)(u);
5611 * Check the status of "artifacts"
5613 static void do_cmd_knowledge_artifacts(void)
5615 int i, k, z, x, y, n = 0;
5621 char file_name[1024];
5623 char base_name[MAX_NLEN];
5627 /* Open a new file */
5628 fff = my_fopen_temp(file_name, 1024);
5632 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5634 msg_format("Failed to create temporary file %s.", file_name);
5640 /* Allocate the "who" array */
5641 C_MAKE(who, max_r_idx, s16b);
5643 /* Allocate the "okay" array */
5644 C_MAKE(okay, max_a_idx, bool);
5646 /* Scan the artifacts */
5647 for (k = 0; k < max_a_idx; k++)
5649 artifact_type *a_ptr = &a_info[k];
5654 /* Skip "empty" artifacts */
5655 if (!a_ptr->name) continue;
5657 /* Skip "uncreated" artifacts */
5658 if (!a_ptr->cur_num) continue;
5664 /* Check the dungeon */
5665 for (y = 0; y < cur_hgt; y++)
5667 for (x = 0; x < cur_wid; x++)
5669 cave_type *c_ptr = &cave[y][x];
5671 s16b this_o_idx, next_o_idx = 0;
5673 /* Scan all objects in the grid */
5674 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5678 /* Acquire object */
5679 o_ptr = &o_list[this_o_idx];
5681 /* Acquire next object */
5682 next_o_idx = o_ptr->next_o_idx;
5684 /* Ignore non-artifacts */
5685 if (!artifact_p(o_ptr)) continue;
5687 /* Ignore known items */
5688 if (object_known_p(o_ptr)) continue;
5690 /* Note the artifact */
5691 okay[o_ptr->name1] = FALSE;
5696 /* Check the inventory and equipment */
5697 for (i = 0; i < INVEN_TOTAL; i++)
5699 object_type *o_ptr = &inventory[i];
5701 /* Ignore non-objects */
5702 if (!o_ptr->k_idx) continue;
5704 /* Ignore non-artifacts */
5705 if (!artifact_p(o_ptr)) continue;
5707 /* Ignore known items */
5708 if (object_known_p(o_ptr)) continue;
5710 /* Note the artifact */
5711 okay[o_ptr->name1] = FALSE;
5714 for (k = 0; k < max_a_idx; k++)
5716 if (okay[k]) who[n++] = k;
5719 /* Select the sort method */
5720 ang_sort_comp = ang_sort_art_comp;
5721 ang_sort_swap = ang_sort_art_swap;
5723 /* Sort the array by dungeon depth of monsters */
5724 ang_sort(who, &why, n);
5726 /* Scan the artifacts */
5727 for (k = 0; k < n; k++)
5729 artifact_type *a_ptr = &a_info[who[k]];
5733 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5735 strcpy(base_name, "Unknown Artifact");
5739 /* Obtain the base object type */
5740 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5748 /* Get local object */
5751 /* Create fake object */
5752 object_prep(q_ptr, z);
5754 /* Make it an artifact */
5755 q_ptr->name1 = (byte)who[k];
5757 /* Describe the artifact */
5758 object_desc_store(base_name, q_ptr, FALSE, 0);
5761 /* Hack -- Build the artifact name */
5763 fprintf(fff, " %s\n", base_name);
5765 fprintf(fff, " The %s\n", base_name);
5770 /* Free the "who" array */
5771 C_KILL(who, max_r_idx, s16b);
5773 /* Free the "okay" array */
5774 C_KILL(okay, max_a_idx, bool);
5776 /* Close the file */
5779 /* Display the file contents */
5781 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5783 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5787 /* Remove the file */
5793 * Display known uniques
5795 static void do_cmd_knowledge_uniques(void)
5803 char file_name[1024];
5805 /* Open a new file */
5806 fff = my_fopen_temp(file_name, 1024);
5810 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5812 msg_format("Failed to create temporary file %s.", file_name);
5818 /* Allocate the "who" array */
5819 C_MAKE(who, max_r_idx, s16b);
5821 /* Scan the monsters */
5822 for (i = 1; i < max_r_idx; i++)
5824 monster_race *r_ptr = &r_info[i];
5826 /* Use that monster */
5827 if (r_ptr->name) who[n++] = i;
5830 /* Select the sort method */
5831 ang_sort_comp = ang_sort_comp_hook;
5832 ang_sort_swap = ang_sort_swap_hook;
5834 /* Sort the array by dungeon depth of monsters */
5835 ang_sort(who, &why, n);
5837 /* Scan the monster races */
5838 for (k = 0; k < n; k++)
5840 monster_race *r_ptr = &r_info[who[k]];
5842 /* Only print Uniques */
5843 if (r_ptr->flags1 & (RF1_UNIQUE))
5845 bool dead = (r_ptr->max_num == 0);
5849 /* Only display "known" uniques */
5850 if (dead || cheat_know || r_ptr->r_sights)
5852 /* Print a message */
5854 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5855 (r_name + r_ptr->name));
5857 fprintf(fff, " %s is alive\n",
5858 (r_name + r_ptr->name));
5865 /* Free the "who" array */
5866 C_KILL(who, max_r_idx, s16b);
5868 /* Close the file */
5871 /* Display the file contents */
5873 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5875 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5879 /* Remove the file */
5885 * Display dead uniques
5887 static void do_cmd_knowledge_uniques_dead(void)
5895 char file_name[1024];
5897 /* Open a new file */
5898 fff = my_fopen_temp(file_name, 1024);
5902 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5904 msg_format("Failed to create temporary file %s.", file_name);
5910 /* Allocate the "who" array */
5911 C_MAKE(who, max_r_idx, s16b);
5913 /* Scan the monsters */
5914 for (i = 1; i < max_r_idx; i++)
5916 monster_race *r_ptr = &r_info[i];
5918 /* Use that monster */
5919 if (r_ptr->name) who[n++] = i;
5922 /* Select the sort method */
5923 ang_sort_comp = ang_sort_comp_hook;
5924 ang_sort_swap = ang_sort_swap_hook;
5926 /* Sort the array by dungeon depth of monsters */
5927 ang_sort(who, &why, n);
5929 /* Scan the monster races */
5930 for (k = 0; k < n; k++)
5932 monster_race *r_ptr = &r_info[who[k]];
5934 /* Only print Uniques */
5935 if (r_ptr->flags1 & (RF1_UNIQUE))
5937 bool dead = (r_ptr->max_num == 0);
5939 if (!dead) continue;
5941 /* Only display "known" uniques */
5942 if (dead || cheat_know || r_ptr->r_sights)
5944 /* Print a message */
5946 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5947 (r_name + r_ptr->name));
5949 fprintf(fff, " %s is dead\n",
5950 (r_name + r_ptr->name));
5957 /* Free the "who" array */
5958 C_KILL(who, max_r_idx, s16b);
5960 /* Close the file */
5963 /* Display the file contents */
5965 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5967 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5971 /* Remove the file */
5977 * Display weapon-exp
5979 static void do_cmd_knowledge_weapon_exp(void)
5981 int i,j, num, shougou;
5985 char file_name[1024];
5988 /* Open a new file */
5989 fff = my_fopen_temp(file_name, 1024);
5992 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5994 msg_format("Failed to create temporary file %s.", file_name);
6000 for(i = 0; i < 5; i++)
6002 for (num = 0; num < 64; num++)
6004 for (j = 0; j < max_k_idx; j++)
6006 object_kind *k_ptr = &k_info[j];
6008 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6010 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6012 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6013 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6014 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6015 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6018 fprintf(fff,"%-25s ",tmp);
6019 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6020 else fprintf(fff," ");
6021 fprintf(fff,"%s",shougou_moji[shougou]);
6022 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6030 /* Close the file */
6033 /* Display the file contents */
6035 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6037 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6041 /* Remove the file */
6049 static void do_cmd_knowledge_spell_exp(void)
6056 char file_name[1024];
6058 /* Open a new file */
6059 fff = my_fopen_temp(file_name, 1024);
6062 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6064 msg_format("Failed to create temporary file %s.", file_name);
6070 if(p_ptr->realm1 != REALM_NONE)
6073 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6075 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6077 for (i = 0; i < 32; i++)
6079 if (!is_magic(p_ptr->realm1))
6081 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6085 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6087 if(s_ptr->slevel == 99) continue;
6088 if(p_ptr->spell_exp[i]<900) shougou=0;
6089 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6090 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6091 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6093 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6094 if (p_ptr->realm1 == REALM_HISSATSU)
6095 fprintf(fff,"[--]");
6098 if (shougou == 4) fprintf(fff,"!");
6099 else fprintf(fff," ");
6100 fprintf(fff,"%s",shougou_moji[shougou]);
6102 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6107 if(p_ptr->realm2 != REALM_NONE)
6109 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6110 for (i = 0; i < 32; i++)
6112 if (!is_magic(p_ptr->realm1))
6114 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6118 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6120 if(s_ptr->slevel == 99) continue;
6122 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6123 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6124 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6126 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6127 if (shougou == 3) fprintf(fff,"!");
6128 else fprintf(fff," ");
6129 fprintf(fff,"%s",shougou_moji[shougou]);
6130 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6135 /* Close the file */
6138 /* Display the file contents */
6140 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6142 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6146 /* Remove the file */
6154 static void do_cmd_knowledge_skill_exp(void)
6160 char file_name[1024];
6162 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6164 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6167 /* Open a new file */
6168 fff = my_fopen_temp(file_name, 1024);
6171 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6173 msg_format("Failed to create temporary file %s.", file_name);
6179 for (i = 0; i < 3; i++)
6181 if(i == GINOU_RIDING)
6183 if(p_ptr->skill_exp[i]<500) shougou=0;
6184 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6185 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6186 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6191 if(p_ptr->skill_exp[i]<4000) shougou=0;
6192 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6193 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6194 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6197 fprintf(fff,"%-20s ",skill_name[i]);
6198 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6199 else fprintf(fff," ");
6200 fprintf(fff,"%s",shougou_moji[shougou]);
6201 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6205 /* Close the file */
6208 /* Display the file contents */
6210 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6212 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6216 /* Remove the file */
6222 * Pluralize a monster name
6224 void plural_aux(char *Name)
6226 int NameLen = strlen(Name);
6228 if (strstr(Name, "Disembodied hand"))
6230 strcpy(Name, "Disembodied hands that strangled people");
6232 else if (strstr(Name, "Colour out of space"))
6234 strcpy(Name, "Colours out of space");
6236 else if (strstr(Name, "stairway to hell"))
6238 strcpy(Name, "stairways to hell");
6240 else if (strstr(Name, "Dweller on the threshold"))
6242 strcpy(Name, "Dwellers on the threshold");
6244 else if (strstr(Name, " of "))
6246 cptr aider = strstr(Name, " of ");
6257 if (dummy[i-1] == 's')
6259 strcpy(&(dummy[i]), "es");
6264 strcpy(&(dummy[i]), "s");
6267 strcpy(&(dummy[i+1]), aider);
6268 strcpy(Name, dummy);
6270 else if (strstr(Name, "coins"))
6273 strcpy(dummy, "piles of ");
6274 strcat(dummy, Name);
6275 strcpy(Name, dummy);
6278 else if (strstr(Name, "Manes"))
6282 else if (streq(&(Name[NameLen - 2]), "ey"))
6284 strcpy(&(Name[NameLen - 2]), "eys");
6286 else if (Name[NameLen - 1] == 'y')
6288 strcpy(&(Name[NameLen - 1]), "ies");
6290 else if (streq(&(Name[NameLen - 4]), "ouse"))
6292 strcpy(&(Name[NameLen - 4]), "ice");
6294 else if (streq(&(Name[NameLen - 2]), "us"))
6296 strcpy(&(Name[NameLen - 2]), "i");
6298 else if (streq(&(Name[NameLen - 6]), "kelman"))
6300 strcpy(&(Name[NameLen - 6]), "kelmen");
6302 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6304 strcpy(&(Name[NameLen - 8]), "wordsmen");
6306 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6308 strcpy(&(Name[NameLen - 7]), "oodsmen");
6310 else if (streq(&(Name[NameLen - 7]), "eastman"))
6312 strcpy(&(Name[NameLen - 7]), "eastmen");
6314 else if (streq(&(Name[NameLen - 8]), "izardman"))
6316 strcpy(&(Name[NameLen - 8]), "izardmen");
6318 else if (streq(&(Name[NameLen - 5]), "geist"))
6320 strcpy(&(Name[NameLen - 5]), "geister");
6322 else if (streq(&(Name[NameLen - 2]), "ex"))
6324 strcpy(&(Name[NameLen - 2]), "ices");
6326 else if (streq(&(Name[NameLen - 2]), "lf"))
6328 strcpy(&(Name[NameLen - 2]), "lves");
6330 else if (suffix(Name, "ch") ||
6331 suffix(Name, "sh") ||
6332 suffix(Name, "nx") ||
6333 suffix(Name, "s") ||
6336 strcpy(&(Name[NameLen]), "es");
6340 strcpy(&(Name[NameLen]), "s");
6345 * Display current pets
6347 static void do_cmd_knowledge_pets(void)
6351 monster_type *m_ptr;
6353 int show_upkeep = 0;
6354 char file_name[1024];
6357 /* Open a new file */
6358 fff = my_fopen_temp(file_name, 1024);
6361 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6363 msg_format("Failed to create temporary file %s.", file_name);
6369 /* Process the monsters (backwards) */
6370 for (i = m_max - 1; i >= 1; i--)
6372 monster_race *r_ptr;
6373 /* Access the monster */
6376 /* Ignore "dead" monsters */
6377 if (!m_ptr->r_idx) continue;
6378 r_ptr = &r_info[m_ptr->r_idx];
6380 /* Calculate "upkeep" for pets */
6385 monster_desc(pet_name, m_ptr, 0x88);
6386 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6387 if (p_ptr->riding == i)
6389 fprintf(fff, " ¾èÇÏÃæ");
6391 fprintf(fff, " Riding");
6397 show_upkeep = calculate_upkeep();
6399 fprintf(fff, "----------------------------------------------\n");
6401 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6402 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6404 fprintf(fff, " Total: %d pet%s.\n",
6405 t_friends, (t_friends == 1 ? "" : "s"));
6406 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6411 /* Close the file */
6414 /* Display the file contents */
6416 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6418 show_file(TRUE, file_name, "Current Pets", 0, 0);
6422 /* Remove the file */
6430 * Note that the player ghosts are ignored. XXX XXX XXX
6432 static void do_cmd_knowledge_kill_count(void)
6440 char file_name[1024];
6445 /* Open a new file */
6446 fff = my_fopen_temp(file_name, 1024);
6450 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6452 msg_format("Failed to create temporary file %s.", file_name);
6458 /* Allocate the "who" array */
6459 C_MAKE(who, max_r_idx, s16b);
6462 /* Monsters slain */
6465 for (kk = 1; kk < max_r_idx; kk++)
6467 monster_race *r_ptr = &r_info[kk];
6469 if (r_ptr->flags1 & (RF1_UNIQUE))
6471 bool dead = (r_ptr->max_num == 0);
6480 s16b This = r_ptr->r_pkills;
6491 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6493 fprintf(fff,"You have defeated no enemies yet.\n\n");
6496 else if (Total == 1)
6498 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6500 fprintf(fff,"You have defeated one enemy.\n\n");
6505 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6507 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6514 /* Scan the monsters */
6515 for (i = 1; i < max_r_idx; i++)
6517 monster_race *r_ptr = &r_info[i];
6519 /* Use that monster */
6520 if (r_ptr->name) who[n++] = i;
6523 /* Select the sort method */
6524 ang_sort_comp = ang_sort_comp_hook;
6525 ang_sort_swap = ang_sort_swap_hook;
6527 /* Sort the array by dungeon depth of monsters */
6528 ang_sort(who, &why, n);
6530 /* Scan the monster races */
6531 for (k = 0; k < n; k++)
6533 monster_race *r_ptr = &r_info[who[k]];
6535 if (r_ptr->flags1 & (RF1_UNIQUE))
6537 bool dead = (r_ptr->max_num == 0);
6541 /* Print a message */
6542 fprintf(fff, " %s\n",
6543 (r_name + r_ptr->name));
6549 s16b This = r_ptr->r_pkills;
6554 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6555 if(strchr("pt",r_ptr->d_char))
6556 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6558 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6562 if (strstr(r_name + r_ptr->name, "coins"))
6564 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6568 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6574 strcpy(ToPlural, (r_name + r_ptr->name));
6575 plural_aux(ToPlural);
6576 fprintf(fff, " %d %s\n", This, ToPlural);
6586 fprintf(fff,"----------------------------------------------\n");
6588 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6590 fprintf(fff," Total: %lu creature%s killed.\n",
6591 Total, (Total == 1 ? "" : "s"));
6595 /* Free the "who" array */
6596 C_KILL(who, max_r_idx, s16b);
6598 /* Close the file */
6601 /* Display the file contents */
6603 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6605 show_file(TRUE, file_name, "Kill Count", 0, 0);
6609 /* Remove the file */
6615 * Display known objects
6617 static void do_cmd_knowledge_objects(void)
6623 char o_name[MAX_NLEN];
6625 char file_name[1024];
6628 /* Open a new file */
6629 fff = my_fopen_temp(file_name, 1024);
6632 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6634 msg_format("Failed to create temporary file %s.", file_name);
6640 /* Scan the object kinds */
6641 for (k = 1; k < max_k_idx; k++)
6643 object_kind *k_ptr = &k_info[k];
6645 /* Hack -- skip artifacts */
6646 if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
6648 /* List known flavored objects */
6649 if (k_ptr->flavor && k_ptr->aware)
6652 object_type object_type_body;
6654 /* Get local object */
6655 i_ptr = &object_type_body;
6657 /* Create fake object */
6658 object_prep(i_ptr, k);
6660 /* Describe the object */
6661 object_desc_store(o_name, i_ptr, FALSE, 0);
6663 /* Print a message */
6664 fprintf(fff, " %s\n", o_name);
6668 /* Close the file */
6671 /* Display the file contents */
6673 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6675 show_file(TRUE, file_name, "Known Objects", 0, 0);
6679 /* Remove the file */
6685 * List virtues & status
6688 static void do_cmd_knowledge_kubi(void)
6693 char file_name[1024];
6696 /* Open a new file */
6697 fff = my_fopen_temp(file_name, 1024);
6700 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6702 msg_format("Failed to create temporary file %s.", file_name);
6711 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6713 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6715 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6717 fprintf(fff, "List of wanted monsters\n");
6719 for (i = 0; i < MAX_KUBI; i++)
6721 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6722 if (kubi_r_idx[i] > 10000)
6724 fprintf(fff, "ºÑ\n");
6726 fprintf(fff, "done\n");
6729 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6733 /* Close the file */
6736 /* Display the file contents */
6738 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6740 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6744 /* Remove the file */
6749 * List virtues & status
6752 static void do_cmd_knowledge_virtues(void)
6756 char file_name[1024];
6759 /* Open a new file */
6760 fff = my_fopen_temp(file_name, 1024);
6763 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6765 msg_format("Failed to create temporary file %s.", file_name);
6774 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6776 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6781 /* Close the file */
6784 /* Display the file contents */
6786 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6788 show_file(TRUE, file_name, "Virtues", 0, 0);
6792 /* Remove the file */
6800 static void do_cmd_knowledge_dungeon(void)
6804 char file_name[1024];
6808 /* Open a new file */
6809 fff = my_fopen_temp(file_name, 1024);
6812 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6814 msg_format("Failed to create temporary file %s.", file_name);
6822 for (i = 1; i < max_d_idx; i++)
6826 if (!d_info[i].maxdepth) continue;
6827 if (!max_dlv[i]) continue;
6828 if (d_info[i].final_guardian)
6830 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6832 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6834 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6836 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6841 /* Close the file */
6844 /* Display the file contents */
6846 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6848 show_file(TRUE, file_name, "Dungeon", 0, 0);
6852 /* Remove the file */
6857 * List virtues & status
6860 static void do_cmd_knowledge_stat(void)
6864 char file_name[1024];
6867 /* Open a new file */
6868 fff = my_fopen_temp(file_name, 1024);
6871 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6873 msg_format("Failed to create temporary file %s.", file_name);
6881 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
6882 (2 * p_ptr->hitdie +
6883 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6886 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6887 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6888 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6890 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6891 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6892 fprintf(fff, "Limits of maximum stats\n\n");
6894 for (v_nr = 0; v_nr < 6; v_nr++)
6896 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);
6897 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6903 /* Close the file */
6906 /* Display the file contents */
6908 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6910 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6914 /* Remove the file */
6919 * Print quest status of all active quests
6921 static void do_cmd_knowledge_quests(void)
6924 char file_name[1024];
6926 char rand_tmp_str[120] = "\0";
6928 monster_race *r_ptr;
6930 int rand_level = 100;
6933 /* Open a new file */
6934 fff = my_fopen_temp(file_name, 1024);
6937 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6939 msg_format("Failed to create temporary file %s.", file_name);
6946 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6948 fprintf(fff, "< Current Quest >\n");
6951 for (i = 1; i < max_quests; i++)
6953 /* No info from "silent" quests */
6954 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6956 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6961 /* Clear the text */
6962 for (j = 0; j < 10; j++)
6964 quest_text[j][0] = '\0';
6967 quest_text_line = 0;
6971 /* Set the quest number temporary */
6972 old_quest = p_ptr->inside_quest;
6973 p_ptr->inside_quest = i;
6975 /* Get the quest text */
6976 init_flags = INIT_SHOW_TEXT;
6978 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6980 /* Reset the old quest number */
6981 p_ptr->inside_quest = old_quest;
6983 if (quest[i].type != QUEST_TYPE_RANDOM)
6985 char note[80] = "\0";
6987 if (quest[i].status == QUEST_STATUS_TAKEN)
6989 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6991 r_ptr = &r_info[quest[i].r_idx];
6992 strcpy(name, r_name + r_ptr->name);
6993 if (quest[i].max_num > 1)
6996 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6999 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
7004 sprintf(note," - %s¤òÅݤ¹¡£",name);
7006 sprintf(note," - kill %s.",name);
7009 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
7012 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
7014 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
7017 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
7019 strcpy(name, a_name + a_info[quest[i].k_idx].name);
7021 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
7023 sprintf(note," - Find out %s.", name);
7026 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
7028 sprintf(note," - õº÷¤¹¤ë¡£");
7030 sprintf(note," - Search.");
7032 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
7034 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
7036 sprintf(note," - Kill all monsters.");
7040 /* Print the quest info */
7042 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
7044 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
7047 quest[i].name, quest[i].level, note);
7049 fprintf(fff, tmp_str);
7051 if (quest[i].status == QUEST_STATUS_COMPLETED)
7054 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
7056 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
7060 fprintf(fff, tmp_str);
7066 while (quest_text[j][0] && j < 10)
7068 fprintf(fff, " %s\n", quest_text[j]);
7073 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
7074 (quest[i].level < rand_level))
7077 rand_level = quest[i].level;
7079 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
7081 /* Print the quest info */
7082 r_ptr = &r_info[quest[i].r_idx];
7083 strcpy(name, r_name + r_ptr->name);
7085 if (quest[i].max_num > 1)
7088 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
7089 quest[i].name, quest[i].level,
7090 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7094 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
7095 quest[i].name, quest[i].level,
7096 quest[i].max_num, name, quest[i].cur_num);
7103 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
7105 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
7108 quest[i].name, quest[i].level, name);
7115 /* Print the current random quest */
7116 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
7119 if (!total) fprintf(fff, "¤Ê¤·\n");
7121 if (!total) fprintf(fff, "Nothing.\n");
7125 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7127 fprintf(fff, "\n< Completed Quest >\n");
7130 for (i = 1; i < max_quests; i++)
7132 /* No info from "silent" quests */
7133 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7135 if (quest[i].status == QUEST_STATUS_FINISHED)
7141 if (i < MIN_RANDOM_QUEST)
7143 /* Set the quest number temporary */
7144 old_quest = p_ptr->inside_quest;
7145 p_ptr->inside_quest = i;
7148 init_flags = INIT_ASSIGN;
7150 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7152 /* Reset the old quest number */
7153 p_ptr->inside_quest = old_quest;
7156 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7158 /* Print the quest info */
7160 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7162 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7165 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7169 /* Print the quest info */
7171 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7173 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7176 quest[i].name, quest[i].level, quest[i].complev);
7179 fprintf(fff, tmp_str);
7183 if (!total) fprintf(fff, "¤Ê¤·\n");
7185 if (!total) fprintf(fff, "Nothing.\n");
7189 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7191 fprintf(fff, "\n< Failed Quest >\n");
7194 for (i = 1; i < max_quests; i++)
7196 /* No info from "silent" quests */
7197 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7199 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7205 if (i < MIN_RANDOM_QUEST)
7207 /* Set the quest number temporary */
7208 old_quest = p_ptr->inside_quest;
7209 p_ptr->inside_quest = i;
7211 /* Get the quest text */
7212 init_flags = INIT_ASSIGN;
7214 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7216 /* Reset the old quest number */
7217 p_ptr->inside_quest = old_quest;
7220 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7222 /* Print the quest info */
7224 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7226 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7229 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7233 /* Print the quest info */
7235 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7237 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7240 quest[i].name, quest[i].level, quest[i].complev);
7242 fprintf(fff, tmp_str);
7246 if (!total) fprintf(fff, "¤Ê¤·\n");
7248 if (!total) fprintf(fff, "Nothing.\n");
7251 if (p_ptr->wizard) {
7253 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7255 fprintf(fff, "\n< Remaining Random Quest >\n");
7258 for (i = 1; i < max_quests; i++)
7260 /* No info from "silent" quests */
7261 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7263 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7267 /* Print the quest info */
7269 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7271 sprintf(tmp_str, "%s (%d, %s)\n",
7274 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7275 fprintf(fff, tmp_str);
7279 if (!total) fprintf(fff, "¤Ê¤·\n");
7281 if (!total) fprintf(fff, "Nothing.\n");
7285 /* Close the file */
7288 /* Display the file contents */
7290 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7292 show_file(TRUE, file_name, "Quest status", 0, 0);
7296 /* Remove the file */
7306 static void do_cmd_knowledge_home(void)
7311 char file_name[1024];
7313 char o_name[MAX_NLEN];
7316 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7318 /* Open a new file */
7319 fff = my_fopen_temp(file_name, 1024);
7322 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7324 msg_format("Failed to create temporary file %s.", file_name);
7332 /* Print all homes in the different towns */
7333 st_ptr = &town[1].store[STORE_HOME];
7335 /* Home -- if anything there */
7336 if (st_ptr->stock_num)
7338 /* Header with name of the town */
7340 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7342 fprintf(fff, " [Home Inventory]\n");
7346 /* Dump all available items */
7347 for (i = 0; i < st_ptr->stock_num; i++)
7350 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7351 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7352 if (strlen(o_name) <= 80-3)
7354 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7360 for (n = 0, t = o_name; n < 80-3; n++, t++)
7361 if(iskanji(*t)) {t++; n++;}
7362 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7364 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7365 fprintf(fff, " %.77s\n", o_name+n);
7368 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7369 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7374 /* Add an empty line */
7375 fprintf(fff, "\n\n");
7379 /* Close the file */
7382 /* Display the file contents */
7384 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7386 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7390 /* Remove the file */
7396 * Check the status of "autopick"
7398 static void do_cmd_knowledge_autopick(void)
7402 char file_name[1024];
7404 /* Open a new file */
7405 fff = my_fopen_temp(file_name, 1024);
7410 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7412 msg_format("Failed to create temporary file %s.", file_name);
7421 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7423 fprintf(fff, "No preference for auto picker/destroyer.");
7429 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7431 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7435 for (k = 0; k < max_autopick; k++)
7438 byte act = autopick_list[k].action;
7439 if (act & DONT_AUTOPICK)
7447 else if (act & DO_AUTODESTROY)
7464 if (act & DO_DISPLAY)
7465 fprintf(fff, "%11s", format("[%s]", tmp));
7467 fprintf(fff, "%11s", format("(%s)", tmp));
7469 tmp = autopick_line_from_entry(&autopick_list[k]);
7470 fprintf(fff, " %s", tmp);
7474 /* Close the file */
7476 /* Display the file contents */
7478 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7480 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7483 /* Remove the file */
7489 * Interact with "knowledge"
7491 void do_cmd_knowledge(void)
7494 /* File type is "TEXT" */
7495 FILE_TYPE(FILE_TYPE_TEXT);
7496 /* Save the screen */
7498 /* Interact until done */
7503 /* Ask for a choice */
7505 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7506 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7508 prt(format("page %d/2", (p+1)), 2, 65);
7509 prt("Display current knowledge", 3, 0);
7512 /* Give some choices */
7515 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7516 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7517 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7518 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7519 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7520 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7521 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7522 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7523 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7525 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7526 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7527 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7528 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7529 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7530 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7531 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7532 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7533 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7537 prt("(1) Display known artifacts", 6, 5);
7538 prt("(2) Display known objects", 7, 5);
7539 prt("(3) Display remaining uniques", 8, 5);
7540 prt("(4) Display dead uniques", 9, 5);
7541 prt("(5) Display kill count", 10, 5);
7542 prt("(6) Display wanted monsters", 11, 5);
7543 prt("(7) Display current pets", 12, 5);
7544 prt("(8) Display home inventory", 13, 5);
7545 prt("(9) Display *identified* equip.", 14, 5);
7547 prt("(a) Display about yourself", 6, 5);
7548 prt("(b) Display mutations", 7, 5);
7549 prt("(c) Display weapon proficiency", 8, 5);
7550 prt("(d) Display spell proficiency", 9, 5);
7551 prt("(e) Display misc. proficiency", 10, 5);
7552 prt("(f) Display virtues", 11, 5);
7553 prt("(g) Display dungeons", 12, 5);
7554 prt("(h) Display current quests", 13, 5);
7555 prt("(i) Display auto pick/destroy", 14, 5);
7560 prt("-³¤¯-", 16, 8);
7561 prt("ESC) È´¤±¤ë", 21, 1);
7562 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7563 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7564 prt("¥³¥Þ¥ó¥É:", 20, 0);
7566 prt("-more-", 16, 8);
7567 prt("ESC) Exit menu", 21, 1);
7568 prt("SPACE) Next page", 21, 30);
7569 /*prt("-) Previous page", 21, 60);*/
7570 prt("Command: ", 20, 0);
7576 if (i == ESCAPE) break;
7579 case ' ': /* Page change */
7583 case '1': /* Artifacts */
7584 do_cmd_knowledge_artifacts();
7586 case '2': /* Objects */
7587 do_cmd_knowledge_objects();
7589 case '3': /* Uniques */
7590 do_cmd_knowledge_uniques();
7592 case '4': /* Uniques */
7593 do_cmd_knowledge_uniques_dead();
7595 case '5': /* Kill count */
7596 do_cmd_knowledge_kill_count();
7598 case '6': /* wanted */
7599 do_cmd_knowledge_kubi();
7601 case '7': /* Pets */
7602 do_cmd_knowledge_pets();
7604 case '8': /* Home */
7605 do_cmd_knowledge_home();
7607 case '9': /* Resist list */
7608 do_cmd_knowledge_inven();
7611 case 'a': /* Max stat */
7612 do_cmd_knowledge_stat();
7614 case 'b': /* Mutations */
7615 do_cmd_knowledge_mutations();
7617 case 'c': /* weapon-exp */
7618 do_cmd_knowledge_weapon_exp();
7620 case 'd': /* spell-exp */
7621 do_cmd_knowledge_spell_exp();
7623 case 'e': /* skill-exp */
7624 do_cmd_knowledge_skill_exp();
7626 case 'f': /* Virtues */
7627 do_cmd_knowledge_virtues();
7629 case 'g': /* Dungeon */
7630 do_cmd_knowledge_dungeon();
7632 case 'h': /* Quests */
7633 do_cmd_knowledge_quests();
7635 case 'i': /* Autopick */
7636 do_cmd_knowledge_autopick();
7638 default: /* Unknown option */
7641 /* Flush messages */
7644 /* Restore the screen */
7650 * Check on the status of an active quest
7652 void do_cmd_checkquest(void)
7654 /* File type is "TEXT" */
7655 FILE_TYPE(FILE_TYPE_TEXT);
7657 /* Save the screen */
7661 do_cmd_knowledge_quests();
7663 /* Restore the screen */
7669 * Display the time and date
7671 void do_cmd_time(void)
7673 int day, hour, min, full, start, end, num;
7680 extract_day_hour_min(&day, &hour, &min);
7682 full = hour * 100 + min;
7690 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7692 strcpy(desc, "It is a strange time.");
7698 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7700 msg_format("This is day %d. The time is %d:%02d %s.",
7703 day, (hour % 12 == 0) ? 12 : (hour % 12),
7704 min, (hour < 12) ? "AM" : "PM");
7707 if (!randint0(10) || p_ptr->image)
7710 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7712 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7719 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7721 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7726 /* Open this file */
7727 fff = my_fopen(buf, "rt");
7732 /* Find this time */
7733 while (!my_fgets(fff, buf, 1024))
7735 /* Ignore comments */
7736 if (!buf[0] || (buf[0] == '#')) continue;
7738 /* Ignore invalid lines */
7739 if (buf[1] != ':') continue;
7741 /* Process 'Start' */
7744 /* Extract the starting time */
7745 start = atoi(buf + 2);
7747 /* Assume valid for an hour */
7757 /* Extract the ending time */
7758 end = atoi(buf + 2);
7764 /* Ignore incorrect range */
7765 if ((start > full) || (full > end)) continue;
7767 /* Process 'Description' */
7772 /* Apply the randomizer */
7773 if (!randint0(num)) strcpy(desc, buf + 2);
7783 /* Close the file */