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, sizeof(buf)))
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, sizeof(buf)))
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, sizeof(buf), 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);
597 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
599 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
603 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Ñ¥¿¡¼¥ó¤ÎÎϤǰÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
605 fprintf(fff, " %2d:%02d %20s use Pattern to teleport to %s.\n", hour, min, note_level, to);
612 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
614 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
618 case NIKKI_GAMESTART:
620 time_t ct = time((time_t*)0);
624 fprintf(fff, "%s %s",note, ctime(&ct));
627 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
630 case NIKKI_NAMED_PET:
632 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
637 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
639 fprintf(fff, "decide to travel together with %s.\n", note);
644 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
646 fprintf(fff, "unname %s.\n", note);
651 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
653 fprintf(fff, "dismiss %s.\n", note);
658 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
660 fprintf(fff, "%s die.\n", note);
665 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
667 fprintf(fff, "move to other map leaving %s behind.\n", note);
672 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
674 fprintf(fff, "lose sight of %s.\n", note);
679 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
681 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
686 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
688 fprintf(fff, "%s is crushed by falling rocks.\n", note);
703 /* Hack -- grab permissions */
706 if (do_level) write_level = FALSE;
712 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
714 static void do_cmd_disp_nikki(void)
716 char nikki_title[256];
721 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
722 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
733 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
734 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
735 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
736 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
741 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
750 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
752 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
753 "Attack is the best form of defence.",
755 "An unexpected windfall",
756 "A drowning man will catch at a straw",
757 "Don't count your chickens before they are hatched.",
758 "It is no use crying over spilt milk.",
759 "Seeing is believing.",
760 "Strike the iron while it is hot.",
761 "I don't care what follows.",
762 "To dig a well to put out a house on fire.",
763 "Tomorrow is another day.",
764 "Easy come, easy go.",
765 "The more haste, the less speed.",
766 "Where there is life, there is hope.",
767 "There is no royal road to *WINNER*.",
768 "Danger past, God forgotten.",
769 "The best thing to do now is to run away.",
770 "Life is but an empty dream.",
771 "Dead men tell no tales.",
772 "A book that remains shut is but a block.",
773 "Misfortunes never come singly.",
774 "A little knowledge is a dangerous thing.",
775 "History repeats itself.",
776 "*WINNER* was not built in a day.",
777 "Ignorance is bliss.",
778 "To lose is to win?",
779 "No medicine can cure folly.",
780 "All good things come to an end.",
781 "M$ Empire strikes back.",
782 "To see is to believe",
784 "Quest of The World's Greatest Brain"};
787 sprintf(file_name,"playrecord-%s.txt",savefile_base);
789 sprintf(file_name,"playrec-%s.txt",savefile_base);
792 /* Hack -- drop permissions */
795 /* Build the filename */
796 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
798 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
799 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
800 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
801 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
802 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
805 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
806 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
808 sprintf(nikki_title, "Legend of %s %s '%s'",
809 ap_ptr->title, player_name, tmp);
812 /* Display the file contents */
813 show_file(FALSE, buf, nikki_title, -1, 0);
815 /* Hack -- grab permissions */
819 static void do_cmd_bunshou(void)
822 char bunshou[80] = "\0";
825 if (get_string("ÆâÍÆ: ", tmp, 79))
827 if (get_string("diary note: ", tmp, 79))
830 strcpy(bunshou, tmp);
832 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
836 static void do_cmd_last_get(void)
841 if (record_o_name[0] == '\0') return;
844 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
846 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
848 if (!get_check(buf)) return;
853 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
855 sprintf(buf,"descover %s.", record_o_name);
857 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
861 static void do_cmd_erase_nikki(void)
868 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
870 if (!get_check("Do you really want to delete all your record? ")) return;
874 sprintf(file_name,"playrecord-%s.txt",savefile_base);
876 sprintf(file_name,"playrec-%s.txt",savefile_base);
879 /* Hack -- drop permissions */
882 /* Build the filename */
883 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
885 /* Remove the file */
888 fff = my_fopen(buf, "w");
892 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
894 msg_format("deleted record.");
898 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
900 msg_format("failed to delete %s.", buf);
905 /* Hack -- grab permissions */
912 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
918 void do_cmd_nikki(void)
922 /* File type is "TEXT" */
923 FILE_TYPE(FILE_TYPE_TEXT);
925 /* Save the screen */
928 /* Interact until done */
934 /* Ask for a choice */
936 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
938 prt("[ Play Record ]", 2, 0);
942 /* Give some choices */
944 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
945 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
946 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
947 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
949 prt("(1) Display your record", 4, 5);
950 prt("(2) Add record", 5, 5);
951 prt("(3) Record item you last get/identify", 6, 5);
952 prt("(4) Delete your record", 7, 5);
958 prt("¥³¥Þ¥ó¥É:", 18, 0);
960 prt("Command: ", 18, 0);
968 if (i == ESCAPE) break;
982 do_cmd_erase_nikki();
989 default: /* Unknown option */
997 /* Restore the screen */
1002 * Hack -- redraw the screen
1004 * This command performs various low level updates, clears all the "extra"
1005 * windows, does a total redraw of the main window, and requests all of the
1006 * interesting updates and redraws that I can think of.
1008 * This command is also used to "instantiate" the results of the user
1009 * selecting various things, such as graphics mode, so it must call
1010 * the "TERM_XTRA_REACT" hook before redrawing the windows.
1012 void do_cmd_redraw(void)
1019 /* Hack -- react to changes */
1020 Term_xtra(TERM_XTRA_REACT, 0);
1023 /* Combine and Reorder the pack (later) */
1024 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1028 p_ptr->update |= (PU_TORCH);
1031 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1033 /* Forget lite/view */
1034 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1036 /* Update lite/view */
1037 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1039 /* Update monsters */
1040 p_ptr->update |= (PU_MONSTERS);
1042 /* Redraw everything */
1043 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1046 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1049 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1053 /* Hack -- update */
1056 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1059 /* Redraw every window */
1060 for (j = 0; j < 8; j++)
1063 if (!angband_term[j]) continue;
1066 Term_activate(angband_term[j]);
1081 * Hack -- change name
1083 void do_cmd_change_name(void)
1092 /* Save the screen */
1100 /* Display the player */
1101 display_player(mode);
1106 display_player(mode);
1111 Term_putstr(2, 23, -1, TERM_WHITE,
1112 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1114 Term_putstr(2, 23, -1, TERM_WHITE,
1115 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1123 if (c == ESCAPE) break;
1134 sprintf(tmp, "%s.txt", player_base);
1136 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1138 if (get_string("File name: ", tmp, 80))
1142 if (tmp[0] && (tmp[0] != ' '))
1144 file_character(tmp, TRUE);
1161 /* Flush messages */
1165 /* Restore the screen */
1168 /* Redraw everything */
1169 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1176 * Recall the most recent message
1178 void do_cmd_message_one(void)
1180 /* Recall one message XXX XXX XXX */
1181 prt(format("> %s", message_str(0)), 0, 0);
1186 * Show previous messages to the user -BEN-
1188 * The screen format uses line 0 and 23 for headers and prompts,
1189 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1191 * This command shows you which commands you are viewing, and allows
1192 * you to "search" for strings in the recall.
1194 * Note that messages may be longer than 80 characters, but they are
1195 * displayed using "infinite" length, with a special sub-command to
1196 * "slide" the virtual display to the left or right.
1198 * Attempt to only hilite the matching portions of the string.
1200 void do_cmd_messages(int num_now)
1211 Term_get_size(&wid, &hgt);
1220 /* Total messages */
1223 /* Start on first message */
1226 /* Start at leftmost edge */
1229 /* Save the screen */
1232 /* Process requests until done */
1238 /* Dump up to 20 lines of messages */
1239 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1241 cptr msg = message_str(i+j);
1243 /* Apply horizontal scroll */
1244 msg = (strlen(msg) >= q) ? (msg + q) : "";
1246 /* Dump the messages, bottom to top */
1247 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1249 /* Hilite "shower" */
1254 /* Display matches */
1255 while ((str = strstr(str, shower)) != NULL)
1257 int len = strlen(shower);
1259 /* Display the match */
1260 Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
1268 /* Display header XXX XXX XXX */
1271 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1272 i, i+j-1, n, q), 0, 0);
1274 prt(format("Message Recall (%d-%d of %d), Offset %d",
1275 i, i+j-1, n, q), 0, 0);
1279 /* Display prompt (not very informative) */
1281 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1283 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1290 /* Exit on Escape */
1291 if (k == ESCAPE) break;
1293 /* Hack -- Save the old index */
1296 /* Horizontal scroll */
1300 q = (q >= 40) ? (q - 40) : 0;
1306 /* Horizontal scroll */
1316 /* Hack -- handle show */
1321 prt("¶¯Ä´: ", hgt - 1, 0);
1323 prt("Show: ", hgt - 1, 0);
1327 /* Get a "shower" string, or continue */
1328 if (!askfor_aux(shower, 80)) continue;
1334 /* Hack -- handle find */
1341 prt("¸¡º÷: ", hgt - 1, 0);
1343 prt("Find: ", hgt - 1, 0);
1347 /* Get a "finder" string, or continue */
1348 if (!askfor_aux(finder, 80)) continue;
1351 strcpy(shower, finder);
1354 for (z = i + 1; z < n; z++)
1356 cptr msg = message_str(z);
1359 if (strstr(msg, finder))
1370 /* Recall 1 older message */
1371 if ((k == '8') || (k == '\n') || (k == '\r'))
1373 /* Go newer if legal */
1374 if (i + 1 < n) i += 1;
1377 /* Recall 10 older messages */
1380 /* Go older if legal */
1381 if (i + 10 < n) i += 10;
1384 /* Recall 20 older messages */
1385 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1387 /* Go older if legal */
1388 if (i + 20 < n) i += 20;
1391 /* Recall 20 newer messages */
1392 if ((k == 'n') || (k == KTRL('N')))
1394 /* Go newer (if able) */
1395 i = (i >= 20) ? (i - 20) : 0;
1398 /* Recall 10 newer messages */
1401 /* Go newer (if able) */
1402 i = (i >= 20) ? (i - 20) : 0;
1405 /* Recall 1 newer messages */
1408 /* Go newer (if able) */
1409 i = (i >= 1) ? (i - 1) : 0;
1412 /* Hack -- Error of some kind */
1416 /* Restore the screen */
1423 * Number of cheating options
1430 static option_type cheat_info[CHEAT_MAX] =
1432 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1434 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1436 "cheat_peek", "Peek into object creation" },
1440 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1442 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1444 "cheat_hear", "Peek into monster creation" },
1448 { &cheat_room, FALSE, 255, 0x04, 0x00,
1450 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1452 "cheat_room", "Peek into dungeon creation" },
1456 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1458 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1460 "cheat_xtra", "Peek into something else" },
1464 { &cheat_know, FALSE, 255, 0x10, 0x00,
1466 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1468 "cheat_know", "Know complete monster info" },
1472 { &cheat_live, FALSE, 255, 0x20, 0x00,
1474 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1476 "cheat_live", "Allow player to avoid death" }
1482 * Interact with some options for cheating
1484 static void do_cmd_options_cheat(cptr info)
1488 int i, k = 0, n = CHEAT_MAX;
1496 /* Interact with the player */
1501 /* Prompt XXX XXX XXX */
1503 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1505 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1511 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1512 prt(" << Ãí°Õ >>", 11, 0);
1513 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1514 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1515 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1517 /* Display the options */
1518 for (i = 0; i < n; i++)
1520 byte a = TERM_WHITE;
1522 /* Color current option */
1523 if (i == k) a = TERM_L_BLUE;
1525 /* Display the option text */
1526 sprintf(buf, "%-48s: %s (%s)",
1527 cheat_info[i].o_desc,
1529 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1531 (*cheat_info[i].o_var ? "yes" : "no "),
1534 cheat_info[i].o_text);
1535 c_prt(a, buf, i + 2, 0);
1538 /* Hilite current option */
1539 move_cursor(k + 2, 50);
1545 * HACK - Try to translate the key into a direction
1546 * to allow using the roguelike keys for navigation.
1548 dir = get_keymap_dir(ch);
1549 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1563 k = (n + k - 1) % n;
1582 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1584 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1586 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1587 (*cheat_info[k].o_var) = TRUE;
1596 (*cheat_info[k].o_var) = FALSE;
1611 static option_type autosave_info[2] =
1613 { &autosave_l, FALSE, 255, 0x01, 0x00,
1615 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1617 "autosave_l", "Autosave when entering new levels" },
1621 { &autosave_t, FALSE, 255, 0x02, 0x00,
1623 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1625 "autosave_t", "Timed autosave" },
1631 static s16b toggle_frequency(s16b current)
1633 if (current == 0) return 50;
1634 if (current == 50) return 100;
1635 if (current == 100) return 250;
1636 if (current == 250) return 500;
1637 if (current == 500) return 1000;
1638 if (current == 1000) return 2500;
1639 if (current == 2500) return 5000;
1640 if (current == 5000) return 10000;
1641 if (current == 10000) return 25000;
1648 * Interact with some options for cheating
1650 static void do_cmd_options_autosave(cptr info)
1654 int i, k = 0, n = 2;
1662 /* Interact with the player */
1665 /* Prompt XXX XXX XXX */
1667 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1669 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1674 /* Display the options */
1675 for (i = 0; i < n; i++)
1677 byte a = TERM_WHITE;
1679 /* Color current option */
1680 if (i == k) a = TERM_L_BLUE;
1682 /* Display the option text */
1683 sprintf(buf, "%-48s: %s (%s)",
1684 autosave_info[i].o_desc,
1686 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1688 (*autosave_info[i].o_var ? "yes" : "no "),
1691 autosave_info[i].o_text);
1692 c_prt(a, buf, i + 2, 0);
1696 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1698 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1703 /* Hilite current option */
1704 move_cursor(k + 2, 50);
1720 k = (n + k - 1) % n;
1738 (*autosave_info[k].o_var) = TRUE;
1747 (*autosave_info[k].o_var) = FALSE;
1755 autosave_freq = toggle_frequency(autosave_freq);
1757 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1759 prt(format("Timed autosave frequency: every %d turns",
1762 autosave_freq), 5, 0);
1775 #define PAGE_AUTODESTROY 7
1778 * Interact with some options
1780 void do_cmd_options_aux(int page, cptr info)
1783 int i, k = 0, n = 0, l;
1788 /* Lookup the options */
1789 for (i = 0; i < 24; i++) opt[i] = 0;
1791 /* Scan the options */
1792 for (i = 0; option_info[i].o_desc; i++)
1794 /* Notice options on this "page" */
1795 if (option_info[i].o_page == page) opt[n++] = i;
1803 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
1805 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
1808 /* Interact with the player */
1813 /* Prompt XXX XXX XXX */
1815 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1817 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1822 /* Display the options */
1823 for (i = 0; i < n; i++)
1825 byte a = TERM_WHITE;
1827 /* Color current option */
1828 if (i == k) a = TERM_L_BLUE;
1830 /* Display the option text */
1831 sprintf(buf, "%-48s: %s (%.19s)",
1832 option_info[opt[i]].o_desc,
1834 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1836 (*option_info[opt[i]].o_var ? "yes" : "no "),
1839 option_info[opt[i]].o_text);
1840 if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1841 else c_prt(a, buf, i + 2, 0);
1844 if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3;
1847 /* Hilite current option */
1848 move_cursor(k + 2 + l, 50);
1854 * HACK - Try to translate the key into a direction
1855 * to allow using the roguelike keys for navigation.
1857 dir = get_keymap_dir(ch);
1858 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1872 k = (n + k - 1) % n;
1889 (*option_info[opt[k]].o_var) = TRUE;
1898 (*option_info[opt[k]].o_var) = FALSE;
1906 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1921 * Modify the "window" options
1923 static void do_cmd_options_win(void)
1937 /* Memorize old flags */
1938 for (j = 0; j < 8; j++)
1940 /* Acquire current flags */
1941 old_flag[j] = window_flag[j];
1951 /* Prompt XXX XXX XXX */
1953 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1955 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1959 /* Display the windows */
1960 for (j = 0; j < 8; j++)
1962 byte a = TERM_WHITE;
1964 cptr s = angband_term_name[j];
1967 if (j == x) a = TERM_L_BLUE;
1969 /* Window name, staggered, centered */
1970 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1973 /* Display the options */
1974 for (i = 0; i < 16; i++)
1976 byte a = TERM_WHITE;
1978 cptr str = window_flag_desc[i];
1981 if (i == y) a = TERM_L_BLUE;
1985 if (!str) str = "(̤»ÈÍÑ)";
1987 if (!str) str = "(Unused option)";
1992 Term_putstr(0, i + 5, -1, a, str);
1994 /* Display the windows */
1995 for (j = 0; j < 8; j++)
1997 byte a = TERM_WHITE;
2002 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2005 if (window_flag[j] & (1L << i)) c = 'X';
2008 Term_putch(35 + j * 5, i + 5, a, c);
2013 Term_gotoxy(35 + x * 5, y + 5);
2031 for (j = 0; j < 8; j++)
2033 window_flag[j] &= ~(1L << y);
2037 for (i = 0; i < 16; i++)
2039 window_flag[x] &= ~(1L << i);
2052 window_flag[x] |= (1L << y);
2060 window_flag[x] &= ~(1L << y);
2066 d = get_keymap_dir(ch);
2068 x = (x + ddx[d] + 8) % 8;
2069 y = (y + ddy[d] + 16) % 16;
2076 /* Notice changes */
2077 for (j = 0; j < 8; j++)
2082 if (!angband_term[j]) continue;
2084 /* Ignore non-changes */
2085 if (window_flag[j] == old_flag[j]) continue;
2088 Term_activate(angband_term[j]);
2105 * Set or unset various options.
2107 * The user must use the "Ctrl-R" command to "adapt" to changes
2108 * in any options which control "visual" aspects of the game.
2110 void do_cmd_options(void)
2115 /* Save the screen */
2125 /* Why are we here */
2127 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2129 prt("Options", 2, 0);
2133 /* Give some choices */
2135 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2136 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2137 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2138 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2139 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2140 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2141 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2142 /* Special choices */
2143 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2144 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2145 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2147 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2149 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2151 prt("(1) Input Options", 4, 5);
2152 prt("(2) Output Options", 5, 5);
2153 prt("(3) Game-Play Options", 6, 5);
2154 prt("(4) Disturbance Options", 7, 5);
2155 prt("(5) Efficiency Options", 8, 5);
2156 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2157 prt("(R) Play-record Options", 10, 5);
2159 /* Special choices */
2160 prt("(D) Base Delay Factor", 12, 5);
2161 prt("(H) Hitpoint Warning", 13, 5);
2162 prt("(A) Autosave Options", 14, 5);
2166 prt("(W) Window Flags", 15, 5);
2169 prt("(C) Cheating Options", 16, 5);
2175 prt("¥³¥Þ¥ó¥É:", 18, 0);
2177 prt("Command: ", 18, 0);
2185 if (k == ESCAPE) break;
2190 /* General Options */
2193 /* Process the general options */
2195 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2197 do_cmd_options_aux(1, "Input Options");
2203 /* General Options */
2206 /* Process the general options */
2208 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2210 do_cmd_options_aux(2, "Output Options");
2216 /* Inventory Options */
2221 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2223 do_cmd_options_aux(3, "Game-Play Options");
2229 /* Disturbance Options */
2234 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2236 do_cmd_options_aux(4, "Disturbance Options");
2242 /* Efficiency Options */
2247 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2249 do_cmd_options_aux(5, "Efficiency Options");
2255 /* Object auto-destruction Options */
2260 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2262 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2267 /* Play-record Options */
2273 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2275 do_cmd_options_aux(10, "Play-record Option");
2280 /* Cheating Options */
2285 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2287 do_cmd_options_cheat("Cheaters never win");
2297 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2299 do_cmd_options_autosave("Autosave");
2310 do_cmd_options_win();
2311 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2312 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2313 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2314 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2318 /* Hack -- Delay Speed */
2324 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2326 prt("Command: Base Delay Factor", 18, 0);
2330 /* Get a new value */
2333 int msec = delay_factor * delay_factor * delay_factor;
2335 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2337 prt(format("Current base delay factor: %d (%d msec)",
2340 delay_factor, msec), 22, 0);
2342 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2344 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2348 if (k == ESCAPE) break;
2349 if (isdigit(k)) delay_factor = D2I(k);
2356 /* Hack -- hitpoint warning factor */
2362 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2364 prt("Command: Hitpoint Warning", 18, 0);
2368 /* Get a new value */
2372 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2373 hitpoint_warn), 22, 0);
2375 prt(format("Current hitpoint warning: %d0%%",
2376 hitpoint_warn), 22, 0);
2380 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2382 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2386 if (k == ESCAPE) break;
2387 if (isdigit(k)) hitpoint_warn = D2I(k);
2394 /* Unknown option */
2403 /* Flush messages */
2408 /* Restore the screen */
2411 /* Hack - Redraw equippy chars */
2412 p_ptr->redraw |= (PR_EQUIPPY);
2418 * Ask for a "user pref line" and process it
2420 * XXX XXX XXX Allow absolute file names?
2422 void do_cmd_pref(void)
2429 /* Ask for a "user pref command" */
2431 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2433 if (!get_string("Pref: ", buf, 80)) return;
2437 /* Process that pref command */
2438 (void)process_pref_file_command(buf);
2441 void do_cmd_pickpref(void)
2447 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2449 if(!get_check("Reload auto-pick preference file? ")) return;
2452 /* Free old entries */
2455 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2457 sprintf(buf, "picktype-%s.prf", player_name);
2459 sprintf(buf, "pickpref-%s.prf", player_name);
2461 err = process_pickpref_file(buf);
2466 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2468 msg_format("loaded '%s'.", buf);
2472 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2474 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2478 err = process_pickpref_file("picktype.prf");
2480 err = process_pickpref_file("pickpref.prf");
2486 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2488 msg_print("loaded 'pickpref.prf'.");
2495 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2497 if(err) msg_print("Failed to reload autopick preference.");
2504 * Hack -- append all current macros to the given file
2506 static errr macro_dump(cptr fname)
2508 static cptr mark = "Macro Dump";
2516 /* Build the filename */
2517 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2519 /* File type is "TEXT" */
2520 FILE_TYPE(FILE_TYPE_TEXT);
2522 /* Append to the file */
2523 fff = open_auto_dump(buf, mark, &line_num);
2524 if (!fff) return (-1);
2528 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2530 fprintf(fff, "\n# Automatic macro dump\n\n");
2535 for (i = 0; i < macro__num; i++)
2537 /* Extract the action */
2538 ascii_to_text(buf, macro__act[i]);
2540 /* Dump the macro */
2541 fprintf(fff, "A:%s\n", buf);
2543 /* Extract the action */
2544 ascii_to_text(buf, macro__pat[i]);
2546 /* Dump normal macros */
2547 fprintf(fff, "P:%s\n", buf);
2552 /* count number of lines */
2557 close_auto_dump(fff, mark, line_num);
2565 * Hack -- ask for a "trigger" (see below)
2567 * Note the complex use of the "inkey()" function from "util.c".
2569 * Note that both "flush()" calls are extremely important.
2571 static void do_cmd_macro_aux(char *buf)
2581 /* Do not process macros */
2587 /* Read the pattern */
2593 /* Do not process macros */
2596 /* Do not wait for keys */
2599 /* Attempt to read a key */
2610 /* Convert the trigger */
2611 ascii_to_text(tmp, buf);
2613 /* Hack -- display the trigger */
2614 Term_addstr(-1, TERM_WHITE, tmp);
2621 * Hack -- ask for a keymap "trigger" (see below)
2623 * Note that both "flush()" calls are extremely important. This may
2624 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2626 static void do_cmd_macro_aux_keymap(char *buf)
2640 /* Convert to ascii */
2641 ascii_to_text(tmp, buf);
2643 /* Hack -- display the trigger */
2644 Term_addstr(-1, TERM_WHITE, tmp);
2653 * Hack -- append all keymaps to the given file
2655 static errr keymap_dump(cptr fname)
2657 static cptr mark = "Keymap Dump";
2669 if (rogue_like_commands)
2671 mode = KEYMAP_MODE_ROGUE;
2677 mode = KEYMAP_MODE_ORIG;
2681 /* Build the filename */
2682 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2684 /* File type is "TEXT" */
2685 FILE_TYPE(FILE_TYPE_TEXT);
2687 /* Append to the file */
2688 fff = open_auto_dump(buf, mark, &line_num);
2689 if (!fff) return -1;
2693 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2695 fprintf(fff, "\n# Automatic keymap dump\n\n");
2700 for (i = 0; i < 256; i++)
2704 /* Loop up the keymap */
2705 act = keymap_act[mode][i];
2707 /* Skip empty keymaps */
2710 /* Encode the key */
2713 ascii_to_text(key, buf);
2715 /* Encode the action */
2716 ascii_to_text(buf, act);
2718 /* Dump the macro */
2719 fprintf(fff, "A:%s\n", buf);
2720 fprintf(fff, "C:%d:%s\n", mode, key);
2725 close_auto_dump(fff, mark, line_num);
2734 * Interact with "macros"
2736 * Note that the macro "action" must be defined before the trigger.
2738 * Could use some helpful instructions on this page. XXX XXX XXX
2740 void do_cmd_macros(void)
2752 if (rogue_like_commands)
2754 mode = KEYMAP_MODE_ROGUE;
2760 mode = KEYMAP_MODE_ORIG;
2763 /* File type is "TEXT" */
2764 FILE_TYPE(FILE_TYPE_TEXT);
2771 /* Process requests until done */
2779 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2781 prt("Interact with Macros", 2, 0);
2786 /* Describe that action */
2788 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2790 prt("Current action (if any) shown below:", 20, 0);
2794 /* Analyze the current action */
2795 ascii_to_text(buf, macro__buf);
2797 /* Display the current action */
2803 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2805 prt("(1) Load a user pref file", 4, 5);
2810 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2811 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2812 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2813 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2814 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2815 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2816 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2817 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2818 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2820 prt("(2) Append macros to a file", 5, 5);
2821 prt("(3) Query a macro", 6, 5);
2822 prt("(4) Create a macro", 7, 5);
2823 prt("(5) Remove a macro", 8, 5);
2824 prt("(6) Append keymaps to a file", 9, 5);
2825 prt("(7) Query a keymap", 10, 5);
2826 prt("(8) Create a keymap", 11, 5);
2827 prt("(9) Remove a keymap", 12, 5);
2828 prt("(0) Enter a new action", 13, 5);
2831 #endif /* ALLOW_MACROS */
2835 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2837 prt("Command: ", 16, 0);
2845 if (i == ESCAPE) break;
2847 /* Load a 'macro' file */
2854 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2856 prt("Command: Load a user pref file", 16, 0);
2862 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2864 prt("File: ", 18, 0);
2868 /* Default filename */
2869 sprintf(tmp, "%s.prf", player_name);
2871 /* Ask for a file */
2872 if (!askfor_aux(tmp, 80)) continue;
2874 /* Process the given filename */
2875 err = process_pref_file(tmp);
2879 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2881 msg_format("Loaded default '%s'.", tmp);
2888 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2890 msg_format("Failed to load '%s'!");
2896 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2898 msg_format("Loaded '%s'.", tmp);
2910 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2912 prt("Command: Append macros to a file", 16, 0);
2918 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2920 prt("File: ", 18, 0);
2924 /* Default filename */
2925 sprintf(tmp, "%s.prf", player_name);
2927 /* Ask for a file */
2928 if (!askfor_aux(tmp, 80)) continue;
2930 /* Dump the macros */
2931 (void)macro_dump(tmp);
2935 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2937 msg_print("Appended macros.");
2949 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2951 prt("Command: Query a macro", 16, 0);
2957 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2959 prt("Trigger: ", 18, 0);
2963 /* Get a macro trigger */
2964 do_cmd_macro_aux(buf);
2966 /* Acquire action */
2967 k = macro_find_exact(buf);
2974 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2976 msg_print("Found no macro.");
2984 /* Obtain the action */
2985 strcpy(macro__buf, macro__act[k]);
2987 /* Analyze the current action */
2988 ascii_to_text(buf, macro__buf);
2990 /* Display the current action */
2995 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2997 msg_print("Found a macro.");
3003 /* Create a macro */
3008 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3010 prt("Command: Create a macro", 16, 0);
3016 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3018 prt("Trigger: ", 18, 0);
3022 /* Get a macro trigger */
3023 do_cmd_macro_aux(buf);
3030 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3032 prt("Action: ", 20, 0);
3036 /* Convert to text */
3037 ascii_to_text(tmp, macro__buf);
3039 /* Get an encoded action */
3040 if (askfor_aux(tmp, 80))
3042 /* Convert to ascii */
3043 text_to_ascii(macro__buf, tmp);
3045 /* Link the macro */
3046 macro_add(buf, macro__buf);
3050 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3052 msg_print("Added a macro.");
3058 /* Remove a macro */
3063 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3065 prt("Command: Remove a macro", 16, 0);
3071 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3073 prt("Trigger: ", 18, 0);
3077 /* Get a macro trigger */
3078 do_cmd_macro_aux(buf);
3080 /* Link the macro */
3081 macro_add(buf, buf);
3085 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3087 msg_print("Removed a macro.");
3097 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3099 prt("Command: Append keymaps to a file", 16, 0);
3105 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3107 prt("File: ", 18, 0);
3111 /* Default filename */
3112 sprintf(tmp, "%s.prf", player_name);
3114 /* Ask for a file */
3115 if (!askfor_aux(tmp, 80)) continue;
3117 /* Dump the macros */
3118 (void)keymap_dump(tmp);
3122 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3124 msg_print("Appended keymaps.");
3129 /* Query a keymap */
3136 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3138 prt("Command: Query a keymap", 16, 0);
3144 prt("²¡¤¹¥¡¼: ", 18, 0);
3146 prt("Keypress: ", 18, 0);
3150 /* Get a keymap trigger */
3151 do_cmd_macro_aux_keymap(buf);
3153 /* Look up the keymap */
3154 act = keymap_act[mode][(byte)(buf[0])];
3161 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3163 msg_print("Found no keymap.");
3171 /* Obtain the action */
3172 strcpy(macro__buf, act);
3174 /* Analyze the current action */
3175 ascii_to_text(buf, macro__buf);
3177 /* Display the current action */
3182 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3184 msg_print("Found a keymap.");
3190 /* Create a keymap */
3195 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3197 prt("Command: Create a keymap", 16, 0);
3203 prt("²¡¤¹¥¡¼: ", 18, 0);
3205 prt("Keypress: ", 18, 0);
3209 /* Get a keymap trigger */
3210 do_cmd_macro_aux_keymap(buf);
3217 prt("¹ÔÆ°: ", 20, 0);
3219 prt("Action: ", 20, 0);
3223 /* Convert to text */
3224 ascii_to_text(tmp, macro__buf);
3226 /* Get an encoded action */
3227 if (askfor_aux(tmp, 80))
3229 /* Convert to ascii */
3230 text_to_ascii(macro__buf, tmp);
3232 /* Free old keymap */
3233 string_free(keymap_act[mode][(byte)(buf[0])]);
3235 /* Make new keymap */
3236 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3240 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3242 msg_print("Added a keymap.");
3248 /* Remove a keymap */
3253 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3255 prt("Command: Remove a keymap", 16, 0);
3261 prt("²¡¤¹¥¡¼: ", 18, 0);
3263 prt("Keypress: ", 18, 0);
3267 /* Get a keymap trigger */
3268 do_cmd_macro_aux_keymap(buf);
3270 /* Free old keymap */
3271 string_free(keymap_act[mode][(byte)(buf[0])]);
3273 /* Make new keymap */
3274 keymap_act[mode][(byte)(buf[0])] = NULL;
3278 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3280 msg_print("Removed a keymap.");
3285 /* Enter a new action */
3290 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3292 prt("Command: Enter a new action", 16, 0);
3296 /* Go to the correct location */
3299 /* Hack -- limit the value */
3302 /* Get an encoded action */
3303 if (!askfor_aux(buf, 80)) continue;
3305 /* Extract an action */
3306 text_to_ascii(macro__buf, buf);
3309 #endif /* ALLOW_MACROS */
3318 /* Flush messages */
3327 static void cmd_visuals_aux(int i, int *num, int max)
3334 sprintf(str, "%d", *num);
3336 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3339 tmp = strtol(str, NULL, 0);
3340 if (tmp >= 0 && tmp < max)
3344 else if (isupper(i))
3345 *num = (*num + max - 1) % max;
3347 *num = (*num + 1) % max;
3353 * Interact with "visuals"
3355 void do_cmd_visuals(void)
3366 /* File type is "TEXT" */
3367 FILE_TYPE(FILE_TYPE_TEXT);
3370 /* Save the screen */
3374 /* Interact until done */
3380 /* Ask for a choice */
3382 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3384 prt("Interact with Visuals", 2, 0);
3388 /* Give some choices */
3390 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3392 prt("(1) Load a user pref file", 4, 5);
3395 #ifdef ALLOW_VISUALS
3397 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3398 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3399 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3400 prt("(5) (̤»ÈÍÑ)", 8, 5);
3401 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3402 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3403 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3404 prt("(9) (̤»ÈÍÑ)", 12, 5);
3406 prt("(2) Dump monster attr/chars", 5, 5);
3407 prt("(3) Dump object attr/chars", 6, 5);
3408 prt("(4) Dump feature attr/chars", 7, 5);
3409 prt("(5) (unused)", 8, 5);
3410 prt("(6) Change monster attr/chars", 9, 5);
3411 prt("(7) Change object attr/chars", 10, 5);
3412 prt("(8) Change feature attr/chars", 11, 5);
3413 prt("(9) (unused)", 12, 5);
3418 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3420 prt("(0) Reset visuals", 13, 5);
3426 prt("¥³¥Þ¥ó¥É:", 18, 0);
3428 prt("Command: ", 15, 0);
3436 if (i == ESCAPE) break;
3438 /* Load a 'pref' file */
3443 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3445 prt("Command: Load a user pref file", 15, 0);
3451 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3453 prt("File: ", 17, 0);
3457 /* Default filename */
3458 sprintf(tmp, "%s.prf", player_name);
3461 if (!askfor_aux(tmp, 70)) continue;
3463 /* Process the given filename */
3464 (void)process_pref_file(tmp);
3467 #ifdef ALLOW_VISUALS
3469 /* Dump monster attr/chars */
3472 static cptr mark = "Monster attr/chars";
3477 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3479 prt("Command: Dump monster attr/chars", 15, 0);
3485 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3487 prt("File: ", 17, 0);
3491 /* Default filename */
3492 sprintf(tmp, "%s.prf", player_name);
3494 /* Get a filename */
3495 if (!askfor_aux(tmp, 70)) continue;
3497 /* Build the filename */
3498 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3500 /* Append to the file */
3501 fff = open_auto_dump(buf, mark, &line_num);
3506 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3508 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3513 for (i = 0; i < max_r_idx; i++)
3515 monster_race *r_ptr = &r_info[i];
3517 /* Skip non-entries */
3518 if (!r_ptr->name) continue;
3520 /* Dump a comment */
3521 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3524 /* Dump the monster attr/char info */
3525 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3526 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3531 close_auto_dump(fff, mark, line_num);
3535 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3537 msg_print("Dumped monster attr/chars.");
3542 /* Dump object attr/chars */
3545 static cptr mark = "Object attr/chars";
3550 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3552 prt("Command: Dump object attr/chars", 15, 0);
3558 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3560 prt("File: ", 17, 0);
3564 /* Default filename */
3565 sprintf(tmp, "%s.prf", player_name);
3567 /* Get a filename */
3568 if (!askfor_aux(tmp, 70)) continue;
3570 /* Build the filename */
3571 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3573 /* Append to the file */
3574 fff = open_auto_dump(buf, mark, &line_num);
3579 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3581 fprintf(fff, "\n# Object attr/char definitions\n\n");
3586 for (i = 0; i < max_k_idx; i++)
3588 object_kind *k_ptr = &k_info[i];
3590 /* Skip non-entries */
3591 if (!k_ptr->name) continue;
3593 /* Dump a comment */
3594 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3597 /* Dump the object attr/char info */
3598 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3599 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3604 close_auto_dump(fff, mark, line_num);
3608 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3610 msg_print("Dumped object attr/chars.");
3615 /* Dump feature attr/chars */
3618 static cptr mark = "Feature attr/chars";
3623 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3625 prt("Command: Dump feature attr/chars", 15, 0);
3631 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3633 prt("File: ", 17, 0);
3637 /* Default filename */
3638 sprintf(tmp, "%s.prf", player_name);
3640 /* Get a filename */
3641 if (!askfor_aux(tmp, 70)) continue;
3643 /* Build the filename */
3644 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3646 /* Append to the file */
3647 fff = open_auto_dump(buf, mark, &line_num);
3652 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3654 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3659 for (i = 0; i < max_f_idx; i++)
3661 feature_type *f_ptr = &f_info[i];
3663 /* Skip non-entries */
3664 if (!f_ptr->name) continue;
3666 /* Dump a comment */
3667 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3670 /* Dump the feature attr/char info */
3671 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3672 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3677 close_auto_dump(fff, mark, line_num);
3681 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3683 msg_print("Dumped feature attr/chars.");
3688 /* Modify monster attr/chars */
3695 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3697 prt("Command: Change monster attr/chars", 15, 0);
3701 /* Hack -- query until done */
3704 monster_race *r_ptr = &r_info[r];
3708 byte da = (r_ptr->d_attr);
3709 byte dc = (r_ptr->d_char);
3710 byte ca = (r_ptr->x_attr);
3711 byte cc = (r_ptr->x_char);
3713 /* Label the object */
3715 Term_putstr(5, 17, -1, TERM_WHITE,
3716 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3717 r, (r_name + r_ptr->name)));
3719 Term_putstr(5, 17, -1, TERM_WHITE,
3720 format("Monster = %d, Name = %-40.40s",
3721 r, (r_name + r_ptr->name)));
3725 /* Label the Default values */
3727 Term_putstr(10, 19, -1, TERM_WHITE,
3728 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3730 Term_putstr(10, 19, -1, TERM_WHITE,
3731 format("Default attr/char = %3u / %3u", da, dc));
3734 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3735 Term_putch(43, 19, da, dc);
3739 Term_putch(44, 19, 255, -1);
3741 Term_putch(44, 19, 0, ' ');
3744 /* Label the Current values */
3746 Term_putstr(10, 20, -1, TERM_WHITE,
3747 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3749 Term_putstr(10, 20, -1, TERM_WHITE,
3750 format("Current attr/char = %3u / %3u", ca, cc));
3753 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3754 Term_putch(43, 20, ca, cc);
3758 Term_putch(44, 20, 255, -1);
3760 Term_putch(44, 20, 0, ' ');
3765 Term_putstr(0, 22, -1, TERM_WHITE,
3766 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3768 Term_putstr(0, 22, -1, TERM_WHITE,
3769 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3776 if (i == ESCAPE) break;
3778 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3779 else if (isupper(i)) c = 'a' + i - 'A';
3785 cmd_visuals_aux(i, &r, max_r_idx);
3788 t = (int)r_ptr->x_attr;
3789 cmd_visuals_aux(i, &t, 256);
3790 r_ptr->x_attr = (byte)t;
3793 t = (int)r_ptr->x_char;
3794 cmd_visuals_aux(i, &t, 256);
3795 r_ptr->x_char = (byte)t;
3801 /* Modify object attr/chars */
3808 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3810 prt("Command: Change object attr/chars", 15, 0);
3814 /* Hack -- query until done */
3817 object_kind *k_ptr = &k_info[k];
3821 byte da = (byte)k_ptr->d_attr;
3822 byte dc = (byte)k_ptr->d_char;
3823 byte ca = (byte)k_ptr->x_attr;
3824 byte cc = (byte)k_ptr->x_char;
3826 /* Label the object */
3828 Term_putstr(5, 17, -1, TERM_WHITE,
3829 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3830 k, (k_name + k_ptr->name)));
3832 Term_putstr(5, 17, -1, TERM_WHITE,
3833 format("Object = %d, Name = %-40.40s",
3834 k, (k_name + k_ptr->name)));
3838 /* Label the Default values */
3840 Term_putstr(10, 19, -1, TERM_WHITE,
3841 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3843 Term_putstr(10, 19, -1, TERM_WHITE,
3844 format("Default attr/char = %3d / %3d", da, dc));
3847 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3848 Term_putch(43, 19, da, dc);
3852 Term_putch(44, 19, 255, -1);
3854 Term_putch(44, 19, 0, ' ');
3857 /* Label the Current values */
3859 Term_putstr(10, 20, -1, TERM_WHITE,
3860 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3862 Term_putstr(10, 20, -1, TERM_WHITE,
3863 format("Current attr/char = %3d / %3d", ca, cc));
3866 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3867 Term_putch(43, 20, ca, cc);
3871 Term_putch(44, 20, 255, -1);
3873 Term_putch(44, 20, 0, ' ');
3878 Term_putstr(0, 22, -1, TERM_WHITE,
3879 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3881 Term_putstr(0, 22, -1, TERM_WHITE,
3882 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3889 if (i == ESCAPE) break;
3891 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3892 else if (isupper(i)) c = 'a' + i - 'A';
3898 cmd_visuals_aux(i, &k, max_k_idx);
3901 t = (int)k_info[k].x_attr;
3902 cmd_visuals_aux(i, &t, 256);
3903 k_info[k].x_attr = (byte)t;
3906 t = (int)k_info[k].x_char;
3907 cmd_visuals_aux(i, &t, 256);
3908 k_info[k].x_char = (byte)t;
3914 /* Modify feature attr/chars */
3921 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3923 prt("Command: Change feature attr/chars", 15, 0);
3927 /* Hack -- query until done */
3930 feature_type *f_ptr = &f_info[f];
3934 byte da = (byte)f_ptr->d_attr;
3935 byte dc = (byte)f_ptr->d_char;
3936 byte ca = (byte)f_ptr->x_attr;
3937 byte cc = (byte)f_ptr->x_char;
3939 /* Label the object */
3941 Term_putstr(5, 17, -1, TERM_WHITE,
3942 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3943 f, (f_name + f_ptr->name)));
3945 Term_putstr(5, 17, -1, TERM_WHITE,
3946 format("Terrain = %d, Name = %-40.40s",
3947 f, (f_name + f_ptr->name)));
3951 /* Label the Default values */
3953 Term_putstr(10, 19, -1, TERM_WHITE,
3954 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3956 Term_putstr(10, 19, -1, TERM_WHITE,
3957 format("Default attr/char = %3d / %3d", da, dc));
3960 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3961 Term_putch(43, 19, da, dc);
3965 Term_putch(44, 19, 255, -1);
3967 Term_putch(44, 19, 0, ' ');
3970 /* Label the Current values */
3972 Term_putstr(10, 20, -1, TERM_WHITE,
3973 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3975 Term_putstr(10, 20, -1, TERM_WHITE,
3976 format("Current attr/char = %3d / %3d", ca, cc));
3979 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3980 Term_putch(43, 20, ca, cc);
3984 Term_putch(44, 20, 255, -1);
3986 Term_putch(44, 20, 0, ' ');
3991 Term_putstr(0, 22, -1, TERM_WHITE,
3992 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3994 Term_putstr(0, 22, -1, TERM_WHITE,
3995 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4002 if (i == ESCAPE) break;
4004 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4005 else if (isupper(i)) c = 'a' + i - 'A';
4011 cmd_visuals_aux(i, &f, max_f_idx);
4014 t = (int)f_info[f].x_attr;
4015 cmd_visuals_aux(i, &t, 256);
4016 f_info[f].x_attr = (byte)t;
4019 t = (int)f_info[f].x_char;
4020 cmd_visuals_aux(i, &t, 256);
4021 f_info[f].x_char = (byte)t;
4037 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4039 msg_print("Visual attr/char tables reset.");
4044 /* Unknown option */
4050 /* Flush messages */
4055 /* Restore the screen */
4061 * Interact with "colors"
4063 void do_cmd_colors(void)
4074 /* File type is "TEXT" */
4075 FILE_TYPE(FILE_TYPE_TEXT);
4078 /* Save the screen */
4082 /* Interact until done */
4088 /* Ask for a choice */
4090 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4092 prt("Interact with Colors", 2, 0);
4096 /* Give some choices */
4098 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4100 prt("(1) Load a user pref file", 4, 5);
4105 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4106 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4108 prt("(2) Dump colors", 5, 5);
4109 prt("(3) Modify colors", 6, 5);
4116 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4118 prt("Command: ", 8, 0);
4126 if (i == ESCAPE) break;
4128 /* Load a 'pref' file */
4133 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4135 prt("Command: Load a user pref file", 8, 0);
4141 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4143 prt("File: ", 10, 0);
4148 sprintf(tmp, "%s.prf", player_name);
4151 if (!askfor_aux(tmp, 70)) continue;
4153 /* Process the given filename */
4154 (void)process_pref_file(tmp);
4156 /* Mega-Hack -- react to changes */
4157 Term_xtra(TERM_XTRA_REACT, 0);
4159 /* Mega-Hack -- redraw */
4168 static cptr mark = "Colors";
4173 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4175 prt("Command: Dump colors", 8, 0);
4181 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4183 prt("File: ", 10, 0);
4187 /* Default filename */
4188 sprintf(tmp, "%s.prf", player_name);
4190 /* Get a filename */
4191 if (!askfor_aux(tmp, 70)) continue;
4193 /* Build the filename */
4194 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4196 /* Append to the file */
4197 fff = open_auto_dump(buf, mark, &line_num);
4202 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4204 fprintf(fff, "\n# Color redefinitions\n\n");
4209 for (i = 0; i < 256; i++)
4211 int kv = angband_color_table[i][0];
4212 int rv = angband_color_table[i][1];
4213 int gv = angband_color_table[i][2];
4214 int bv = angband_color_table[i][3];
4219 cptr name = "unknown";
4223 /* Skip non-entries */
4224 if (!kv && !rv && !gv && !bv) continue;
4226 /* Extract the color name */
4227 if (i < 16) name = color_names[i];
4229 /* Dump a comment */
4231 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4233 fprintf(fff, "# Color '%s'\n", name);
4237 /* Dump the monster attr/char info */
4238 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4244 close_auto_dump(fff, mark, line_num);
4248 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4250 msg_print("Dumped color redefinitions.");
4262 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4264 prt("Command: Modify colors", 8, 0);
4268 /* Hack -- query until done */
4277 /* Exhibit the normal colors */
4278 for (j = 0; j < 16; j++)
4280 /* Exhibit this color */
4281 Term_putstr(j*4, 20, -1, a, "###");
4283 /* Exhibit all colors */
4284 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4287 /* Describe the color */
4289 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4291 name = ((a < 16) ? color_names[a] : "undefined");
4295 /* Describe the color */
4297 Term_putstr(5, 10, -1, TERM_WHITE,
4298 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4300 Term_putstr(5, 10, -1, TERM_WHITE,
4301 format("Color = %d, Name = %s", a, name));
4305 /* Label the Current values */
4306 Term_putstr(5, 12, -1, TERM_WHITE,
4307 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4308 angband_color_table[a][0],
4309 angband_color_table[a][1],
4310 angband_color_table[a][2],
4311 angband_color_table[a][3]));
4315 Term_putstr(0, 14, -1, TERM_WHITE,
4316 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4318 Term_putstr(0, 14, -1, TERM_WHITE,
4319 "Command (n/N/k/K/r/R/g/G/b/B): ");
4327 if (i == ESCAPE) break;
4330 if (i == 'n') a = (byte)(a + 1);
4331 if (i == 'N') a = (byte)(a - 1);
4332 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4333 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4334 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4335 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4336 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4337 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4338 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4339 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4341 /* Hack -- react to changes */
4342 Term_xtra(TERM_XTRA_REACT, 0);
4344 /* Hack -- redraw */
4351 /* Unknown option */
4357 /* Flush messages */
4362 /* Restore the screen */
4368 * Note something in the message recall
4370 void do_cmd_note(void)
4379 if (!get_string("¥á¥â: ", buf, 60)) return;
4381 if (!get_string("Note: ", buf, 60)) return;
4385 /* Ignore empty notes */
4386 if (!buf[0] || (buf[0] == ' ')) return;
4388 /* Add the note to the message recall */
4390 msg_format("¥á¥â: %s", buf);
4392 msg_format("Note: %s", buf);
4399 * Mention the current version
4401 void do_cmd_version(void)
4406 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4407 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4409 msg_format("You are playing Hengband %d.%d.%d.",
4410 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4417 * Array of feeling strings
4419 static cptr do_cmd_feeling_text[11] =
4422 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4424 "Looks like any other level.",
4428 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4430 "You feel there is something special about this level.",
4434 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4436 "You nearly faint as horrible visions of death fill your mind!",
4440 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4442 "This level looks very dangerous.",
4446 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4448 "You have a very bad feeling...",
4452 "°¤¤Í½´¶¤¬¤¹¤ë...",
4454 "You have a bad feeling...",
4460 "You feel nervous.",
4464 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4466 "You feel your luck is turning...",
4470 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4472 "You don't like the look of this place.",
4476 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4478 "This level looks reasonably safe.",
4482 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4484 "What a boring place..."
4489 static cptr do_cmd_feeling_text_combat[11] =
4492 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4494 "Looks like any other level.",
4498 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4500 "You feel there is something special about this level.",
4504 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4506 "You nearly faint as horrible visions of death fill your mind!",
4510 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4512 "This level looks very dangerous.",
4516 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4518 "You have a very bad feeling...",
4522 "°¤¤Í½´¶¤¬¤¹¤ë...",
4524 "You have a bad feeling...",
4530 "You feel nervous.",
4534 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4536 "You feel your luck is turning...",
4540 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4542 "You don't like the look of this place.",
4546 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4548 "This level looks reasonably safe.",
4552 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4554 "What a boring place..."
4559 static cptr do_cmd_feeling_text_lucky[11] =
4562 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4563 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4564 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4565 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4566 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4567 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4568 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4569 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4570 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4571 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4572 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4574 "Looks like any other level.",
4575 "You feel there is something special about this level.",
4576 "You have a superb feeling about this level.",
4577 "You have an excellent feeling...",
4578 "You have a very good feeling...",
4579 "You have a good feeling...",
4580 "You feel strangely lucky...",
4581 "You feel your luck is turning...",
4582 "You like the look of this place...",
4583 "This level can't be all bad...",
4584 "What a boring place..."
4590 * Note that "feeling" is set to zero unless some time has passed.
4591 * Note that this is done when the level is GENERATED, not entered.
4593 void do_cmd_feeling(void)
4595 /* Verify the feeling */
4596 if (feeling > 10) feeling = 10;
4598 /* No useful feeling in quests */
4599 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4602 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4604 msg_print("Looks like a typical quest level.");
4610 /* No useful feeling in town */
4611 else if (p_ptr->town_num && !dun_level)
4614 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4616 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4620 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4622 msg_print("Looks like a strange wilderness.");
4630 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4632 msg_print("Looks like a typical town.");
4639 /* No useful feeling in the wilderness */
4640 else if (!dun_level)
4643 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4645 msg_print("Looks like a typical wilderness.");
4651 /* Display the feeling */
4652 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4654 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4656 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4657 msg_print(do_cmd_feeling_text_combat[feeling]);
4659 msg_print(do_cmd_feeling_text[feeling]);
4664 msg_print(do_cmd_feeling_text[0]);
4673 * Encode the screen colors
4675 static char hack[17] = "dwsorgbuDWvyRGBU";
4678 static errr photo_fgets(FILE *fff, char *buf, huge n)
4687 if (fgets(tmp, 1024, fff))
4689 /* Convert weirdness */
4690 for (s = tmp; *s; s++)
4692 /* Handle newline */
4703 else if (*s == '\t')
4705 /* Hack -- require room */
4706 if (i + 8 >= n) break;
4708 /* Append a space */
4711 /* Append some more spaces */
4712 while (!(i % 8)) buf[i++] = ' ';
4716 else if (iskanji(*s))
4723 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4724 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4731 /* Handle printables */
4752 * Hack -- load a screen dump from a file
4754 void do_cmd_load_screen(void)
4769 Term_get_size(&wid, &hgt);
4771 /* Hack -- drop permissions */
4774 /* Build the filename */
4775 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
4777 /* Append to the file */
4778 fff = my_fopen(buf, "r");
4783 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4785 msg_format("Failed to open %s.", buf);
4792 /* Save the screen */
4795 /* Clear the screen */
4799 /* Load the screen */
4800 for (y = 0; okay && (y < hgt); y++)
4802 /* Get a line of data */
4803 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4806 for (x = 0; x < wid - 1; x++)
4808 /* Put the attr/char */
4809 Term_draw(x, y, TERM_WHITE, buf[x]);
4813 /* Get the blank line */
4814 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
4817 /* Dump the screen */
4818 for (y = 0; okay && (y < hgt); y++)
4820 /* Get a line of data */
4821 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4824 for (x = 0; x < wid - 1; x++)
4826 /* Get the attr/char */
4827 (void)(Term_what(x, y, &a, &c));
4829 /* Look up the attr */
4830 for (i = 0; i < 16; i++)
4832 /* Use attr matches */
4833 if (hack[i] == buf[x]) a = i;
4836 /* Put the attr/char */
4837 Term_draw(x, y, a, c);
4842 /* Get the blank line */
4843 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
4849 /* Hack -- grab permissions */
4855 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4857 msg_print("Screen dump loaded.");
4864 /* Restore the screen */
4871 cptr inven_res_label =
4873 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4875 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4878 /* XTRA HACK RESLIST */
4879 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4880 int *j, byte tval, char *where)
4882 char o_name[MAX_NLEN];
4883 u32b flgs[TR_FLAG_SIZE];
4885 if (!o_ptr->k_idx)return;
4886 if (o_ptr->tval != tval)return;
4889 * HACK:Ring of Lordly protection and Dragon shield/helm
4890 * have random resistances.
4892 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4893 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4894 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4895 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4896 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4897 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4898 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4901 object_desc(o_name, o_ptr, TRUE, 0);
4903 while ( o_name[i] && i < 26 ){
4905 if (iskanji(o_name[i])) i++;
4909 if(i<28) while(i<28){o_name[i]=' ';i++;}
4912 fprintf(fff,"%s %s", where, o_name);
4914 if (!(o_ptr->ident & (IDENT_MENTAL)))
4917 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4919 fprintf(fff, "-------unknown------------ -------unknown------\n");
4923 object_flags_known(o_ptr, flgs);
4926 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
4927 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
4928 else fprintf(fff,"¡¦");
4930 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
4931 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
4932 else fprintf(fff,"¡¦");
4934 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
4935 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
4936 else fprintf(fff,"¡¦");
4938 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
4939 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
4940 else fprintf(fff,"¡¦");
4942 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
4943 else fprintf(fff,"¡¦");
4945 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
4946 else fprintf(fff,"¡¦");
4948 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
4949 else fprintf(fff,"¡¦");
4951 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
4952 else fprintf(fff,"¡¦");
4954 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
4955 else fprintf(fff,"¡¦");
4957 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
4958 else fprintf(fff,"¡¦");
4960 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
4961 else fprintf(fff,"¡¦");
4963 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
4964 else fprintf(fff,"¡¦");
4966 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
4967 else fprintf(fff,"¡¦");
4971 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
4972 else fprintf(fff,"¡¦");
4974 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
4975 else fprintf(fff,"¡¦");
4977 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
4978 else fprintf(fff,"¡¦");
4980 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
4981 else fprintf(fff,"¡¦");
4983 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
4984 else fprintf(fff,"¡¦");
4986 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
4987 else fprintf(fff,"¡¦");
4989 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
4990 else fprintf(fff,"¡¦");
4992 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
4993 else fprintf(fff,"¡¦");
4996 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
4997 else fprintf(fff,"¡¦");
4999 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
5000 else fprintf(fff,"¡¦");
5002 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
5003 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
5004 else fprintf(fff,". ");
5006 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
5007 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
5008 else fprintf(fff,". ");
5010 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
5011 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
5012 else fprintf(fff,". ");
5014 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5015 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5016 else fprintf(fff,". ");
5018 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5019 else fprintf(fff,". ");
5021 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5022 else fprintf(fff,". ");
5024 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5025 else fprintf(fff,". ");
5027 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5028 else fprintf(fff,". ");
5030 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5031 else fprintf(fff,". ");
5033 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5034 else fprintf(fff,". ");
5036 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5037 else fprintf(fff,". ");
5039 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5040 else fprintf(fff,". ");
5042 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5043 else fprintf(fff,". ");
5047 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5048 else fprintf(fff,". ");
5050 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5051 else fprintf(fff,". ");
5053 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5054 else fprintf(fff,". ");
5056 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5057 else fprintf(fff,". ");
5059 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5060 else fprintf(fff,". ");
5062 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5063 else fprintf(fff,". ");
5065 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5066 else fprintf(fff,". ");
5068 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5069 else fprintf(fff,". ");
5072 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5073 else fprintf(fff,". ");
5075 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5076 else fprintf(fff,". ");
5084 fprintf(fff,"%s\n", inven_res_label);
5090 * Display *ID* ed weapons/armors's resistances
5092 static void do_cmd_knowledge_inven(void)
5097 char file_name[1024];
5108 /* Open a new file */
5109 fff = my_fopen_temp(file_name, 1024);
5112 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5114 msg_format("Failed to create temporally file %s.", file_name);
5119 fprintf(fff,"%s\n",inven_res_label);
5121 for (tval=TV_BOW; tval <= TV_RING; tval++){
5124 for (;j<9;j++) fprintf(fff, "\n");
5126 fprintf(fff,"%s\n",inven_res_label);
5130 strcpy(where, "Áõ");
5132 strcpy(where, "E ");
5134 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5136 o_ptr = &inventory[i];
5137 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5141 strcpy(where, "»ý");
5143 strcpy(where, "I ");
5145 for (i = 0; i < INVEN_PACK; i++)
5147 o_ptr = &inventory[i];
5148 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5152 /* Print all homes in the different towns */
5153 st_ptr = &town[1].store[STORE_HOME];
5155 strcpy(where, "²È");
5157 strcpy(where, "H ");
5160 /* Dump all available items */
5161 for (i = 0; i < st_ptr->stock_num; i++)
5163 o_ptr = &st_ptr->stock[i];
5164 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5168 /* Close the file */
5171 /* Display the file contents */
5173 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5175 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5178 /* Remove the file */
5183 void do_cmd_save_screen_html_aux(char *filename, int message)
5187 byte a = 0, old_a = 0;
5201 cptr html_head[] = {
5202 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5206 cptr html_foot[] = {
5208 "</body>\n</html>\n",
5214 Term_get_size(&wid, &hgt);
5216 /* File type is "TEXT" */
5217 FILE_TYPE(FILE_TYPE_TEXT);
5219 /* Append to the file */
5220 fff = my_fopen(filename, "w");
5226 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5228 msg_format("Failed to open file %s.", filename);
5236 /* Save the screen */
5240 /* Build the filename */
5241 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5242 tmpfff = my_fopen(buf, "r");
5244 for (i = 0; html_head[i]; i++)
5245 fprintf(fff, html_head[i]);
5249 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5251 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5255 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5257 fprintf(fff, "%s\n", buf);
5262 /* Dump the screen */
5263 for (y = 0; y < hgt; y++)
5270 for (x = 0; x < wid - 1; x++)
5274 /* Get the attr/char */
5275 (void)(Term_what(x, y, &a, &c));
5279 case '&': cc = "&"; break;
5280 case '<': cc = "<"; break;
5281 case '>': cc = ">"; break;
5283 case 0x1f: c = '.'; break;
5284 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5289 if ((y == 0 && x == 0) || a != old_a) {
5290 rv = angband_color_table[a][1];
5291 gv = angband_color_table[a][2];
5292 bv = angband_color_table[a][3];
5293 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5294 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5298 fprintf(fff, "%s", cc);
5300 fprintf(fff, "%c", c);
5303 fprintf(fff, "</font>");
5306 for (i = 0; html_foot[i]; i++)
5307 fprintf(fff, html_foot[i]);
5312 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5314 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5318 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5320 fprintf(fff, "%s\n", buf);
5335 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5337 msg_print("Screen dump saved.");
5342 /* Restore the screen */
5348 * Hack -- save a screen dump to a file
5350 static void do_cmd_save_screen_html(void)
5352 char buf[1024], tmp[256] = "screen.html";
5355 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5357 if (!get_string("File name: ", tmp, 80))
5361 /* Build the filename */
5362 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5366 /* Hack -- drop permissions */
5369 do_cmd_save_screen_html_aux(buf, 1);
5371 /* Hack -- grab permissions */
5377 * Redefinable "save_screen" action
5379 void (*screendump_aux)(void) = NULL;
5383 * Hack -- save a screen dump to a file
5385 void do_cmd_save_screen(void)
5387 bool old_use_graphics = use_graphics;
5388 bool html_dump = FALSE;
5393 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
5395 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
5400 if (c == 'Y' || c == 'y')
5402 else if (c == 'H' || c == 'h')
5414 Term_get_size(&wid, &hgt);
5416 if (old_use_graphics)
5418 use_graphics = FALSE;
5421 /* Redraw everything */
5422 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5424 /* Hack -- update */
5430 do_cmd_save_screen_html();
5434 /* Do we use a special screendump function ? */
5435 else if (screendump_aux)
5437 /* Dump the screen to a graphics file */
5438 (*screendump_aux)();
5440 else /* Dump the screen as text */
5452 /* Hack -- drop permissions */
5455 /* Build the filename */
5456 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5458 /* File type is "TEXT" */
5459 FILE_TYPE(FILE_TYPE_TEXT);
5461 /* Append to the file */
5462 fff = my_fopen(buf, "w");
5467 /* Hack -- grab permissions */
5470 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5472 msg_format("Failed to open file %s.", buf);
5479 /* Save the screen */
5483 /* Dump the screen */
5484 for (y = 0; y < hgt; y++)
5487 for (x = 0; x < wid - 1; x++)
5489 /* Get the attr/char */
5490 (void)(Term_what(x, y, &a, &c));
5500 fprintf(fff, "%s\n", buf);
5507 /* Dump the screen */
5508 for (y = 0; y < hgt; y++)
5511 for (x = 0; x < wid - 1; x++)
5513 /* Get the attr/char */
5514 (void)(Term_what(x, y, &a, &c));
5517 buf[x] = hack[a&0x0F];
5524 fprintf(fff, "%s\n", buf);
5534 /* Hack -- grab permissions */
5539 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5541 msg_print("Screen dump saved.");
5547 /* Restore the screen */
5551 if (old_use_graphics)
5553 use_graphics = TRUE;
5556 /* Redraw everything */
5557 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5559 /* Hack -- update */
5566 * Sorting hook -- Comp function -- see below
5568 * We use "u" to point to array of monster indexes,
5569 * and "v" to select the type of sorting to perform on "u".
5571 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5573 u16b *who = (u16b*)(u);
5575 u16b *why = (u16b*)(v);
5583 /* Sort by total kills */
5586 /* Extract total kills */
5587 z1 = a_info[w1].tval;
5588 z2 = a_info[w2].tval;
5590 /* Compare total kills */
5591 if (z1 < z2) return (TRUE);
5592 if (z1 > z2) return (FALSE);
5596 /* Sort by monster level */
5599 /* Extract levels */
5600 z1 = a_info[w1].sval;
5601 z2 = a_info[w2].sval;
5603 /* Compare levels */
5604 if (z1 < z2) return (TRUE);
5605 if (z1 > z2) return (FALSE);
5609 /* Sort by monster experience */
5612 /* Extract experience */
5613 z1 = a_info[w1].level;
5614 z2 = a_info[w2].level;
5616 /* Compare experience */
5617 if (z1 < z2) return (TRUE);
5618 if (z1 > z2) return (FALSE);
5622 /* Compare indexes */
5628 * Sorting hook -- Swap function -- see below
5630 * We use "u" to point to array of monster indexes,
5631 * and "v" to select the type of sorting to perform.
5633 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5635 u16b *who = (u16b*)(u);
5647 * Check the status of "artifacts"
5649 static void do_cmd_knowledge_artifacts(void)
5651 int i, k, z, x, y, n = 0;
5657 char file_name[1024];
5659 char base_name[MAX_NLEN];
5663 /* Open a new file */
5664 fff = my_fopen_temp(file_name, 1024);
5668 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5670 msg_format("Failed to create temporary file %s.", file_name);
5676 /* Allocate the "who" array */
5677 C_MAKE(who, max_r_idx, s16b);
5679 /* Allocate the "okay" array */
5680 C_MAKE(okay, max_a_idx, bool);
5682 /* Scan the artifacts */
5683 for (k = 0; k < max_a_idx; k++)
5685 artifact_type *a_ptr = &a_info[k];
5690 /* Skip "empty" artifacts */
5691 if (!a_ptr->name) continue;
5693 /* Skip "uncreated" artifacts */
5694 if (!a_ptr->cur_num) continue;
5700 /* Check the dungeon */
5701 for (y = 0; y < cur_hgt; y++)
5703 for (x = 0; x < cur_wid; x++)
5705 cave_type *c_ptr = &cave[y][x];
5707 s16b this_o_idx, next_o_idx = 0;
5709 /* Scan all objects in the grid */
5710 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5714 /* Acquire object */
5715 o_ptr = &o_list[this_o_idx];
5717 /* Acquire next object */
5718 next_o_idx = o_ptr->next_o_idx;
5720 /* Ignore non-artifacts */
5721 if (!artifact_p(o_ptr)) continue;
5723 /* Ignore known items */
5724 if (object_known_p(o_ptr)) continue;
5726 /* Note the artifact */
5727 okay[o_ptr->name1] = FALSE;
5732 /* Check the inventory and equipment */
5733 for (i = 0; i < INVEN_TOTAL; i++)
5735 object_type *o_ptr = &inventory[i];
5737 /* Ignore non-objects */
5738 if (!o_ptr->k_idx) continue;
5740 /* Ignore non-artifacts */
5741 if (!artifact_p(o_ptr)) continue;
5743 /* Ignore known items */
5744 if (object_known_p(o_ptr)) continue;
5746 /* Note the artifact */
5747 okay[o_ptr->name1] = FALSE;
5750 for (k = 0; k < max_a_idx; k++)
5752 if (okay[k]) who[n++] = k;
5755 /* Select the sort method */
5756 ang_sort_comp = ang_sort_art_comp;
5757 ang_sort_swap = ang_sort_art_swap;
5759 /* Sort the array by dungeon depth of monsters */
5760 ang_sort(who, &why, n);
5762 /* Scan the artifacts */
5763 for (k = 0; k < n; k++)
5765 artifact_type *a_ptr = &a_info[who[k]];
5769 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5771 strcpy(base_name, "Unknown Artifact");
5775 /* Obtain the base object type */
5776 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5784 /* Get local object */
5787 /* Create fake object */
5788 object_prep(q_ptr, z);
5790 /* Make it an artifact */
5791 q_ptr->name1 = (byte)who[k];
5793 /* Describe the artifact */
5794 object_desc_store(base_name, q_ptr, FALSE, 0);
5797 /* Hack -- Build the artifact name */
5799 fprintf(fff, " %s\n", base_name);
5801 fprintf(fff, " The %s\n", base_name);
5806 /* Free the "who" array */
5807 C_KILL(who, max_r_idx, s16b);
5809 /* Free the "okay" array */
5810 C_KILL(okay, max_a_idx, bool);
5812 /* Close the file */
5815 /* Display the file contents */
5817 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5819 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5823 /* Remove the file */
5829 * Display known uniques
5831 static void do_cmd_knowledge_uniques(void)
5839 char file_name[1024];
5841 /* Open a new file */
5842 fff = my_fopen_temp(file_name, 1024);
5846 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5848 msg_format("Failed to create temporary file %s.", file_name);
5854 /* Allocate the "who" array */
5855 C_MAKE(who, max_r_idx, s16b);
5857 /* Scan the monsters */
5858 for (i = 1; i < max_r_idx; i++)
5860 monster_race *r_ptr = &r_info[i];
5862 /* Use that monster */
5863 if (r_ptr->name) who[n++] = i;
5866 /* Select the sort method */
5867 ang_sort_comp = ang_sort_comp_hook;
5868 ang_sort_swap = ang_sort_swap_hook;
5870 /* Sort the array by dungeon depth of monsters */
5871 ang_sort(who, &why, n);
5873 /* Scan the monster races */
5874 for (k = 0; k < n; k++)
5876 monster_race *r_ptr = &r_info[who[k]];
5878 /* Only print Uniques */
5879 if (r_ptr->flags1 & (RF1_UNIQUE))
5881 bool dead = (r_ptr->max_num == 0);
5885 /* Only display "known" uniques */
5886 if (dead || cheat_know || r_ptr->r_sights)
5888 /* Print a message */
5890 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5891 (r_name + r_ptr->name));
5893 fprintf(fff, " %s is alive\n",
5894 (r_name + r_ptr->name));
5901 /* Free the "who" array */
5902 C_KILL(who, max_r_idx, s16b);
5904 /* Close the file */
5907 /* Display the file contents */
5909 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5911 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5915 /* Remove the file */
5921 * Display dead uniques
5923 static void do_cmd_knowledge_uniques_dead(void)
5931 char file_name[1024];
5933 /* Open a new file */
5934 fff = my_fopen_temp(file_name, 1024);
5938 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5940 msg_format("Failed to create temporary file %s.", file_name);
5946 /* Allocate the "who" array */
5947 C_MAKE(who, max_r_idx, s16b);
5949 /* Scan the monsters */
5950 for (i = 1; i < max_r_idx; i++)
5952 monster_race *r_ptr = &r_info[i];
5954 /* Use that monster */
5955 if (r_ptr->name) who[n++] = i;
5958 /* Select the sort method */
5959 ang_sort_comp = ang_sort_comp_hook;
5960 ang_sort_swap = ang_sort_swap_hook;
5962 /* Sort the array by dungeon depth of monsters */
5963 ang_sort(who, &why, n);
5965 /* Scan the monster races */
5966 for (k = 0; k < n; k++)
5968 monster_race *r_ptr = &r_info[who[k]];
5970 /* Only print Uniques */
5971 if (r_ptr->flags1 & (RF1_UNIQUE))
5973 bool dead = (r_ptr->max_num == 0);
5975 if (!dead) continue;
5977 /* Only display "known" uniques */
5978 if (dead || cheat_know || r_ptr->r_sights)
5980 /* Print a message */
5982 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5983 (r_name + r_ptr->name));
5985 fprintf(fff, " %s is dead\n",
5986 (r_name + r_ptr->name));
5993 /* Free the "who" array */
5994 C_KILL(who, max_r_idx, s16b);
5996 /* Close the file */
5999 /* Display the file contents */
6001 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6003 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
6007 /* Remove the file */
6013 * Display weapon-exp
6015 static void do_cmd_knowledge_weapon_exp(void)
6017 int i,j, num, shougou;
6021 char file_name[1024];
6024 /* Open a new file */
6025 fff = my_fopen_temp(file_name, 1024);
6028 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6030 msg_format("Failed to create temporary file %s.", file_name);
6036 for(i = 0; i < 5; i++)
6038 for (num = 0; num < 64; num++)
6040 for (j = 0; j < max_k_idx; j++)
6042 object_kind *k_ptr = &k_info[j];
6044 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6046 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6048 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6049 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6050 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6051 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6054 fprintf(fff,"%-25s ",tmp);
6055 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6056 else fprintf(fff," ");
6057 fprintf(fff,"%s",shougou_moji[shougou]);
6058 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6066 /* Close the file */
6069 /* Display the file contents */
6071 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6073 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6077 /* Remove the file */
6085 static void do_cmd_knowledge_spell_exp(void)
6092 char file_name[1024];
6094 /* Open a new file */
6095 fff = my_fopen_temp(file_name, 1024);
6098 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6100 msg_format("Failed to create temporary file %s.", file_name);
6106 if(p_ptr->realm1 != REALM_NONE)
6109 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6111 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6113 for (i = 0; i < 32; i++)
6115 if (!is_magic(p_ptr->realm1))
6117 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6121 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6123 if(s_ptr->slevel == 99) continue;
6124 if(p_ptr->spell_exp[i]<900) shougou=0;
6125 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6126 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6127 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6129 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6130 if (p_ptr->realm1 == REALM_HISSATSU)
6131 fprintf(fff,"[--]");
6134 if (shougou == 4) fprintf(fff,"!");
6135 else fprintf(fff," ");
6136 fprintf(fff,"%s",shougou_moji[shougou]);
6138 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6143 if(p_ptr->realm2 != REALM_NONE)
6145 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6146 for (i = 0; i < 32; i++)
6148 if (!is_magic(p_ptr->realm1))
6150 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6154 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6156 if(s_ptr->slevel == 99) continue;
6158 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6159 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6160 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6162 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6163 if (shougou == 3) fprintf(fff,"!");
6164 else fprintf(fff," ");
6165 fprintf(fff,"%s",shougou_moji[shougou]);
6166 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6171 /* Close the file */
6174 /* Display the file contents */
6176 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6178 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6182 /* Remove the file */
6190 static void do_cmd_knowledge_skill_exp(void)
6196 char file_name[1024];
6198 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6200 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6203 /* Open a new file */
6204 fff = my_fopen_temp(file_name, 1024);
6207 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6209 msg_format("Failed to create temporary file %s.", file_name);
6215 for (i = 0; i < 3; i++)
6217 if(i == GINOU_RIDING)
6219 if(p_ptr->skill_exp[i]<500) shougou=0;
6220 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6221 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6222 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6227 if(p_ptr->skill_exp[i]<4000) shougou=0;
6228 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6229 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6230 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6233 fprintf(fff,"%-20s ",skill_name[i]);
6234 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6235 else fprintf(fff," ");
6236 fprintf(fff,"%s",shougou_moji[shougou]);
6237 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6241 /* Close the file */
6244 /* Display the file contents */
6246 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6248 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6252 /* Remove the file */
6258 * Pluralize a monster name
6260 void plural_aux(char *Name)
6262 int NameLen = strlen(Name);
6264 if (strstr(Name, "Disembodied hand"))
6266 strcpy(Name, "Disembodied hands that strangled people");
6268 else if (strstr(Name, "Colour out of space"))
6270 strcpy(Name, "Colours out of space");
6272 else if (strstr(Name, "stairway to hell"))
6274 strcpy(Name, "stairways to hell");
6276 else if (strstr(Name, "Dweller on the threshold"))
6278 strcpy(Name, "Dwellers on the threshold");
6280 else if (strstr(Name, " of "))
6282 cptr aider = strstr(Name, " of ");
6293 if (dummy[i-1] == 's')
6295 strcpy(&(dummy[i]), "es");
6300 strcpy(&(dummy[i]), "s");
6303 strcpy(&(dummy[i+1]), aider);
6304 strcpy(Name, dummy);
6306 else if (strstr(Name, "coins"))
6309 strcpy(dummy, "piles of ");
6310 strcat(dummy, Name);
6311 strcpy(Name, dummy);
6314 else if (strstr(Name, "Manes"))
6318 else if (streq(&(Name[NameLen - 2]), "ey"))
6320 strcpy(&(Name[NameLen - 2]), "eys");
6322 else if (Name[NameLen - 1] == 'y')
6324 strcpy(&(Name[NameLen - 1]), "ies");
6326 else if (streq(&(Name[NameLen - 4]), "ouse"))
6328 strcpy(&(Name[NameLen - 4]), "ice");
6330 else if (streq(&(Name[NameLen - 2]), "us"))
6332 strcpy(&(Name[NameLen - 2]), "i");
6334 else if (streq(&(Name[NameLen - 6]), "kelman"))
6336 strcpy(&(Name[NameLen - 6]), "kelmen");
6338 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6340 strcpy(&(Name[NameLen - 8]), "wordsmen");
6342 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6344 strcpy(&(Name[NameLen - 7]), "oodsmen");
6346 else if (streq(&(Name[NameLen - 7]), "eastman"))
6348 strcpy(&(Name[NameLen - 7]), "eastmen");
6350 else if (streq(&(Name[NameLen - 8]), "izardman"))
6352 strcpy(&(Name[NameLen - 8]), "izardmen");
6354 else if (streq(&(Name[NameLen - 5]), "geist"))
6356 strcpy(&(Name[NameLen - 5]), "geister");
6358 else if (streq(&(Name[NameLen - 2]), "ex"))
6360 strcpy(&(Name[NameLen - 2]), "ices");
6362 else if (streq(&(Name[NameLen - 2]), "lf"))
6364 strcpy(&(Name[NameLen - 2]), "lves");
6366 else if (suffix(Name, "ch") ||
6367 suffix(Name, "sh") ||
6368 suffix(Name, "nx") ||
6369 suffix(Name, "s") ||
6372 strcpy(&(Name[NameLen]), "es");
6376 strcpy(&(Name[NameLen]), "s");
6381 * Display current pets
6383 static void do_cmd_knowledge_pets(void)
6387 monster_type *m_ptr;
6389 int show_upkeep = 0;
6390 char file_name[1024];
6393 /* Open a new file */
6394 fff = my_fopen_temp(file_name, 1024);
6397 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6399 msg_format("Failed to create temporary file %s.", file_name);
6405 /* Process the monsters (backwards) */
6406 for (i = m_max - 1; i >= 1; i--)
6408 monster_race *r_ptr;
6409 /* Access the monster */
6412 /* Ignore "dead" monsters */
6413 if (!m_ptr->r_idx) continue;
6414 r_ptr = &r_info[m_ptr->r_idx];
6416 /* Calculate "upkeep" for pets */
6421 monster_desc(pet_name, m_ptr, 0x88);
6422 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6423 if (p_ptr->riding == i)
6425 fprintf(fff, " ¾èÇÏÃæ");
6427 fprintf(fff, " Riding");
6433 show_upkeep = calculate_upkeep();
6435 fprintf(fff, "----------------------------------------------\n");
6437 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6438 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6440 fprintf(fff, " Total: %d pet%s.\n",
6441 t_friends, (t_friends == 1 ? "" : "s"));
6442 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6447 /* Close the file */
6450 /* Display the file contents */
6452 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6454 show_file(TRUE, file_name, "Current Pets", 0, 0);
6458 /* Remove the file */
6466 * Note that the player ghosts are ignored. XXX XXX XXX
6468 static void do_cmd_knowledge_kill_count(void)
6476 char file_name[1024];
6481 /* Open a new file */
6482 fff = my_fopen_temp(file_name, 1024);
6486 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6488 msg_format("Failed to create temporary file %s.", file_name);
6494 /* Allocate the "who" array */
6495 C_MAKE(who, max_r_idx, s16b);
6498 /* Monsters slain */
6501 for (kk = 1; kk < max_r_idx; kk++)
6503 monster_race *r_ptr = &r_info[kk];
6505 if (r_ptr->flags1 & (RF1_UNIQUE))
6507 bool dead = (r_ptr->max_num == 0);
6516 s16b This = r_ptr->r_pkills;
6527 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6529 fprintf(fff,"You have defeated no enemies yet.\n\n");
6532 else if (Total == 1)
6534 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6536 fprintf(fff,"You have defeated one enemy.\n\n");
6541 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6543 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6550 /* Scan the monsters */
6551 for (i = 1; i < max_r_idx; i++)
6553 monster_race *r_ptr = &r_info[i];
6555 /* Use that monster */
6556 if (r_ptr->name) who[n++] = i;
6559 /* Select the sort method */
6560 ang_sort_comp = ang_sort_comp_hook;
6561 ang_sort_swap = ang_sort_swap_hook;
6563 /* Sort the array by dungeon depth of monsters */
6564 ang_sort(who, &why, n);
6566 /* Scan the monster races */
6567 for (k = 0; k < n; k++)
6569 monster_race *r_ptr = &r_info[who[k]];
6571 if (r_ptr->flags1 & (RF1_UNIQUE))
6573 bool dead = (r_ptr->max_num == 0);
6577 /* Print a message */
6578 fprintf(fff, " %s\n",
6579 (r_name + r_ptr->name));
6585 s16b This = r_ptr->r_pkills;
6590 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6591 if(strchr("pt",r_ptr->d_char))
6592 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6594 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6598 if (strstr(r_name + r_ptr->name, "coins"))
6600 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6604 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6610 strcpy(ToPlural, (r_name + r_ptr->name));
6611 plural_aux(ToPlural);
6612 fprintf(fff, " %d %s\n", This, ToPlural);
6622 fprintf(fff,"----------------------------------------------\n");
6624 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6626 fprintf(fff," Total: %lu creature%s killed.\n",
6627 Total, (Total == 1 ? "" : "s"));
6631 /* Free the "who" array */
6632 C_KILL(who, max_r_idx, s16b);
6634 /* Close the file */
6637 /* Display the file contents */
6639 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6641 show_file(TRUE, file_name, "Kill Count", 0, 0);
6645 /* Remove the file */
6651 * Display known objects
6653 static void do_cmd_knowledge_objects(void)
6659 char o_name[MAX_NLEN];
6661 char file_name[1024];
6664 /* Open a new file */
6665 fff = my_fopen_temp(file_name, 1024);
6668 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6670 msg_format("Failed to create temporary file %s.", file_name);
6676 /* Scan the object kinds */
6677 for (k = 1; k < max_k_idx; k++)
6679 object_kind *k_ptr = &k_info[k];
6681 /* Hack -- skip artifacts */
6682 if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
6684 /* List known flavored objects */
6685 if (k_ptr->flavor && k_ptr->aware)
6688 object_type object_type_body;
6690 /* Get local object */
6691 i_ptr = &object_type_body;
6693 /* Create fake object */
6694 object_prep(i_ptr, k);
6696 /* Describe the object */
6697 object_desc_store(o_name, i_ptr, FALSE, 0);
6699 /* Print a message */
6700 fprintf(fff, " %s\n", o_name);
6704 /* Close the file */
6707 /* Display the file contents */
6709 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6711 show_file(TRUE, file_name, "Known Objects", 0, 0);
6715 /* Remove the file */
6721 * List virtues & status
6724 static void do_cmd_knowledge_kubi(void)
6729 char file_name[1024];
6732 /* Open a new file */
6733 fff = my_fopen_temp(file_name, 1024);
6736 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6738 msg_format("Failed to create temporary file %s.", file_name);
6747 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6749 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6751 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6753 fprintf(fff, "List of wanted monsters\n");
6755 for (i = 0; i < MAX_KUBI; i++)
6757 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6758 if (kubi_r_idx[i] > 10000)
6760 fprintf(fff, "ºÑ\n");
6762 fprintf(fff, "done\n");
6765 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6769 /* Close the file */
6772 /* Display the file contents */
6774 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6776 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6780 /* Remove the file */
6785 * List virtues & status
6788 static void do_cmd_knowledge_virtues(void)
6792 char file_name[1024];
6795 /* Open a new file */
6796 fff = my_fopen_temp(file_name, 1024);
6799 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6801 msg_format("Failed to create temporary file %s.", file_name);
6810 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6812 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6817 /* Close the file */
6820 /* Display the file contents */
6822 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6824 show_file(TRUE, file_name, "Virtues", 0, 0);
6828 /* Remove the file */
6836 static void do_cmd_knowledge_dungeon(void)
6840 char file_name[1024];
6844 /* Open a new file */
6845 fff = my_fopen_temp(file_name, 1024);
6848 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6850 msg_format("Failed to create temporary file %s.", file_name);
6858 for (i = 1; i < max_d_idx; i++)
6862 if (!d_info[i].maxdepth) continue;
6863 if (!max_dlv[i]) continue;
6864 if (d_info[i].final_guardian)
6866 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6868 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6870 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6872 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6877 /* Close the file */
6880 /* Display the file contents */
6882 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6884 show_file(TRUE, file_name, "Dungeon", 0, 0);
6888 /* Remove the file */
6893 * List virtues & status
6896 static void do_cmd_knowledge_stat(void)
6900 char file_name[1024];
6903 /* Open a new file */
6904 fff = my_fopen_temp(file_name, 1024);
6907 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6909 msg_format("Failed to create temporary file %s.", file_name);
6917 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
6918 (2 * p_ptr->hitdie +
6919 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6922 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6923 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6924 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6926 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6927 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6928 fprintf(fff, "Limits of maximum stats\n\n");
6930 for (v_nr = 0; v_nr < 6; v_nr++)
6932 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);
6933 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6939 /* Close the file */
6942 /* Display the file contents */
6944 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6946 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6950 /* Remove the file */
6955 * Print quest status of all active quests
6957 static void do_cmd_knowledge_quests(void)
6960 char file_name[1024];
6962 char rand_tmp_str[120] = "\0";
6964 monster_race *r_ptr;
6966 int rand_level = 100;
6969 /* Open a new file */
6970 fff = my_fopen_temp(file_name, 1024);
6973 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6975 msg_format("Failed to create temporary file %s.", file_name);
6982 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6984 fprintf(fff, "< Current Quest >\n");
6987 for (i = 1; i < max_quests; i++)
6989 /* No info from "silent" quests */
6990 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6992 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6997 /* Clear the text */
6998 for (j = 0; j < 10; j++)
7000 quest_text[j][0] = '\0';
7003 quest_text_line = 0;
7007 /* Set the quest number temporary */
7008 old_quest = p_ptr->inside_quest;
7009 p_ptr->inside_quest = i;
7011 /* Get the quest text */
7012 init_flags = INIT_SHOW_TEXT;
7014 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7016 /* Reset the old quest number */
7017 p_ptr->inside_quest = old_quest;
7019 if (quest[i].type != QUEST_TYPE_RANDOM)
7021 char note[80] = "\0";
7023 if (quest[i].status == QUEST_STATUS_TAKEN)
7025 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
7027 r_ptr = &r_info[quest[i].r_idx];
7028 strcpy(name, r_name + r_ptr->name);
7029 if (quest[i].max_num > 1)
7032 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7035 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
7040 sprintf(note," - %s¤òÅݤ¹¡£",name);
7042 sprintf(note," - kill %s.",name);
7045 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
7048 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
7050 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
7053 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
7055 strcpy(name, a_name + a_info[quest[i].k_idx].name);
7057 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
7059 sprintf(note," - Find out %s.", name);
7062 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
7064 sprintf(note," - õº÷¤¹¤ë¡£");
7066 sprintf(note," - Search.");
7068 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
7070 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
7072 sprintf(note," - Kill all monsters.");
7076 /* Print the quest info */
7078 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
7080 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
7083 quest[i].name, quest[i].level, note);
7085 fprintf(fff, tmp_str);
7087 if (quest[i].status == QUEST_STATUS_COMPLETED)
7090 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
7092 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
7096 fprintf(fff, tmp_str);
7102 while (quest_text[j][0] && j < 10)
7104 fprintf(fff, " %s\n", quest_text[j]);
7109 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
7110 (quest[i].level < rand_level))
7113 rand_level = quest[i].level;
7115 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
7117 /* Print the quest info */
7118 r_ptr = &r_info[quest[i].r_idx];
7119 strcpy(name, r_name + r_ptr->name);
7121 if (quest[i].max_num > 1)
7124 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
7125 quest[i].name, quest[i].level,
7126 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7130 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
7131 quest[i].name, quest[i].level,
7132 quest[i].max_num, name, quest[i].cur_num);
7139 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
7141 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
7144 quest[i].name, quest[i].level, name);
7151 /* Print the current random quest */
7152 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
7155 if (!total) fprintf(fff, "¤Ê¤·\n");
7157 if (!total) fprintf(fff, "Nothing.\n");
7161 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7163 fprintf(fff, "\n< Completed Quest >\n");
7166 for (i = 1; i < max_quests; i++)
7168 /* No info from "silent" quests */
7169 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7171 if (quest[i].status == QUEST_STATUS_FINISHED)
7177 if (i < MIN_RANDOM_QUEST)
7179 /* Set the quest number temporary */
7180 old_quest = p_ptr->inside_quest;
7181 p_ptr->inside_quest = i;
7184 init_flags = INIT_ASSIGN;
7186 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7188 /* Reset the old quest number */
7189 p_ptr->inside_quest = old_quest;
7192 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7194 /* Print the quest info */
7196 if (quest[i].complev == 0)
7200 "%s (%d³¬) - ÉÔÀᄀ\n",
7202 "%s (Dungeon level: %d) - (Cancelled)\n",
7204 r_name+r_info[quest[i].r_idx].name,
7211 "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7213 "%s (Dungeon level: %d) - level %d\n",
7215 r_name+r_info[quest[i].r_idx].name,
7222 /* Print the quest info */
7224 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7226 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7229 quest[i].name, quest[i].level, quest[i].complev);
7232 fprintf(fff, tmp_str);
7236 if (!total) fprintf(fff, "¤Ê¤·\n");
7238 if (!total) fprintf(fff, "Nothing.\n");
7242 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7244 fprintf(fff, "\n< Failed Quest >\n");
7247 for (i = 1; i < max_quests; i++)
7249 /* No info from "silent" quests */
7250 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7252 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7258 if (i < MIN_RANDOM_QUEST)
7260 /* Set the quest number temporary */
7261 old_quest = p_ptr->inside_quest;
7262 p_ptr->inside_quest = i;
7264 /* Get the quest text */
7265 init_flags = INIT_ASSIGN;
7267 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7269 /* Reset the old quest number */
7270 p_ptr->inside_quest = old_quest;
7273 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7275 /* Print the quest info */
7277 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7279 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7282 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7286 /* Print the quest info */
7288 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7290 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7293 quest[i].name, quest[i].level, quest[i].complev);
7295 fprintf(fff, tmp_str);
7299 if (!total) fprintf(fff, "¤Ê¤·\n");
7301 if (!total) fprintf(fff, "Nothing.\n");
7304 if (p_ptr->wizard) {
7306 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7308 fprintf(fff, "\n< Remaining Random Quest >\n");
7311 for (i = 1; i < max_quests; i++)
7313 /* No info from "silent" quests */
7314 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7316 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7320 /* Print the quest info */
7322 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7324 sprintf(tmp_str, "%s (%d, %s)\n",
7327 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7328 fprintf(fff, tmp_str);
7332 if (!total) fprintf(fff, "¤Ê¤·\n");
7334 if (!total) fprintf(fff, "Nothing.\n");
7338 /* Close the file */
7341 /* Display the file contents */
7343 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7345 show_file(TRUE, file_name, "Quest status", 0, 0);
7349 /* Remove the file */
7359 static void do_cmd_knowledge_home(void)
7364 char file_name[1024];
7366 char o_name[MAX_NLEN];
7369 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7371 /* Open a new file */
7372 fff = my_fopen_temp(file_name, 1024);
7375 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7377 msg_format("Failed to create temporary file %s.", file_name);
7385 /* Print all homes in the different towns */
7386 st_ptr = &town[1].store[STORE_HOME];
7388 /* Home -- if anything there */
7389 if (st_ptr->stock_num)
7391 /* Header with name of the town */
7393 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7395 fprintf(fff, " [Home Inventory]\n");
7399 /* Dump all available items */
7400 for (i = 0; i < st_ptr->stock_num; i++)
7403 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7404 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7405 if (strlen(o_name) <= 80-3)
7407 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7413 for (n = 0, t = o_name; n < 80-3; n++, t++)
7414 if(iskanji(*t)) {t++; n++;}
7415 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7417 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7418 fprintf(fff, " %.77s\n", o_name+n);
7421 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7422 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7427 /* Add an empty line */
7428 fprintf(fff, "\n\n");
7432 /* Close the file */
7435 /* Display the file contents */
7437 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7439 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7443 /* Remove the file */
7449 * Check the status of "autopick"
7451 static void do_cmd_knowledge_autopick(void)
7455 char file_name[1024];
7457 /* Open a new file */
7458 fff = my_fopen_temp(file_name, 1024);
7463 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7465 msg_format("Failed to create temporary file %s.", file_name);
7474 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7476 fprintf(fff, "No preference for auto picker/destroyer.");
7482 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7484 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7488 for (k = 0; k < max_autopick; k++)
7491 byte act = autopick_list[k].action;
7492 if (act & DONT_AUTOPICK)
7500 else if (act & DO_AUTODESTROY)
7517 if (act & DO_DISPLAY)
7518 fprintf(fff, "%11s", format("[%s]", tmp));
7520 fprintf(fff, "%11s", format("(%s)", tmp));
7522 tmp = autopick_line_from_entry(&autopick_list[k]);
7523 fprintf(fff, " %s", tmp);
7527 /* Close the file */
7529 /* Display the file contents */
7531 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7533 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7536 /* Remove the file */
7542 * Interact with "knowledge"
7544 void do_cmd_knowledge(void)
7547 /* File type is "TEXT" */
7548 FILE_TYPE(FILE_TYPE_TEXT);
7549 /* Save the screen */
7551 /* Interact until done */
7556 /* Ask for a choice */
7558 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7559 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7561 prt(format("page %d/2", (p+1)), 2, 65);
7562 prt("Display current knowledge", 3, 0);
7565 /* Give some choices */
7568 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7569 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7570 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7571 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7572 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7573 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7574 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7575 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7576 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7578 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7579 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7580 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7581 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7582 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7583 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7584 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7585 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7586 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7590 prt("(1) Display known artifacts", 6, 5);
7591 prt("(2) Display known objects", 7, 5);
7592 prt("(3) Display remaining uniques", 8, 5);
7593 prt("(4) Display dead uniques", 9, 5);
7594 prt("(5) Display kill count", 10, 5);
7595 prt("(6) Display wanted monsters", 11, 5);
7596 prt("(7) Display current pets", 12, 5);
7597 prt("(8) Display home inventory", 13, 5);
7598 prt("(9) Display *identified* equip.", 14, 5);
7600 prt("(a) Display about yourself", 6, 5);
7601 prt("(b) Display mutations", 7, 5);
7602 prt("(c) Display weapon proficiency", 8, 5);
7603 prt("(d) Display spell proficiency", 9, 5);
7604 prt("(e) Display misc. proficiency", 10, 5);
7605 prt("(f) Display virtues", 11, 5);
7606 prt("(g) Display dungeons", 12, 5);
7607 prt("(h) Display current quests", 13, 5);
7608 prt("(i) Display auto pick/destroy", 14, 5);
7613 prt("-³¤¯-", 16, 8);
7614 prt("ESC) È´¤±¤ë", 21, 1);
7615 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7616 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7617 prt("¥³¥Þ¥ó¥É:", 20, 0);
7619 prt("-more-", 16, 8);
7620 prt("ESC) Exit menu", 21, 1);
7621 prt("SPACE) Next page", 21, 30);
7622 /*prt("-) Previous page", 21, 60);*/
7623 prt("Command: ", 20, 0);
7629 if (i == ESCAPE) break;
7632 case ' ': /* Page change */
7636 case '1': /* Artifacts */
7637 do_cmd_knowledge_artifacts();
7639 case '2': /* Objects */
7640 do_cmd_knowledge_objects();
7642 case '3': /* Uniques */
7643 do_cmd_knowledge_uniques();
7645 case '4': /* Uniques */
7646 do_cmd_knowledge_uniques_dead();
7648 case '5': /* Kill count */
7649 do_cmd_knowledge_kill_count();
7651 case '6': /* wanted */
7652 do_cmd_knowledge_kubi();
7654 case '7': /* Pets */
7655 do_cmd_knowledge_pets();
7657 case '8': /* Home */
7658 do_cmd_knowledge_home();
7660 case '9': /* Resist list */
7661 do_cmd_knowledge_inven();
7664 case 'a': /* Max stat */
7665 do_cmd_knowledge_stat();
7667 case 'b': /* Mutations */
7668 do_cmd_knowledge_mutations();
7670 case 'c': /* weapon-exp */
7671 do_cmd_knowledge_weapon_exp();
7673 case 'd': /* spell-exp */
7674 do_cmd_knowledge_spell_exp();
7676 case 'e': /* skill-exp */
7677 do_cmd_knowledge_skill_exp();
7679 case 'f': /* Virtues */
7680 do_cmd_knowledge_virtues();
7682 case 'g': /* Dungeon */
7683 do_cmd_knowledge_dungeon();
7685 case 'h': /* Quests */
7686 do_cmd_knowledge_quests();
7688 case 'i': /* Autopick */
7689 do_cmd_knowledge_autopick();
7691 default: /* Unknown option */
7694 /* Flush messages */
7697 /* Restore the screen */
7703 * Check on the status of an active quest
7705 void do_cmd_checkquest(void)
7707 /* File type is "TEXT" */
7708 FILE_TYPE(FILE_TYPE_TEXT);
7710 /* Save the screen */
7714 do_cmd_knowledge_quests();
7716 /* Restore the screen */
7722 * Display the time and date
7724 void do_cmd_time(void)
7726 int day, hour, min, full, start, end, num;
7733 extract_day_hour_min(&day, &hour, &min);
7735 full = hour * 100 + min;
7743 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7745 strcpy(desc, "It is a strange time.");
7751 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7753 msg_format("This is day %d. The time is %d:%02d %s.",
7756 day, (hour % 12 == 0) ? 12 : (hour % 12),
7757 min, (hour < 12) ? "AM" : "PM");
7760 if (!randint0(10) || p_ptr->image)
7763 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
7765 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
7772 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
7774 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
7779 /* Open this file */
7780 fff = my_fopen(buf, "rt");
7785 /* Find this time */
7786 while (!my_fgets(fff, buf, sizeof(buf)))
7788 /* Ignore comments */
7789 if (!buf[0] || (buf[0] == '#')) continue;
7791 /* Ignore invalid lines */
7792 if (buf[1] != ':') continue;
7794 /* Process 'Start' */
7797 /* Extract the starting time */
7798 start = atoi(buf + 2);
7800 /* Assume valid for an hour */
7810 /* Extract the ending time */
7811 end = atoi(buf + 2);
7817 /* Ignore incorrect range */
7818 if ((start > full) || (full > end)) continue;
7820 /* Process 'Description' */
7825 /* Apply the randomizer */
7826 if (!randint0(num)) strcpy(desc, buf + 2);
7836 /* Close the file */