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 */
1499 /* Prompt XXX XXX XXX */
1501 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1503 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1509 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1510 prt(" << Ãí°Õ >>", 11, 0);
1511 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1512 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1513 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1515 /* Display the options */
1516 for (i = 0; i < n; i++)
1518 byte a = TERM_WHITE;
1520 /* Color current option */
1521 if (i == k) a = TERM_L_BLUE;
1523 /* Display the option text */
1524 sprintf(buf, "%-48s: %s (%s)",
1525 cheat_info[i].o_desc,
1527 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1529 (*cheat_info[i].o_var ? "yes" : "no "),
1532 cheat_info[i].o_text);
1533 c_prt(a, buf, i + 2, 0);
1536 /* Hilite current option */
1537 move_cursor(k + 2, 50);
1553 k = (n + k - 1) % n;
1572 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1574 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1576 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1577 (*cheat_info[k].o_var) = TRUE;
1586 (*cheat_info[k].o_var) = FALSE;
1601 static option_type autosave_info[2] =
1603 { &autosave_l, FALSE, 255, 0x01, 0x00,
1605 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1607 "autosave_l", "Autosave when entering new levels" },
1611 { &autosave_t, FALSE, 255, 0x02, 0x00,
1613 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1615 "autosave_t", "Timed autosave" },
1621 static s16b toggle_frequency(s16b current)
1623 if (current == 0) return 50;
1624 if (current == 50) return 100;
1625 if (current == 100) return 250;
1626 if (current == 250) return 500;
1627 if (current == 500) return 1000;
1628 if (current == 1000) return 2500;
1629 if (current == 2500) return 5000;
1630 if (current == 5000) return 10000;
1631 if (current == 10000) return 25000;
1638 * Interact with some options for cheating
1640 static void do_cmd_options_autosave(cptr info)
1644 int i, k = 0, n = 2;
1652 /* Interact with the player */
1655 /* Prompt XXX XXX XXX */
1657 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1659 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1664 /* Display the options */
1665 for (i = 0; i < n; i++)
1667 byte a = TERM_WHITE;
1669 /* Color current option */
1670 if (i == k) a = TERM_L_BLUE;
1672 /* Display the option text */
1673 sprintf(buf, "%-48s: %s (%s)",
1674 autosave_info[i].o_desc,
1676 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1678 (*autosave_info[i].o_var ? "yes" : "no "),
1681 autosave_info[i].o_text);
1682 c_prt(a, buf, i + 2, 0);
1686 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1688 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1693 /* Hilite current option */
1694 move_cursor(k + 2, 50);
1710 k = (n + k - 1) % n;
1728 (*autosave_info[k].o_var) = TRUE;
1737 (*autosave_info[k].o_var) = FALSE;
1745 autosave_freq = toggle_frequency(autosave_freq);
1747 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1749 prt(format("Timed autosave frequency: every %d turns",
1752 autosave_freq), 5, 0);
1765 #define PAGE_AUTODESTROY 7
1768 * Interact with some options
1770 void do_cmd_options_aux(int page, cptr info)
1773 int i, k = 0, n = 0, l;
1778 /* Lookup the options */
1779 for (i = 0; i < 24; i++) opt[i] = 0;
1781 /* Scan the options */
1782 for (i = 0; option_info[i].o_desc; i++)
1784 /* Notice options on this "page" */
1785 if (option_info[i].o_page == page) opt[n++] = i;
1793 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
1795 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
1798 /* Interact with the player */
1801 /* Prompt XXX XXX XXX */
1803 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1805 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1810 /* Display the options */
1811 for (i = 0; i < n; i++)
1813 byte a = TERM_WHITE;
1815 /* Color current option */
1816 if (i == k) a = TERM_L_BLUE;
1818 /* Display the option text */
1819 sprintf(buf, "%-48s: %s (%.19s)",
1820 option_info[opt[i]].o_desc,
1822 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1824 (*option_info[opt[i]].o_var ? "yes" : "no "),
1827 option_info[opt[i]].o_text);
1828 if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1829 else c_prt(a, buf, i + 2, 0);
1832 if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3;
1834 /* Hilite current option */
1835 move_cursor(k + 2 + l, 50);
1853 k = (n + k - 1) % n;
1874 (*option_info[opt[k]].o_var) = TRUE;
1885 (*option_info[opt[k]].o_var) = FALSE;
1893 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1908 * Modify the "window" options
1910 static void do_cmd_options_win(void)
1924 /* Memorize old flags */
1925 for (j = 0; j < 8; j++)
1927 /* Acquire current flags */
1928 old_flag[j] = window_flag[j];
1938 /* Prompt XXX XXX XXX */
1940 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1942 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1946 /* Display the windows */
1947 for (j = 0; j < 8; j++)
1949 byte a = TERM_WHITE;
1951 cptr s = angband_term_name[j];
1954 if (j == x) a = TERM_L_BLUE;
1956 /* Window name, staggered, centered */
1957 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1960 /* Display the options */
1961 for (i = 0; i < 16; i++)
1963 byte a = TERM_WHITE;
1965 cptr str = window_flag_desc[i];
1968 if (i == y) a = TERM_L_BLUE;
1972 if (!str) str = "(̤»ÈÍÑ)";
1974 if (!str) str = "(Unused option)";
1979 Term_putstr(0, i + 5, -1, a, str);
1981 /* Display the windows */
1982 for (j = 0; j < 8; j++)
1984 byte a = TERM_WHITE;
1989 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1992 if (window_flag[j] & (1L << i)) c = 'X';
1995 Term_putch(35 + j * 5, i + 5, a, c);
2000 Term_gotoxy(35 + x * 5, y + 5);
2018 for (j = 0; j < 8; j++)
2020 window_flag[j] &= ~(1L << y);
2024 for (i = 0; i < 16; i++)
2026 window_flag[x] &= ~(1L << i);
2039 window_flag[x] |= (1L << y);
2047 window_flag[x] &= ~(1L << y);
2053 d = get_keymap_dir(ch);
2055 x = (x + ddx[d] + 8) % 8;
2056 y = (y + ddy[d] + 16) % 16;
2063 /* Notice changes */
2064 for (j = 0; j < 8; j++)
2069 if (!angband_term[j]) continue;
2071 /* Ignore non-changes */
2072 if (window_flag[j] == old_flag[j]) continue;
2075 Term_activate(angband_term[j]);
2092 * Set or unset various options.
2094 * The user must use the "Ctrl-R" command to "adapt" to changes
2095 * in any options which control "visual" aspects of the game.
2097 void do_cmd_options(void)
2102 /* Save the screen */
2112 /* Why are we here */
2114 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2116 prt("Options", 2, 0);
2120 /* Give some choices */
2122 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2123 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2124 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2125 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2126 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2127 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2128 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2129 /* Special choices */
2130 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2131 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2132 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2134 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2136 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2138 prt("(1) Input Options", 4, 5);
2139 prt("(2) Output Options", 5, 5);
2140 prt("(3) Game-Play Options", 6, 5);
2141 prt("(4) Disturbance Options", 7, 5);
2142 prt("(5) Efficiency Options", 8, 5);
2143 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2144 prt("(R) Play-record Options", 10, 5);
2146 /* Special choices */
2147 prt("(D) Base Delay Factor", 12, 5);
2148 prt("(H) Hitpoint Warning", 13, 5);
2149 prt("(A) Autosave Options", 14, 5);
2153 prt("(W) Window Flags", 15, 5);
2156 prt("(C) Cheating Options", 16, 5);
2162 prt("¥³¥Þ¥ó¥É:", 18, 0);
2164 prt("Command: ", 18, 0);
2172 if (k == ESCAPE) break;
2177 /* General Options */
2180 /* Process the general options */
2182 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2184 do_cmd_options_aux(1, "Input Options");
2190 /* General Options */
2193 /* Process the general options */
2195 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2197 do_cmd_options_aux(2, "Output Options");
2203 /* Inventory Options */
2208 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2210 do_cmd_options_aux(3, "Game-Play Options");
2216 /* Disturbance Options */
2221 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2223 do_cmd_options_aux(4, "Disturbance Options");
2229 /* Efficiency Options */
2234 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2236 do_cmd_options_aux(5, "Efficiency Options");
2242 /* Object auto-destruction Options */
2247 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2249 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2254 /* Play-record Options */
2260 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2262 do_cmd_options_aux(10, "Play-record Option");
2267 /* Cheating Options */
2272 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2274 do_cmd_options_cheat("Cheaters never win");
2284 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2286 do_cmd_options_autosave("Autosave");
2297 do_cmd_options_win();
2298 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2299 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2300 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2301 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2305 /* Hack -- Delay Speed */
2311 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2313 prt("Command: Base Delay Factor", 18, 0);
2317 /* Get a new value */
2320 int msec = delay_factor * delay_factor * delay_factor;
2322 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2324 prt(format("Current base delay factor: %d (%d msec)",
2327 delay_factor, msec), 22, 0);
2329 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2331 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2335 if (k == ESCAPE) break;
2336 if (isdigit(k)) delay_factor = D2I(k);
2343 /* Hack -- hitpoint warning factor */
2349 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2351 prt("Command: Hitpoint Warning", 18, 0);
2355 /* Get a new value */
2359 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2360 hitpoint_warn), 22, 0);
2362 prt(format("Current hitpoint warning: %d0%%",
2363 hitpoint_warn), 22, 0);
2367 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2369 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2373 if (k == ESCAPE) break;
2374 if (isdigit(k)) hitpoint_warn = D2I(k);
2381 /* Unknown option */
2390 /* Flush messages */
2395 /* Restore the screen */
2398 /* Hack - Redraw equippy chars */
2399 p_ptr->redraw |= (PR_EQUIPPY);
2405 * Ask for a "user pref line" and process it
2407 * XXX XXX XXX Allow absolute file names?
2409 void do_cmd_pref(void)
2416 /* Ask for a "user pref command" */
2418 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2420 if (!get_string("Pref: ", buf, 80)) return;
2424 /* Process that pref command */
2425 (void)process_pref_file_command(buf);
2428 void do_cmd_pickpref(void)
2434 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2436 if(!get_check("Reload auto-pick preference file? ")) return;
2439 /* Free old entries */
2442 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2444 sprintf(buf, "picktype-%s.prf", player_name);
2446 sprintf(buf, "pickpref-%s.prf", player_name);
2448 err = process_pickpref_file(buf);
2453 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2455 msg_format("loaded '%s'.", buf);
2459 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2461 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2465 err = process_pickpref_file("picktype.prf");
2467 err = process_pickpref_file("pickpref.prf");
2473 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2475 msg_print("loaded 'pickpref.prf'.");
2482 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2484 if(err) msg_print("Failed to reload autopick preference.");
2491 * Hack -- append all current macros to the given file
2493 static errr macro_dump(cptr fname)
2495 static cptr mark = "Macro Dump";
2503 /* Build the filename */
2504 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2506 /* File type is "TEXT" */
2507 FILE_TYPE(FILE_TYPE_TEXT);
2509 /* Append to the file */
2510 fff = open_auto_dump(buf, mark, &line_num);
2511 if (!fff) return (-1);
2515 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2517 fprintf(fff, "\n# Automatic macro dump\n\n");
2522 for (i = 0; i < macro__num; i++)
2524 /* Extract the action */
2525 ascii_to_text(buf, macro__act[i]);
2527 /* Dump the macro */
2528 fprintf(fff, "A:%s\n", buf);
2530 /* Extract the action */
2531 ascii_to_text(buf, macro__pat[i]);
2533 /* Dump normal macros */
2534 fprintf(fff, "P:%s\n", buf);
2539 /* count number of lines */
2544 close_auto_dump(fff, mark, line_num);
2552 * Hack -- ask for a "trigger" (see below)
2554 * Note the complex use of the "inkey()" function from "util.c".
2556 * Note that both "flush()" calls are extremely important.
2558 static void do_cmd_macro_aux(char *buf)
2568 /* Do not process macros */
2574 /* Read the pattern */
2580 /* Do not process macros */
2583 /* Do not wait for keys */
2586 /* Attempt to read a key */
2597 /* Convert the trigger */
2598 ascii_to_text(tmp, buf);
2600 /* Hack -- display the trigger */
2601 Term_addstr(-1, TERM_WHITE, tmp);
2608 * Hack -- ask for a keymap "trigger" (see below)
2610 * Note that both "flush()" calls are extremely important. This may
2611 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2613 static void do_cmd_macro_aux_keymap(char *buf)
2627 /* Convert to ascii */
2628 ascii_to_text(tmp, buf);
2630 /* Hack -- display the trigger */
2631 Term_addstr(-1, TERM_WHITE, tmp);
2640 * Hack -- append all keymaps to the given file
2642 static errr keymap_dump(cptr fname)
2644 static cptr mark = "Keymap Dump";
2656 if (rogue_like_commands)
2658 mode = KEYMAP_MODE_ROGUE;
2664 mode = KEYMAP_MODE_ORIG;
2668 /* Build the filename */
2669 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2671 /* File type is "TEXT" */
2672 FILE_TYPE(FILE_TYPE_TEXT);
2674 /* Append to the file */
2675 fff = open_auto_dump(buf, mark, &line_num);
2676 if (!fff) return -1;
2680 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2682 fprintf(fff, "\n# Automatic keymap dump\n\n");
2687 for (i = 0; i < 256; i++)
2691 /* Loop up the keymap */
2692 act = keymap_act[mode][i];
2694 /* Skip empty keymaps */
2697 /* Encode the key */
2700 ascii_to_text(key, buf);
2702 /* Encode the action */
2703 ascii_to_text(buf, act);
2705 /* Dump the macro */
2706 fprintf(fff, "A:%s\n", buf);
2707 fprintf(fff, "C:%d:%s\n", mode, key);
2712 close_auto_dump(fff, mark, line_num);
2721 * Interact with "macros"
2723 * Note that the macro "action" must be defined before the trigger.
2725 * Could use some helpful instructions on this page. XXX XXX XXX
2727 void do_cmd_macros(void)
2739 if (rogue_like_commands)
2741 mode = KEYMAP_MODE_ROGUE;
2747 mode = KEYMAP_MODE_ORIG;
2750 /* File type is "TEXT" */
2751 FILE_TYPE(FILE_TYPE_TEXT);
2758 /* Process requests until done */
2766 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2768 prt("Interact with Macros", 2, 0);
2773 /* Describe that action */
2775 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2777 prt("Current action (if any) shown below:", 20, 0);
2781 /* Analyze the current action */
2782 ascii_to_text(buf, macro__buf);
2784 /* Display the current action */
2790 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2792 prt("(1) Load a user pref file", 4, 5);
2797 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2798 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2799 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2800 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2801 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2802 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2803 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2804 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2805 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2807 prt("(2) Append macros to a file", 5, 5);
2808 prt("(3) Query a macro", 6, 5);
2809 prt("(4) Create a macro", 7, 5);
2810 prt("(5) Remove a macro", 8, 5);
2811 prt("(6) Append keymaps to a file", 9, 5);
2812 prt("(7) Query a keymap", 10, 5);
2813 prt("(8) Create a keymap", 11, 5);
2814 prt("(9) Remove a keymap", 12, 5);
2815 prt("(0) Enter a new action", 13, 5);
2818 #endif /* ALLOW_MACROS */
2822 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2824 prt("Command: ", 16, 0);
2832 if (i == ESCAPE) break;
2834 /* Load a 'macro' file */
2841 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2843 prt("Command: Load a user pref file", 16, 0);
2849 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2851 prt("File: ", 18, 0);
2855 /* Default filename */
2856 sprintf(tmp, "%s.prf", player_name);
2858 /* Ask for a file */
2859 if (!askfor_aux(tmp, 80)) continue;
2861 /* Process the given filename */
2862 err = process_pref_file(tmp);
2866 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2868 msg_format("Loaded default '%s'.", tmp);
2875 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2877 msg_format("Failed to load '%s'!");
2883 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2885 msg_format("Loaded '%s'.", tmp);
2897 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2899 prt("Command: Append macros to a file", 16, 0);
2905 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2907 prt("File: ", 18, 0);
2911 /* Default filename */
2912 sprintf(tmp, "%s.prf", player_name);
2914 /* Ask for a file */
2915 if (!askfor_aux(tmp, 80)) continue;
2917 /* Dump the macros */
2918 (void)macro_dump(tmp);
2922 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2924 msg_print("Appended macros.");
2936 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2938 prt("Command: Query a macro", 16, 0);
2944 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2946 prt("Trigger: ", 18, 0);
2950 /* Get a macro trigger */
2951 do_cmd_macro_aux(buf);
2953 /* Acquire action */
2954 k = macro_find_exact(buf);
2961 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2963 msg_print("Found no macro.");
2971 /* Obtain the action */
2972 strcpy(macro__buf, macro__act[k]);
2974 /* Analyze the current action */
2975 ascii_to_text(buf, macro__buf);
2977 /* Display the current action */
2982 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2984 msg_print("Found a macro.");
2990 /* Create a macro */
2995 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2997 prt("Command: Create a macro", 16, 0);
3003 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3005 prt("Trigger: ", 18, 0);
3009 /* Get a macro trigger */
3010 do_cmd_macro_aux(buf);
3017 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3019 prt("Action: ", 20, 0);
3023 /* Convert to text */
3024 ascii_to_text(tmp, macro__buf);
3026 /* Get an encoded action */
3027 if (askfor_aux(tmp, 80))
3029 /* Convert to ascii */
3030 text_to_ascii(macro__buf, tmp);
3032 /* Link the macro */
3033 macro_add(buf, macro__buf);
3037 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3039 msg_print("Added a macro.");
3045 /* Remove a macro */
3050 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3052 prt("Command: Remove a macro", 16, 0);
3058 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3060 prt("Trigger: ", 18, 0);
3064 /* Get a macro trigger */
3065 do_cmd_macro_aux(buf);
3067 /* Link the macro */
3068 macro_add(buf, buf);
3072 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3074 msg_print("Removed a macro.");
3084 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3086 prt("Command: Append keymaps to a file", 16, 0);
3092 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3094 prt("File: ", 18, 0);
3098 /* Default filename */
3099 sprintf(tmp, "%s.prf", player_name);
3101 /* Ask for a file */
3102 if (!askfor_aux(tmp, 80)) continue;
3104 /* Dump the macros */
3105 (void)keymap_dump(tmp);
3109 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3111 msg_print("Appended keymaps.");
3116 /* Query a keymap */
3123 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3125 prt("Command: Query a keymap", 16, 0);
3131 prt("²¡¤¹¥¡¼: ", 18, 0);
3133 prt("Keypress: ", 18, 0);
3137 /* Get a keymap trigger */
3138 do_cmd_macro_aux_keymap(buf);
3140 /* Look up the keymap */
3141 act = keymap_act[mode][(byte)(buf[0])];
3148 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3150 msg_print("Found no keymap.");
3158 /* Obtain the action */
3159 strcpy(macro__buf, act);
3161 /* Analyze the current action */
3162 ascii_to_text(buf, macro__buf);
3164 /* Display the current action */
3169 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3171 msg_print("Found a keymap.");
3177 /* Create a keymap */
3182 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3184 prt("Command: Create a keymap", 16, 0);
3190 prt("²¡¤¹¥¡¼: ", 18, 0);
3192 prt("Keypress: ", 18, 0);
3196 /* Get a keymap trigger */
3197 do_cmd_macro_aux_keymap(buf);
3204 prt("¹ÔÆ°: ", 20, 0);
3206 prt("Action: ", 20, 0);
3210 /* Convert to text */
3211 ascii_to_text(tmp, macro__buf);
3213 /* Get an encoded action */
3214 if (askfor_aux(tmp, 80))
3216 /* Convert to ascii */
3217 text_to_ascii(macro__buf, tmp);
3219 /* Free old keymap */
3220 string_free(keymap_act[mode][(byte)(buf[0])]);
3222 /* Make new keymap */
3223 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3227 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3229 msg_print("Added a keymap.");
3235 /* Remove a keymap */
3240 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3242 prt("Command: Remove a keymap", 16, 0);
3248 prt("²¡¤¹¥¡¼: ", 18, 0);
3250 prt("Keypress: ", 18, 0);
3254 /* Get a keymap trigger */
3255 do_cmd_macro_aux_keymap(buf);
3257 /* Free old keymap */
3258 string_free(keymap_act[mode][(byte)(buf[0])]);
3260 /* Make new keymap */
3261 keymap_act[mode][(byte)(buf[0])] = NULL;
3265 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3267 msg_print("Removed a keymap.");
3272 /* Enter a new action */
3277 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3279 prt("Command: Enter a new action", 16, 0);
3283 /* Go to the correct location */
3286 /* Hack -- limit the value */
3289 /* Get an encoded action */
3290 if (!askfor_aux(buf, 80)) continue;
3292 /* Extract an action */
3293 text_to_ascii(macro__buf, buf);
3296 #endif /* ALLOW_MACROS */
3305 /* Flush messages */
3314 static void cmd_visuals_aux(int i, int *num, int max)
3321 sprintf(str, "%d", *num);
3323 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3326 tmp = strtol(str, NULL, 0);
3327 if (tmp >= 0 && tmp < max)
3331 else if (isupper(i))
3332 *num = (*num + max - 1) % max;
3334 *num = (*num + 1) % max;
3340 * Interact with "visuals"
3342 void do_cmd_visuals(void)
3353 /* File type is "TEXT" */
3354 FILE_TYPE(FILE_TYPE_TEXT);
3357 /* Save the screen */
3361 /* Interact until done */
3367 /* Ask for a choice */
3369 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3371 prt("Interact with Visuals", 2, 0);
3375 /* Give some choices */
3377 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3379 prt("(1) Load a user pref file", 4, 5);
3382 #ifdef ALLOW_VISUALS
3384 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3385 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3386 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3387 prt("(5) (̤»ÈÍÑ)", 8, 5);
3388 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3389 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3390 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3391 prt("(9) (̤»ÈÍÑ)", 12, 5);
3393 prt("(2) Dump monster attr/chars", 5, 5);
3394 prt("(3) Dump object attr/chars", 6, 5);
3395 prt("(4) Dump feature attr/chars", 7, 5);
3396 prt("(5) (unused)", 8, 5);
3397 prt("(6) Change monster attr/chars", 9, 5);
3398 prt("(7) Change object attr/chars", 10, 5);
3399 prt("(8) Change feature attr/chars", 11, 5);
3400 prt("(9) (unused)", 12, 5);
3405 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3407 prt("(0) Reset visuals", 13, 5);
3413 prt("¥³¥Þ¥ó¥É:", 18, 0);
3415 prt("Command: ", 15, 0);
3423 if (i == ESCAPE) break;
3425 /* Load a 'pref' file */
3430 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3432 prt("Command: Load a user pref file", 15, 0);
3438 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3440 prt("File: ", 17, 0);
3444 /* Default filename */
3445 sprintf(tmp, "%s.prf", player_name);
3448 if (!askfor_aux(tmp, 70)) continue;
3450 /* Process the given filename */
3451 (void)process_pref_file(tmp);
3454 #ifdef ALLOW_VISUALS
3456 /* Dump monster attr/chars */
3459 static cptr mark = "Monster attr/chars";
3464 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3466 prt("Command: Dump monster attr/chars", 15, 0);
3472 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3474 prt("File: ", 17, 0);
3478 /* Default filename */
3479 sprintf(tmp, "%s.prf", player_name);
3481 /* Get a filename */
3482 if (!askfor_aux(tmp, 70)) continue;
3484 /* Build the filename */
3485 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3487 /* Append to the file */
3488 fff = open_auto_dump(buf, mark, &line_num);
3493 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3495 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3500 for (i = 0; i < max_r_idx; i++)
3502 monster_race *r_ptr = &r_info[i];
3504 /* Skip non-entries */
3505 if (!r_ptr->name) continue;
3507 /* Dump a comment */
3508 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3511 /* Dump the monster attr/char info */
3512 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3513 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3518 close_auto_dump(fff, mark, line_num);
3522 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3524 msg_print("Dumped monster attr/chars.");
3529 /* Dump object attr/chars */
3532 static cptr mark = "Object attr/chars";
3537 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3539 prt("Command: Dump object attr/chars", 15, 0);
3545 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3547 prt("File: ", 17, 0);
3551 /* Default filename */
3552 sprintf(tmp, "%s.prf", player_name);
3554 /* Get a filename */
3555 if (!askfor_aux(tmp, 70)) continue;
3557 /* Build the filename */
3558 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3560 /* Append to the file */
3561 fff = open_auto_dump(buf, mark, &line_num);
3566 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3568 fprintf(fff, "\n# Object attr/char definitions\n\n");
3573 for (i = 0; i < max_k_idx; i++)
3575 object_kind *k_ptr = &k_info[i];
3577 /* Skip non-entries */
3578 if (!k_ptr->name) continue;
3580 /* Dump a comment */
3581 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3584 /* Dump the object attr/char info */
3585 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3586 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3591 close_auto_dump(fff, mark, line_num);
3595 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3597 msg_print("Dumped object attr/chars.");
3602 /* Dump feature attr/chars */
3605 static cptr mark = "Feature attr/chars";
3610 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3612 prt("Command: Dump feature attr/chars", 15, 0);
3618 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3620 prt("File: ", 17, 0);
3624 /* Default filename */
3625 sprintf(tmp, "%s.prf", player_name);
3627 /* Get a filename */
3628 if (!askfor_aux(tmp, 70)) continue;
3630 /* Build the filename */
3631 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3633 /* Append to the file */
3634 fff = open_auto_dump(buf, mark, &line_num);
3639 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3641 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3646 for (i = 0; i < max_f_idx; i++)
3648 feature_type *f_ptr = &f_info[i];
3650 /* Skip non-entries */
3651 if (!f_ptr->name) continue;
3653 /* Dump a comment */
3654 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3657 /* Dump the feature attr/char info */
3658 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3659 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3664 close_auto_dump(fff, mark, line_num);
3668 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3670 msg_print("Dumped feature attr/chars.");
3675 /* Modify monster attr/chars */
3682 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3684 prt("Command: Change monster attr/chars", 15, 0);
3688 /* Hack -- query until done */
3691 monster_race *r_ptr = &r_info[r];
3695 byte da = (r_ptr->d_attr);
3696 byte dc = (r_ptr->d_char);
3697 byte ca = (r_ptr->x_attr);
3698 byte cc = (r_ptr->x_char);
3700 /* Label the object */
3702 Term_putstr(5, 17, -1, TERM_WHITE,
3703 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3704 r, (r_name + r_ptr->name)));
3706 Term_putstr(5, 17, -1, TERM_WHITE,
3707 format("Monster = %d, Name = %-40.40s",
3708 r, (r_name + r_ptr->name)));
3712 /* Label the Default values */
3714 Term_putstr(10, 19, -1, TERM_WHITE,
3715 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3717 Term_putstr(10, 19, -1, TERM_WHITE,
3718 format("Default attr/char = %3u / %3u", da, dc));
3721 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3722 Term_putch(43, 19, da, dc);
3726 Term_putch(44, 19, 255, -1);
3728 Term_putch(44, 19, 0, ' ');
3731 /* Label the Current values */
3733 Term_putstr(10, 20, -1, TERM_WHITE,
3734 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3736 Term_putstr(10, 20, -1, TERM_WHITE,
3737 format("Current attr/char = %3u / %3u", ca, cc));
3740 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3741 Term_putch(43, 20, ca, cc);
3745 Term_putch(44, 20, 255, -1);
3747 Term_putch(44, 20, 0, ' ');
3752 Term_putstr(0, 22, -1, TERM_WHITE,
3753 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3755 Term_putstr(0, 22, -1, TERM_WHITE,
3756 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3763 if (i == ESCAPE) break;
3765 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3766 else if (isupper(i)) c = 'a' + i - 'A';
3772 cmd_visuals_aux(i, &r, max_r_idx);
3775 t = (int)r_ptr->x_attr;
3776 cmd_visuals_aux(i, &t, 256);
3777 r_ptr->x_attr = (byte)t;
3780 t = (int)r_ptr->x_char;
3781 cmd_visuals_aux(i, &t, 256);
3782 r_ptr->x_char = (byte)t;
3788 /* Modify object attr/chars */
3795 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3797 prt("Command: Change object attr/chars", 15, 0);
3801 /* Hack -- query until done */
3804 object_kind *k_ptr = &k_info[k];
3808 byte da = (byte)k_ptr->d_attr;
3809 byte dc = (byte)k_ptr->d_char;
3810 byte ca = (byte)k_ptr->x_attr;
3811 byte cc = (byte)k_ptr->x_char;
3813 /* Label the object */
3815 Term_putstr(5, 17, -1, TERM_WHITE,
3816 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3817 k, (k_name + k_ptr->name)));
3819 Term_putstr(5, 17, -1, TERM_WHITE,
3820 format("Object = %d, Name = %-40.40s",
3821 k, (k_name + k_ptr->name)));
3825 /* Label the Default values */
3827 Term_putstr(10, 19, -1, TERM_WHITE,
3828 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3830 Term_putstr(10, 19, -1, TERM_WHITE,
3831 format("Default attr/char = %3d / %3d", da, dc));
3834 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3835 Term_putch(43, 19, da, dc);
3839 Term_putch(44, 19, 255, -1);
3841 Term_putch(44, 19, 0, ' ');
3844 /* Label the Current values */
3846 Term_putstr(10, 20, -1, TERM_WHITE,
3847 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3849 Term_putstr(10, 20, -1, TERM_WHITE,
3850 format("Current attr/char = %3d / %3d", ca, cc));
3853 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3854 Term_putch(43, 20, ca, cc);
3858 Term_putch(44, 20, 255, -1);
3860 Term_putch(44, 20, 0, ' ');
3865 Term_putstr(0, 22, -1, TERM_WHITE,
3866 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3868 Term_putstr(0, 22, -1, TERM_WHITE,
3869 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3876 if (i == ESCAPE) break;
3878 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3879 else if (isupper(i)) c = 'a' + i - 'A';
3885 cmd_visuals_aux(i, &k, max_k_idx);
3888 t = (int)k_info[k].x_attr;
3889 cmd_visuals_aux(i, &t, 256);
3890 k_info[k].x_attr = (byte)t;
3893 t = (int)k_info[k].x_char;
3894 cmd_visuals_aux(i, &t, 256);
3895 k_info[k].x_char = (byte)t;
3901 /* Modify feature attr/chars */
3908 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3910 prt("Command: Change feature attr/chars", 15, 0);
3914 /* Hack -- query until done */
3917 feature_type *f_ptr = &f_info[f];
3921 byte da = (byte)f_ptr->d_attr;
3922 byte dc = (byte)f_ptr->d_char;
3923 byte ca = (byte)f_ptr->x_attr;
3924 byte cc = (byte)f_ptr->x_char;
3926 /* Label the object */
3928 Term_putstr(5, 17, -1, TERM_WHITE,
3929 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3930 f, (f_name + f_ptr->name)));
3932 Term_putstr(5, 17, -1, TERM_WHITE,
3933 format("Terrain = %d, Name = %-40.40s",
3934 f, (f_name + f_ptr->name)));
3938 /* Label the Default values */
3940 Term_putstr(10, 19, -1, TERM_WHITE,
3941 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3943 Term_putstr(10, 19, -1, TERM_WHITE,
3944 format("Default attr/char = %3d / %3d", da, dc));
3947 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3948 Term_putch(43, 19, da, dc);
3952 Term_putch(44, 19, 255, -1);
3954 Term_putch(44, 19, 0, ' ');
3957 /* Label the Current values */
3959 Term_putstr(10, 20, -1, TERM_WHITE,
3960 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3962 Term_putstr(10, 20, -1, TERM_WHITE,
3963 format("Current attr/char = %3d / %3d", ca, cc));
3966 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3967 Term_putch(43, 20, ca, cc);
3971 Term_putch(44, 20, 255, -1);
3973 Term_putch(44, 20, 0, ' ');
3978 Term_putstr(0, 22, -1, TERM_WHITE,
3979 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3981 Term_putstr(0, 22, -1, TERM_WHITE,
3982 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3989 if (i == ESCAPE) break;
3991 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3992 else if (isupper(i)) c = 'a' + i - 'A';
3998 cmd_visuals_aux(i, &f, max_f_idx);
4001 t = (int)f_info[f].x_attr;
4002 cmd_visuals_aux(i, &t, 256);
4003 f_info[f].x_attr = (byte)t;
4006 t = (int)f_info[f].x_char;
4007 cmd_visuals_aux(i, &t, 256);
4008 f_info[f].x_char = (byte)t;
4024 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4026 msg_print("Visual attr/char tables reset.");
4031 /* Unknown option */
4037 /* Flush messages */
4042 /* Restore the screen */
4048 * Interact with "colors"
4050 void do_cmd_colors(void)
4061 /* File type is "TEXT" */
4062 FILE_TYPE(FILE_TYPE_TEXT);
4065 /* Save the screen */
4069 /* Interact until done */
4075 /* Ask for a choice */
4077 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4079 prt("Interact with Colors", 2, 0);
4083 /* Give some choices */
4085 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4087 prt("(1) Load a user pref file", 4, 5);
4092 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4093 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4095 prt("(2) Dump colors", 5, 5);
4096 prt("(3) Modify colors", 6, 5);
4103 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4105 prt("Command: ", 8, 0);
4113 if (i == ESCAPE) break;
4115 /* Load a 'pref' file */
4120 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4122 prt("Command: Load a user pref file", 8, 0);
4128 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4130 prt("File: ", 10, 0);
4135 sprintf(tmp, "%s.prf", player_name);
4138 if (!askfor_aux(tmp, 70)) continue;
4140 /* Process the given filename */
4141 (void)process_pref_file(tmp);
4143 /* Mega-Hack -- react to changes */
4144 Term_xtra(TERM_XTRA_REACT, 0);
4146 /* Mega-Hack -- redraw */
4155 static cptr mark = "Colors";
4160 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4162 prt("Command: Dump colors", 8, 0);
4168 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4170 prt("File: ", 10, 0);
4174 /* Default filename */
4175 sprintf(tmp, "%s.prf", player_name);
4177 /* Get a filename */
4178 if (!askfor_aux(tmp, 70)) continue;
4180 /* Build the filename */
4181 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4183 /* Append to the file */
4184 fff = open_auto_dump(buf, mark, &line_num);
4189 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4191 fprintf(fff, "\n# Color redefinitions\n\n");
4196 for (i = 0; i < 256; i++)
4198 int kv = angband_color_table[i][0];
4199 int rv = angband_color_table[i][1];
4200 int gv = angband_color_table[i][2];
4201 int bv = angband_color_table[i][3];
4206 cptr name = "unknown";
4210 /* Skip non-entries */
4211 if (!kv && !rv && !gv && !bv) continue;
4213 /* Extract the color name */
4214 if (i < 16) name = color_names[i];
4216 /* Dump a comment */
4218 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4220 fprintf(fff, "# Color '%s'\n", name);
4224 /* Dump the monster attr/char info */
4225 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4231 close_auto_dump(fff, mark, line_num);
4235 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4237 msg_print("Dumped color redefinitions.");
4249 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4251 prt("Command: Modify colors", 8, 0);
4255 /* Hack -- query until done */
4264 /* Exhibit the normal colors */
4265 for (j = 0; j < 16; j++)
4267 /* Exhibit this color */
4268 Term_putstr(j*4, 20, -1, a, "###");
4270 /* Exhibit all colors */
4271 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4274 /* Describe the color */
4276 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4278 name = ((a < 16) ? color_names[a] : "undefined");
4282 /* Describe the color */
4284 Term_putstr(5, 10, -1, TERM_WHITE,
4285 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4287 Term_putstr(5, 10, -1, TERM_WHITE,
4288 format("Color = %d, Name = %s", a, name));
4292 /* Label the Current values */
4293 Term_putstr(5, 12, -1, TERM_WHITE,
4294 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4295 angband_color_table[a][0],
4296 angband_color_table[a][1],
4297 angband_color_table[a][2],
4298 angband_color_table[a][3]));
4302 Term_putstr(0, 14, -1, TERM_WHITE,
4303 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4305 Term_putstr(0, 14, -1, TERM_WHITE,
4306 "Command (n/N/k/K/r/R/g/G/b/B): ");
4314 if (i == ESCAPE) break;
4317 if (i == 'n') a = (byte)(a + 1);
4318 if (i == 'N') a = (byte)(a - 1);
4319 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4320 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4321 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4322 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4323 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4324 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4325 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4326 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4328 /* Hack -- react to changes */
4329 Term_xtra(TERM_XTRA_REACT, 0);
4331 /* Hack -- redraw */
4338 /* Unknown option */
4344 /* Flush messages */
4349 /* Restore the screen */
4355 * Note something in the message recall
4357 void do_cmd_note(void)
4366 if (!get_string("¥á¥â: ", buf, 60)) return;
4368 if (!get_string("Note: ", buf, 60)) return;
4372 /* Ignore empty notes */
4373 if (!buf[0] || (buf[0] == ' ')) return;
4375 /* Add the note to the message recall */
4377 msg_format("¥á¥â: %s", buf);
4379 msg_format("Note: %s", buf);
4386 * Mention the current version
4388 void do_cmd_version(void)
4393 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4394 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4396 msg_format("You are playing Hengband %d.%d.%d.",
4397 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4404 * Array of feeling strings
4406 static cptr do_cmd_feeling_text[11] =
4409 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4411 "Looks like any other level.",
4415 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4417 "You feel there is something special about this level.",
4421 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4423 "You nearly faint as horrible visions of death fill your mind!",
4427 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4429 "This level looks very dangerous.",
4433 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4435 "You have a very bad feeling...",
4439 "°¤¤Í½´¶¤¬¤¹¤ë...",
4441 "You have a bad feeling...",
4447 "You feel nervous.",
4451 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4453 "You feel your luck is turning...",
4457 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4459 "You don't like the look of this place.",
4463 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4465 "This level looks reasonably safe.",
4469 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4471 "What a boring place..."
4476 static cptr do_cmd_feeling_text_combat[11] =
4479 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4481 "Looks like any other level.",
4485 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4487 "You feel there is something special about this level.",
4491 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4493 "You nearly faint as horrible visions of death fill your mind!",
4497 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4499 "This level looks very dangerous.",
4503 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4505 "You have a very bad feeling...",
4509 "°¤¤Í½´¶¤¬¤¹¤ë...",
4511 "You have a bad feeling...",
4517 "You feel nervous.",
4521 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4523 "You feel your luck is turning...",
4527 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4529 "You don't like the look of this place.",
4533 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4535 "This level looks reasonably safe.",
4539 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4541 "What a boring place..."
4546 static cptr do_cmd_feeling_text_lucky[11] =
4549 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4550 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4551 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4552 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4553 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4554 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4555 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4556 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4557 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4558 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4559 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4561 "Looks like any other level.",
4562 "You feel there is something special about this level.",
4563 "You have a superb feeling about this level.",
4564 "You have an excellent feeling...",
4565 "You have a very good feeling...",
4566 "You have a good feeling...",
4567 "You feel strangely lucky...",
4568 "You feel your luck is turning...",
4569 "You like the look of this place...",
4570 "This level can't be all bad...",
4571 "What a boring place..."
4577 * Note that "feeling" is set to zero unless some time has passed.
4578 * Note that this is done when the level is GENERATED, not entered.
4580 void do_cmd_feeling(void)
4582 /* Verify the feeling */
4583 if (feeling > 10) feeling = 10;
4585 /* No useful feeling in quests */
4586 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4589 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4591 msg_print("Looks like a typical quest level.");
4597 /* No useful feeling in town */
4598 else if (p_ptr->town_num && !dun_level)
4601 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4603 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4607 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4609 msg_print("Looks like a strange wilderness.");
4617 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4619 msg_print("Looks like a typical town.");
4626 /* No useful feeling in the wilderness */
4627 else if (!dun_level)
4630 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4632 msg_print("Looks like a typical wilderness.");
4638 /* Display the feeling */
4639 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4641 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4643 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4644 msg_print(do_cmd_feeling_text_combat[feeling]);
4646 msg_print(do_cmd_feeling_text[feeling]);
4651 msg_print(do_cmd_feeling_text[0]);
4660 * Encode the screen colors
4662 static char hack[17] = "dwsorgbuDWvyRGBU";
4665 static errr photo_fgets(FILE *fff, char *buf, huge n)
4674 if (fgets(tmp, 1024, fff))
4676 /* Convert weirdness */
4677 for (s = tmp; *s; s++)
4679 /* Handle newline */
4690 else if (*s == '\t')
4692 /* Hack -- require room */
4693 if (i + 8 >= n) break;
4695 /* Append a space */
4698 /* Append some more spaces */
4699 while (!(i % 8)) buf[i++] = ' ';
4703 else if (iskanji(*s))
4710 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4711 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4718 /* Handle printables */
4739 * Hack -- load a screen dump from a file
4741 void do_cmd_load_screen(void)
4756 Term_get_size(&wid, &hgt);
4758 /* Hack -- drop permissions */
4761 /* Build the filename */
4762 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
4764 /* Append to the file */
4765 fff = my_fopen(buf, "r");
4770 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4772 msg_format("Failed to open %s.", buf);
4779 /* Save the screen */
4782 /* Clear the screen */
4786 /* Load the screen */
4787 for (y = 0; okay && (y < hgt); y++)
4789 /* Get a line of data */
4790 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4793 for (x = 0; x < wid - 1; x++)
4795 /* Put the attr/char */
4796 Term_draw(x, y, TERM_WHITE, buf[x]);
4800 /* Get the blank line */
4801 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
4804 /* Dump the screen */
4805 for (y = 0; okay && (y < hgt); y++)
4807 /* Get a line of data */
4808 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4811 for (x = 0; x < wid - 1; x++)
4813 /* Get the attr/char */
4814 (void)(Term_what(x, y, &a, &c));
4816 /* Look up the attr */
4817 for (i = 0; i < 16; i++)
4819 /* Use attr matches */
4820 if (hack[i] == buf[x]) a = i;
4823 /* Put the attr/char */
4824 Term_draw(x, y, a, c);
4829 /* Get the blank line */
4830 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
4836 /* Hack -- grab permissions */
4842 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4844 msg_print("Screen dump loaded.");
4851 /* Restore the screen */
4858 cptr inven_res_label =
4860 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4862 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4865 /* XTRA HACK RESLIST */
4866 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4867 int *j, byte tval, char *where)
4869 char o_name[MAX_NLEN];
4870 u32b flgs[TR_FLAG_SIZE];
4872 if (!o_ptr->k_idx)return;
4873 if (o_ptr->tval != tval)return;
4876 * HACK:Ring of Lordly protection and Dragon shield/helm
4877 * have random resistances.
4879 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4880 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4881 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4882 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4883 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4884 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4885 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4888 object_desc(o_name, o_ptr, TRUE, 0);
4890 while ( o_name[i] && i < 26 ){
4892 if (iskanji(o_name[i])) i++;
4896 if(i<28) while(i<28){o_name[i]=' ';i++;}
4899 fprintf(fff,"%s %s", where, o_name);
4901 if (!(o_ptr->ident & (IDENT_MENTAL)))
4904 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4906 fprintf(fff, "-------unknown------------ -------unknown------\n");
4910 object_flags_known(o_ptr, flgs);
4913 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
4914 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
4915 else fprintf(fff,"¡¦");
4917 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
4918 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
4919 else fprintf(fff,"¡¦");
4921 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
4922 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
4923 else fprintf(fff,"¡¦");
4925 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
4926 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
4927 else fprintf(fff,"¡¦");
4929 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
4930 else fprintf(fff,"¡¦");
4932 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
4933 else fprintf(fff,"¡¦");
4935 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
4936 else fprintf(fff,"¡¦");
4938 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
4939 else fprintf(fff,"¡¦");
4941 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
4942 else fprintf(fff,"¡¦");
4944 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
4945 else fprintf(fff,"¡¦");
4947 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
4948 else fprintf(fff,"¡¦");
4950 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
4951 else fprintf(fff,"¡¦");
4953 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
4954 else fprintf(fff,"¡¦");
4958 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
4959 else fprintf(fff,"¡¦");
4961 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
4962 else fprintf(fff,"¡¦");
4964 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
4965 else fprintf(fff,"¡¦");
4967 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
4968 else fprintf(fff,"¡¦");
4970 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
4971 else fprintf(fff,"¡¦");
4973 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
4974 else fprintf(fff,"¡¦");
4976 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
4977 else fprintf(fff,"¡¦");
4979 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
4980 else fprintf(fff,"¡¦");
4983 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
4984 else fprintf(fff,"¡¦");
4986 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
4987 else fprintf(fff,"¡¦");
4989 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
4990 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
4991 else fprintf(fff,". ");
4993 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
4994 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
4995 else fprintf(fff,". ");
4997 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
4998 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
4999 else fprintf(fff,". ");
5001 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5002 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5003 else fprintf(fff,". ");
5005 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5006 else fprintf(fff,". ");
5008 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5009 else fprintf(fff,". ");
5011 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5012 else fprintf(fff,". ");
5014 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5015 else fprintf(fff,". ");
5017 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5018 else fprintf(fff,". ");
5020 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5021 else fprintf(fff,". ");
5023 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5024 else fprintf(fff,". ");
5026 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5027 else fprintf(fff,". ");
5029 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5030 else fprintf(fff,". ");
5034 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5035 else fprintf(fff,". ");
5037 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5038 else fprintf(fff,". ");
5040 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5041 else fprintf(fff,". ");
5043 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5044 else fprintf(fff,". ");
5046 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5047 else fprintf(fff,". ");
5049 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5050 else fprintf(fff,". ");
5052 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5053 else fprintf(fff,". ");
5055 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5056 else fprintf(fff,". ");
5059 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5060 else fprintf(fff,". ");
5062 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5063 else fprintf(fff,". ");
5071 fprintf(fff,"%s\n", inven_res_label);
5077 * Display *ID* ed weapons/armors's resistances
5079 static void do_cmd_knowledge_inven(void)
5084 char file_name[1024];
5095 /* Open a new file */
5096 fff = my_fopen_temp(file_name, 1024);
5099 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5101 msg_format("Failed to create temporally file %s.", file_name);
5106 fprintf(fff,"%s\n",inven_res_label);
5108 for (tval=TV_BOW; tval <= TV_RING; tval++){
5111 for (;j<9;j++) fprintf(fff, "\n");
5113 fprintf(fff,"%s\n",inven_res_label);
5117 strcpy(where, "Áõ");
5119 strcpy(where, "E ");
5121 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5123 o_ptr = &inventory[i];
5124 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5128 strcpy(where, "»ý");
5130 strcpy(where, "I ");
5132 for (i = 0; i < INVEN_PACK; i++)
5134 o_ptr = &inventory[i];
5135 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5139 /* Print all homes in the different towns */
5140 st_ptr = &town[1].store[STORE_HOME];
5142 strcpy(where, "²È");
5144 strcpy(where, "H ");
5147 /* Dump all available items */
5148 for (i = 0; i < st_ptr->stock_num; i++)
5150 o_ptr = &st_ptr->stock[i];
5151 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5155 /* Close the file */
5158 /* Display the file contents */
5160 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5162 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5165 /* Remove the file */
5170 void do_cmd_save_screen_html_aux(char *filename, int message)
5174 byte a = 0, old_a = 0;
5188 cptr html_head[] = {
5189 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5193 cptr html_foot[] = {
5195 "</body>\n</html>\n",
5201 Term_get_size(&wid, &hgt);
5203 /* File type is "TEXT" */
5204 FILE_TYPE(FILE_TYPE_TEXT);
5206 /* Append to the file */
5207 fff = my_fopen(filename, "w");
5213 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5215 msg_format("Failed to open file %s.", filename);
5223 /* Save the screen */
5227 /* Build the filename */
5228 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5229 tmpfff = my_fopen(buf, "r");
5231 for (i = 0; html_head[i]; i++)
5232 fprintf(fff, html_head[i]);
5236 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5238 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5242 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5244 fprintf(fff, "%s\n", buf);
5249 /* Dump the screen */
5250 for (y = 0; y < hgt; y++)
5257 for (x = 0; x < wid - 1; x++)
5261 /* Get the attr/char */
5262 (void)(Term_what(x, y, &a, &c));
5266 case '&': cc = "&"; break;
5267 case '<': cc = "<"; break;
5268 case '>': cc = ">"; break;
5270 case 0x1f: c = '.'; break;
5271 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5276 if ((y == 0 && x == 0) || a != old_a) {
5277 rv = angband_color_table[a][1];
5278 gv = angband_color_table[a][2];
5279 bv = angband_color_table[a][3];
5280 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5281 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5285 fprintf(fff, "%s", cc);
5287 fprintf(fff, "%c", c);
5290 fprintf(fff, "</font>");
5293 for (i = 0; html_foot[i]; i++)
5294 fprintf(fff, html_foot[i]);
5299 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5301 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5305 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5307 fprintf(fff, "%s\n", buf);
5322 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5324 msg_print("Screen dump saved.");
5329 /* Restore the screen */
5335 * Hack -- save a screen dump to a file
5337 static void do_cmd_save_screen_html(void)
5339 char buf[1024], tmp[256] = "screen.html";
5342 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5344 if (!get_string("File name: ", tmp, 80))
5348 /* Build the filename */
5349 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5353 /* Hack -- drop permissions */
5356 do_cmd_save_screen_html_aux(buf, 1);
5358 /* Hack -- grab permissions */
5364 * Redefinable "save_screen" action
5366 void (*screendump_aux)(void) = NULL;
5370 * Hack -- save a screen dump to a file
5372 void do_cmd_save_screen(void)
5374 bool old_use_graphics = use_graphics;
5375 bool html_dump = FALSE;
5380 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
5382 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
5387 if (c == 'Y' || c == 'y')
5389 else if (c == 'H' || c == 'h')
5401 Term_get_size(&wid, &hgt);
5403 if (old_use_graphics)
5405 use_graphics = FALSE;
5408 /* Redraw everything */
5409 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5411 /* Hack -- update */
5417 do_cmd_save_screen_html();
5421 /* Do we use a special screendump function ? */
5422 else if (screendump_aux)
5424 /* Dump the screen to a graphics file */
5425 (*screendump_aux)();
5427 else /* Dump the screen as text */
5439 /* Hack -- drop permissions */
5442 /* Build the filename */
5443 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5445 /* File type is "TEXT" */
5446 FILE_TYPE(FILE_TYPE_TEXT);
5448 /* Append to the file */
5449 fff = my_fopen(buf, "w");
5454 /* Hack -- grab permissions */
5457 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5459 msg_format("Failed to open file %s.", buf);
5466 /* Save the screen */
5470 /* Dump the screen */
5471 for (y = 0; y < hgt; y++)
5474 for (x = 0; x < wid - 1; x++)
5476 /* Get the attr/char */
5477 (void)(Term_what(x, y, &a, &c));
5487 fprintf(fff, "%s\n", buf);
5494 /* Dump the screen */
5495 for (y = 0; y < hgt; y++)
5498 for (x = 0; x < wid - 1; x++)
5500 /* Get the attr/char */
5501 (void)(Term_what(x, y, &a, &c));
5504 buf[x] = hack[a&0x0F];
5511 fprintf(fff, "%s\n", buf);
5521 /* Hack -- grab permissions */
5526 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5528 msg_print("Screen dump saved.");
5534 /* Restore the screen */
5538 if (old_use_graphics)
5540 use_graphics = TRUE;
5543 /* Redraw everything */
5544 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5546 /* Hack -- update */
5553 * Sorting hook -- Comp function -- see below
5555 * We use "u" to point to array of monster indexes,
5556 * and "v" to select the type of sorting to perform on "u".
5558 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5560 u16b *who = (u16b*)(u);
5562 u16b *why = (u16b*)(v);
5570 /* Sort by total kills */
5573 /* Extract total kills */
5574 z1 = a_info[w1].tval;
5575 z2 = a_info[w2].tval;
5577 /* Compare total kills */
5578 if (z1 < z2) return (TRUE);
5579 if (z1 > z2) return (FALSE);
5583 /* Sort by monster level */
5586 /* Extract levels */
5587 z1 = a_info[w1].sval;
5588 z2 = a_info[w2].sval;
5590 /* Compare levels */
5591 if (z1 < z2) return (TRUE);
5592 if (z1 > z2) return (FALSE);
5596 /* Sort by monster experience */
5599 /* Extract experience */
5600 z1 = a_info[w1].level;
5601 z2 = a_info[w2].level;
5603 /* Compare experience */
5604 if (z1 < z2) return (TRUE);
5605 if (z1 > z2) return (FALSE);
5609 /* Compare indexes */
5615 * Sorting hook -- Swap function -- see below
5617 * We use "u" to point to array of monster indexes,
5618 * and "v" to select the type of sorting to perform.
5620 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5622 u16b *who = (u16b*)(u);
5634 * Check the status of "artifacts"
5636 static void do_cmd_knowledge_artifacts(void)
5638 int i, k, z, x, y, n = 0;
5644 char file_name[1024];
5646 char base_name[MAX_NLEN];
5650 /* Open a new file */
5651 fff = my_fopen_temp(file_name, 1024);
5655 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5657 msg_format("Failed to create temporary file %s.", file_name);
5663 /* Allocate the "who" array */
5664 C_MAKE(who, max_r_idx, s16b);
5666 /* Allocate the "okay" array */
5667 C_MAKE(okay, max_a_idx, bool);
5669 /* Scan the artifacts */
5670 for (k = 0; k < max_a_idx; k++)
5672 artifact_type *a_ptr = &a_info[k];
5677 /* Skip "empty" artifacts */
5678 if (!a_ptr->name) continue;
5680 /* Skip "uncreated" artifacts */
5681 if (!a_ptr->cur_num) continue;
5687 /* Check the dungeon */
5688 for (y = 0; y < cur_hgt; y++)
5690 for (x = 0; x < cur_wid; x++)
5692 cave_type *c_ptr = &cave[y][x];
5694 s16b this_o_idx, next_o_idx = 0;
5696 /* Scan all objects in the grid */
5697 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5701 /* Acquire object */
5702 o_ptr = &o_list[this_o_idx];
5704 /* Acquire next object */
5705 next_o_idx = o_ptr->next_o_idx;
5707 /* Ignore non-artifacts */
5708 if (!artifact_p(o_ptr)) continue;
5710 /* Ignore known items */
5711 if (object_known_p(o_ptr)) continue;
5713 /* Note the artifact */
5714 okay[o_ptr->name1] = FALSE;
5719 /* Check the inventory and equipment */
5720 for (i = 0; i < INVEN_TOTAL; i++)
5722 object_type *o_ptr = &inventory[i];
5724 /* Ignore non-objects */
5725 if (!o_ptr->k_idx) continue;
5727 /* Ignore non-artifacts */
5728 if (!artifact_p(o_ptr)) continue;
5730 /* Ignore known items */
5731 if (object_known_p(o_ptr)) continue;
5733 /* Note the artifact */
5734 okay[o_ptr->name1] = FALSE;
5737 for (k = 0; k < max_a_idx; k++)
5739 if (okay[k]) who[n++] = k;
5742 /* Select the sort method */
5743 ang_sort_comp = ang_sort_art_comp;
5744 ang_sort_swap = ang_sort_art_swap;
5746 /* Sort the array by dungeon depth of monsters */
5747 ang_sort(who, &why, n);
5749 /* Scan the artifacts */
5750 for (k = 0; k < n; k++)
5752 artifact_type *a_ptr = &a_info[who[k]];
5756 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5758 strcpy(base_name, "Unknown Artifact");
5762 /* Obtain the base object type */
5763 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5771 /* Get local object */
5774 /* Create fake object */
5775 object_prep(q_ptr, z);
5777 /* Make it an artifact */
5778 q_ptr->name1 = (byte)who[k];
5780 /* Describe the artifact */
5781 object_desc_store(base_name, q_ptr, FALSE, 0);
5784 /* Hack -- Build the artifact name */
5786 fprintf(fff, " %s\n", base_name);
5788 fprintf(fff, " The %s\n", base_name);
5793 /* Free the "who" array */
5794 C_KILL(who, max_r_idx, s16b);
5796 /* Free the "okay" array */
5797 C_KILL(okay, max_a_idx, bool);
5799 /* Close the file */
5802 /* Display the file contents */
5804 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5806 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5810 /* Remove the file */
5816 * Display known uniques
5818 static void do_cmd_knowledge_uniques(void)
5826 char file_name[1024];
5828 /* Open a new file */
5829 fff = my_fopen_temp(file_name, 1024);
5833 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5835 msg_format("Failed to create temporary file %s.", file_name);
5841 /* Allocate the "who" array */
5842 C_MAKE(who, max_r_idx, s16b);
5844 /* Scan the monsters */
5845 for (i = 1; i < max_r_idx; i++)
5847 monster_race *r_ptr = &r_info[i];
5849 /* Use that monster */
5850 if (r_ptr->name) who[n++] = i;
5853 /* Select the sort method */
5854 ang_sort_comp = ang_sort_comp_hook;
5855 ang_sort_swap = ang_sort_swap_hook;
5857 /* Sort the array by dungeon depth of monsters */
5858 ang_sort(who, &why, n);
5860 /* Scan the monster races */
5861 for (k = 0; k < n; k++)
5863 monster_race *r_ptr = &r_info[who[k]];
5865 /* Only print Uniques */
5866 if (r_ptr->flags1 & (RF1_UNIQUE))
5868 bool dead = (r_ptr->max_num == 0);
5872 /* Only display "known" uniques */
5873 if (dead || cheat_know || r_ptr->r_sights)
5875 /* Print a message */
5877 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5878 (r_name + r_ptr->name));
5880 fprintf(fff, " %s is alive\n",
5881 (r_name + r_ptr->name));
5888 /* Free the "who" array */
5889 C_KILL(who, max_r_idx, s16b);
5891 /* Close the file */
5894 /* Display the file contents */
5896 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5898 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5902 /* Remove the file */
5908 * Display dead uniques
5910 static void do_cmd_knowledge_uniques_dead(void)
5918 char file_name[1024];
5920 /* Open a new file */
5921 fff = my_fopen_temp(file_name, 1024);
5925 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5927 msg_format("Failed to create temporary file %s.", file_name);
5933 /* Allocate the "who" array */
5934 C_MAKE(who, max_r_idx, s16b);
5936 /* Scan the monsters */
5937 for (i = 1; i < max_r_idx; i++)
5939 monster_race *r_ptr = &r_info[i];
5941 /* Use that monster */
5942 if (r_ptr->name) who[n++] = i;
5945 /* Select the sort method */
5946 ang_sort_comp = ang_sort_comp_hook;
5947 ang_sort_swap = ang_sort_swap_hook;
5949 /* Sort the array by dungeon depth of monsters */
5950 ang_sort(who, &why, n);
5952 /* Scan the monster races */
5953 for (k = 0; k < n; k++)
5955 monster_race *r_ptr = &r_info[who[k]];
5957 /* Only print Uniques */
5958 if (r_ptr->flags1 & (RF1_UNIQUE))
5960 bool dead = (r_ptr->max_num == 0);
5962 if (!dead) continue;
5964 /* Only display "known" uniques */
5965 if (dead || cheat_know || r_ptr->r_sights)
5967 /* Print a message */
5969 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5970 (r_name + r_ptr->name));
5972 fprintf(fff, " %s is dead\n",
5973 (r_name + r_ptr->name));
5980 /* Free the "who" array */
5981 C_KILL(who, max_r_idx, s16b);
5983 /* Close the file */
5986 /* Display the file contents */
5988 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5990 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5994 /* Remove the file */
6000 * Display weapon-exp
6002 static void do_cmd_knowledge_weapon_exp(void)
6004 int i,j, num, shougou;
6008 char file_name[1024];
6011 /* Open a new file */
6012 fff = my_fopen_temp(file_name, 1024);
6015 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6017 msg_format("Failed to create temporary file %s.", file_name);
6023 for(i = 0; i < 5; i++)
6025 for (num = 0; num < 64; num++)
6027 for (j = 0; j < max_k_idx; j++)
6029 object_kind *k_ptr = &k_info[j];
6031 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6033 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6035 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6036 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6037 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6038 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6041 fprintf(fff,"%-25s ",tmp);
6042 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6043 else fprintf(fff," ");
6044 fprintf(fff,"%s",shougou_moji[shougou]);
6045 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6053 /* Close the file */
6056 /* Display the file contents */
6058 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6060 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6064 /* Remove the file */
6072 static void do_cmd_knowledge_spell_exp(void)
6079 char file_name[1024];
6081 /* Open a new file */
6082 fff = my_fopen_temp(file_name, 1024);
6085 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6087 msg_format("Failed to create temporary file %s.", file_name);
6093 if(p_ptr->realm1 != REALM_NONE)
6096 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6098 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6100 for (i = 0; i < 32; i++)
6102 if (!is_magic(p_ptr->realm1))
6104 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6108 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6110 if(s_ptr->slevel == 99) continue;
6111 if(p_ptr->spell_exp[i]<900) shougou=0;
6112 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6113 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6114 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6116 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6117 if (p_ptr->realm1 == REALM_HISSATSU)
6118 fprintf(fff,"[--]");
6121 if (shougou == 4) fprintf(fff,"!");
6122 else fprintf(fff," ");
6123 fprintf(fff,"%s",shougou_moji[shougou]);
6125 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6130 if(p_ptr->realm2 != REALM_NONE)
6132 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6133 for (i = 0; i < 32; i++)
6135 if (!is_magic(p_ptr->realm1))
6137 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6141 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6143 if(s_ptr->slevel == 99) continue;
6145 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6146 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6147 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6149 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6150 if (shougou == 3) fprintf(fff,"!");
6151 else fprintf(fff," ");
6152 fprintf(fff,"%s",shougou_moji[shougou]);
6153 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6158 /* Close the file */
6161 /* Display the file contents */
6163 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6165 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6169 /* Remove the file */
6177 static void do_cmd_knowledge_skill_exp(void)
6183 char file_name[1024];
6185 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6187 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6190 /* Open a new file */
6191 fff = my_fopen_temp(file_name, 1024);
6194 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6196 msg_format("Failed to create temporary file %s.", file_name);
6202 for (i = 0; i < 3; i++)
6204 if(i == GINOU_RIDING)
6206 if(p_ptr->skill_exp[i]<500) shougou=0;
6207 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6208 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6209 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6214 if(p_ptr->skill_exp[i]<4000) shougou=0;
6215 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6216 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6217 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6220 fprintf(fff,"%-20s ",skill_name[i]);
6221 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6222 else fprintf(fff," ");
6223 fprintf(fff,"%s",shougou_moji[shougou]);
6224 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6228 /* Close the file */
6231 /* Display the file contents */
6233 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6235 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6239 /* Remove the file */
6245 * Pluralize a monster name
6247 void plural_aux(char *Name)
6249 int NameLen = strlen(Name);
6251 if (strstr(Name, "Disembodied hand"))
6253 strcpy(Name, "Disembodied hands that strangled people");
6255 else if (strstr(Name, "Colour out of space"))
6257 strcpy(Name, "Colours out of space");
6259 else if (strstr(Name, "stairway to hell"))
6261 strcpy(Name, "stairways to hell");
6263 else if (strstr(Name, "Dweller on the threshold"))
6265 strcpy(Name, "Dwellers on the threshold");
6267 else if (strstr(Name, " of "))
6269 cptr aider = strstr(Name, " of ");
6280 if (dummy[i-1] == 's')
6282 strcpy(&(dummy[i]), "es");
6287 strcpy(&(dummy[i]), "s");
6290 strcpy(&(dummy[i+1]), aider);
6291 strcpy(Name, dummy);
6293 else if (strstr(Name, "coins"))
6296 strcpy(dummy, "piles of ");
6297 strcat(dummy, Name);
6298 strcpy(Name, dummy);
6301 else if (strstr(Name, "Manes"))
6305 else if (streq(&(Name[NameLen - 2]), "ey"))
6307 strcpy(&(Name[NameLen - 2]), "eys");
6309 else if (Name[NameLen - 1] == 'y')
6311 strcpy(&(Name[NameLen - 1]), "ies");
6313 else if (streq(&(Name[NameLen - 4]), "ouse"))
6315 strcpy(&(Name[NameLen - 4]), "ice");
6317 else if (streq(&(Name[NameLen - 2]), "us"))
6319 strcpy(&(Name[NameLen - 2]), "i");
6321 else if (streq(&(Name[NameLen - 6]), "kelman"))
6323 strcpy(&(Name[NameLen - 6]), "kelmen");
6325 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6327 strcpy(&(Name[NameLen - 8]), "wordsmen");
6329 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6331 strcpy(&(Name[NameLen - 7]), "oodsmen");
6333 else if (streq(&(Name[NameLen - 7]), "eastman"))
6335 strcpy(&(Name[NameLen - 7]), "eastmen");
6337 else if (streq(&(Name[NameLen - 8]), "izardman"))
6339 strcpy(&(Name[NameLen - 8]), "izardmen");
6341 else if (streq(&(Name[NameLen - 5]), "geist"))
6343 strcpy(&(Name[NameLen - 5]), "geister");
6345 else if (streq(&(Name[NameLen - 2]), "ex"))
6347 strcpy(&(Name[NameLen - 2]), "ices");
6349 else if (streq(&(Name[NameLen - 2]), "lf"))
6351 strcpy(&(Name[NameLen - 2]), "lves");
6353 else if (suffix(Name, "ch") ||
6354 suffix(Name, "sh") ||
6355 suffix(Name, "nx") ||
6356 suffix(Name, "s") ||
6359 strcpy(&(Name[NameLen]), "es");
6363 strcpy(&(Name[NameLen]), "s");
6368 * Display current pets
6370 static void do_cmd_knowledge_pets(void)
6374 monster_type *m_ptr;
6376 int show_upkeep = 0;
6377 char file_name[1024];
6380 /* Open a new file */
6381 fff = my_fopen_temp(file_name, 1024);
6384 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6386 msg_format("Failed to create temporary file %s.", file_name);
6392 /* Process the monsters (backwards) */
6393 for (i = m_max - 1; i >= 1; i--)
6395 monster_race *r_ptr;
6396 /* Access the monster */
6399 /* Ignore "dead" monsters */
6400 if (!m_ptr->r_idx) continue;
6401 r_ptr = &r_info[m_ptr->r_idx];
6403 /* Calculate "upkeep" for pets */
6408 monster_desc(pet_name, m_ptr, 0x88);
6409 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6410 if (p_ptr->riding == i)
6412 fprintf(fff, " ¾èÇÏÃæ");
6414 fprintf(fff, " Riding");
6420 show_upkeep = calculate_upkeep();
6422 fprintf(fff, "----------------------------------------------\n");
6424 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6425 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6427 fprintf(fff, " Total: %d pet%s.\n",
6428 t_friends, (t_friends == 1 ? "" : "s"));
6429 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6434 /* Close the file */
6437 /* Display the file contents */
6439 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6441 show_file(TRUE, file_name, "Current Pets", 0, 0);
6445 /* Remove the file */
6453 * Note that the player ghosts are ignored. XXX XXX XXX
6455 static void do_cmd_knowledge_kill_count(void)
6463 char file_name[1024];
6468 /* Open a new file */
6469 fff = my_fopen_temp(file_name, 1024);
6473 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6475 msg_format("Failed to create temporary file %s.", file_name);
6481 /* Allocate the "who" array */
6482 C_MAKE(who, max_r_idx, s16b);
6485 /* Monsters slain */
6488 for (kk = 1; kk < max_r_idx; kk++)
6490 monster_race *r_ptr = &r_info[kk];
6492 if (r_ptr->flags1 & (RF1_UNIQUE))
6494 bool dead = (r_ptr->max_num == 0);
6503 s16b This = r_ptr->r_pkills;
6514 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6516 fprintf(fff,"You have defeated no enemies yet.\n\n");
6519 else if (Total == 1)
6521 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6523 fprintf(fff,"You have defeated one enemy.\n\n");
6528 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6530 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6537 /* Scan the monsters */
6538 for (i = 1; i < max_r_idx; i++)
6540 monster_race *r_ptr = &r_info[i];
6542 /* Use that monster */
6543 if (r_ptr->name) who[n++] = i;
6546 /* Select the sort method */
6547 ang_sort_comp = ang_sort_comp_hook;
6548 ang_sort_swap = ang_sort_swap_hook;
6550 /* Sort the array by dungeon depth of monsters */
6551 ang_sort(who, &why, n);
6553 /* Scan the monster races */
6554 for (k = 0; k < n; k++)
6556 monster_race *r_ptr = &r_info[who[k]];
6558 if (r_ptr->flags1 & (RF1_UNIQUE))
6560 bool dead = (r_ptr->max_num == 0);
6564 /* Print a message */
6565 fprintf(fff, " %s\n",
6566 (r_name + r_ptr->name));
6572 s16b This = r_ptr->r_pkills;
6577 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6578 if(strchr("pt",r_ptr->d_char))
6579 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6581 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6585 if (strstr(r_name + r_ptr->name, "coins"))
6587 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6591 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6597 strcpy(ToPlural, (r_name + r_ptr->name));
6598 plural_aux(ToPlural);
6599 fprintf(fff, " %d %s\n", This, ToPlural);
6609 fprintf(fff,"----------------------------------------------\n");
6611 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6613 fprintf(fff," Total: %lu creature%s killed.\n",
6614 Total, (Total == 1 ? "" : "s"));
6618 /* Free the "who" array */
6619 C_KILL(who, max_r_idx, s16b);
6621 /* Close the file */
6624 /* Display the file contents */
6626 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6628 show_file(TRUE, file_name, "Kill Count", 0, 0);
6632 /* Remove the file */
6638 * Display known objects
6640 static void do_cmd_knowledge_objects(void)
6646 char o_name[MAX_NLEN];
6648 char file_name[1024];
6651 /* Open a new file */
6652 fff = my_fopen_temp(file_name, 1024);
6655 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6657 msg_format("Failed to create temporary file %s.", file_name);
6663 /* Scan the object kinds */
6664 for (k = 1; k < max_k_idx; k++)
6666 object_kind *k_ptr = &k_info[k];
6668 /* Hack -- skip artifacts */
6669 if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
6671 /* List known flavored objects */
6672 if (k_ptr->flavor && k_ptr->aware)
6675 object_type object_type_body;
6677 /* Get local object */
6678 i_ptr = &object_type_body;
6680 /* Create fake object */
6681 object_prep(i_ptr, k);
6683 /* Describe the object */
6684 object_desc_store(o_name, i_ptr, FALSE, 0);
6686 /* Print a message */
6687 fprintf(fff, " %s\n", o_name);
6691 /* Close the file */
6694 /* Display the file contents */
6696 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6698 show_file(TRUE, file_name, "Known Objects", 0, 0);
6702 /* Remove the file */
6708 * List virtues & status
6711 static void do_cmd_knowledge_kubi(void)
6716 char file_name[1024];
6719 /* Open a new file */
6720 fff = my_fopen_temp(file_name, 1024);
6723 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6725 msg_format("Failed to create temporary file %s.", file_name);
6734 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6736 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6738 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6740 fprintf(fff, "List of wanted monsters\n");
6742 for (i = 0; i < MAX_KUBI; i++)
6744 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6745 if (kubi_r_idx[i] > 10000)
6747 fprintf(fff, "ºÑ\n");
6749 fprintf(fff, "done\n");
6752 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6756 /* Close the file */
6759 /* Display the file contents */
6761 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6763 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6767 /* Remove the file */
6772 * List virtues & status
6775 static void do_cmd_knowledge_virtues(void)
6779 char file_name[1024];
6782 /* Open a new file */
6783 fff = my_fopen_temp(file_name, 1024);
6786 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6788 msg_format("Failed to create temporary file %s.", file_name);
6797 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6799 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6804 /* Close the file */
6807 /* Display the file contents */
6809 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6811 show_file(TRUE, file_name, "Virtues", 0, 0);
6815 /* Remove the file */
6823 static void do_cmd_knowledge_dungeon(void)
6827 char file_name[1024];
6831 /* Open a new file */
6832 fff = my_fopen_temp(file_name, 1024);
6835 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6837 msg_format("Failed to create temporary file %s.", file_name);
6845 for (i = 1; i < max_d_idx; i++)
6849 if (!d_info[i].maxdepth) continue;
6850 if (!max_dlv[i]) continue;
6851 if (d_info[i].final_guardian)
6853 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6855 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6857 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6859 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6864 /* Close the file */
6867 /* Display the file contents */
6869 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6871 show_file(TRUE, file_name, "Dungeon", 0, 0);
6875 /* Remove the file */
6880 * List virtues & status
6883 static void do_cmd_knowledge_stat(void)
6887 char file_name[1024];
6890 /* Open a new file */
6891 fff = my_fopen_temp(file_name, 1024);
6894 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6896 msg_format("Failed to create temporary file %s.", file_name);
6904 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
6905 (2 * p_ptr->hitdie +
6906 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6909 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6910 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6911 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6913 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6914 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6915 fprintf(fff, "Limits of maximum stats\n\n");
6917 for (v_nr = 0; v_nr < 6; v_nr++)
6919 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);
6920 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6926 /* Close the file */
6929 /* Display the file contents */
6931 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6933 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6937 /* Remove the file */
6942 * Print quest status of all active quests
6944 static void do_cmd_knowledge_quests(void)
6947 char file_name[1024];
6949 char rand_tmp_str[120] = "\0";
6951 monster_race *r_ptr;
6953 int rand_level = 100;
6956 /* Open a new file */
6957 fff = my_fopen_temp(file_name, 1024);
6960 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6962 msg_format("Failed to create temporary file %s.", file_name);
6969 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6971 fprintf(fff, "< Current Quest >\n");
6974 for (i = 1; i < max_quests; i++)
6976 /* No info from "silent" quests */
6977 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6979 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6984 /* Clear the text */
6985 for (j = 0; j < 10; j++)
6987 quest_text[j][0] = '\0';
6990 quest_text_line = 0;
6994 /* Set the quest number temporary */
6995 old_quest = p_ptr->inside_quest;
6996 p_ptr->inside_quest = i;
6998 /* Get the quest text */
6999 init_flags = INIT_SHOW_TEXT;
7001 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7003 /* Reset the old quest number */
7004 p_ptr->inside_quest = old_quest;
7006 if (quest[i].type != QUEST_TYPE_RANDOM)
7008 char note[80] = "\0";
7010 if (quest[i].status == QUEST_STATUS_TAKEN)
7012 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
7014 r_ptr = &r_info[quest[i].r_idx];
7015 strcpy(name, r_name + r_ptr->name);
7016 if (quest[i].max_num > 1)
7019 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7022 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
7027 sprintf(note," - %s¤òÅݤ¹¡£",name);
7029 sprintf(note," - kill %s.",name);
7032 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
7035 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
7037 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
7040 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
7042 strcpy(name, a_name + a_info[quest[i].k_idx].name);
7044 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
7046 sprintf(note," - Find out %s.", name);
7049 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
7051 sprintf(note," - õº÷¤¹¤ë¡£");
7053 sprintf(note," - Search.");
7055 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
7057 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
7059 sprintf(note," - Kill all monsters.");
7063 /* Print the quest info */
7065 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
7067 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
7070 quest[i].name, quest[i].level, note);
7072 fprintf(fff, tmp_str);
7074 if (quest[i].status == QUEST_STATUS_COMPLETED)
7077 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
7079 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
7083 fprintf(fff, tmp_str);
7089 while (quest_text[j][0] && j < 10)
7091 fprintf(fff, " %s\n", quest_text[j]);
7096 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
7097 (quest[i].level < rand_level))
7100 rand_level = quest[i].level;
7102 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
7104 /* Print the quest info */
7105 r_ptr = &r_info[quest[i].r_idx];
7106 strcpy(name, r_name + r_ptr->name);
7108 if (quest[i].max_num > 1)
7111 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
7112 quest[i].name, quest[i].level,
7113 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7117 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
7118 quest[i].name, quest[i].level,
7119 quest[i].max_num, name, quest[i].cur_num);
7126 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
7128 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
7131 quest[i].name, quest[i].level, name);
7138 /* Print the current random quest */
7139 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
7142 if (!total) fprintf(fff, "¤Ê¤·\n");
7144 if (!total) fprintf(fff, "Nothing.\n");
7148 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7150 fprintf(fff, "\n< Completed Quest >\n");
7153 for (i = 1; i < max_quests; i++)
7155 /* No info from "silent" quests */
7156 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7158 if (quest[i].status == QUEST_STATUS_FINISHED)
7164 if (i < MIN_RANDOM_QUEST)
7166 /* Set the quest number temporary */
7167 old_quest = p_ptr->inside_quest;
7168 p_ptr->inside_quest = i;
7171 init_flags = INIT_ASSIGN;
7173 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7175 /* Reset the old quest number */
7176 p_ptr->inside_quest = old_quest;
7179 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7181 /* Print the quest info */
7183 if (quest[i].complev == 0)
7187 "%s (%d³¬) - ÉÔÀᄀ\n",
7189 "%s (Dungeon level: %d) - (Cancelled)\n",
7191 r_name+r_info[quest[i].r_idx].name,
7198 "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7200 "%s (Dungeon level: %d) - level %d\n",
7202 r_name+r_info[quest[i].r_idx].name,
7209 /* Print the quest info */
7211 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7213 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7216 quest[i].name, quest[i].level, quest[i].complev);
7219 fprintf(fff, tmp_str);
7223 if (!total) fprintf(fff, "¤Ê¤·\n");
7225 if (!total) fprintf(fff, "Nothing.\n");
7229 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7231 fprintf(fff, "\n< Failed Quest >\n");
7234 for (i = 1; i < max_quests; i++)
7236 /* No info from "silent" quests */
7237 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7239 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7245 if (i < MIN_RANDOM_QUEST)
7247 /* Set the quest number temporary */
7248 old_quest = p_ptr->inside_quest;
7249 p_ptr->inside_quest = i;
7251 /* Get the quest text */
7252 init_flags = INIT_ASSIGN;
7254 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7256 /* Reset the old quest number */
7257 p_ptr->inside_quest = old_quest;
7260 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7262 /* Print the quest info */
7264 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7266 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7269 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7273 /* Print the quest info */
7275 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7277 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7280 quest[i].name, quest[i].level, quest[i].complev);
7282 fprintf(fff, tmp_str);
7286 if (!total) fprintf(fff, "¤Ê¤·\n");
7288 if (!total) fprintf(fff, "Nothing.\n");
7291 if (p_ptr->wizard) {
7293 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7295 fprintf(fff, "\n< Remaining Random Quest >\n");
7298 for (i = 1; i < max_quests; i++)
7300 /* No info from "silent" quests */
7301 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7303 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7307 /* Print the quest info */
7309 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7311 sprintf(tmp_str, "%s (%d, %s)\n",
7314 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7315 fprintf(fff, tmp_str);
7319 if (!total) fprintf(fff, "¤Ê¤·\n");
7321 if (!total) fprintf(fff, "Nothing.\n");
7325 /* Close the file */
7328 /* Display the file contents */
7330 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7332 show_file(TRUE, file_name, "Quest status", 0, 0);
7336 /* Remove the file */
7346 static void do_cmd_knowledge_home(void)
7351 char file_name[1024];
7353 char o_name[MAX_NLEN];
7356 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7358 /* Open a new file */
7359 fff = my_fopen_temp(file_name, 1024);
7362 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7364 msg_format("Failed to create temporary file %s.", file_name);
7372 /* Print all homes in the different towns */
7373 st_ptr = &town[1].store[STORE_HOME];
7375 /* Home -- if anything there */
7376 if (st_ptr->stock_num)
7378 /* Header with name of the town */
7380 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7382 fprintf(fff, " [Home Inventory]\n");
7386 /* Dump all available items */
7387 for (i = 0; i < st_ptr->stock_num; i++)
7390 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7391 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7392 if (strlen(o_name) <= 80-3)
7394 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7400 for (n = 0, t = o_name; n < 80-3; n++, t++)
7401 if(iskanji(*t)) {t++; n++;}
7402 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7404 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7405 fprintf(fff, " %.77s\n", o_name+n);
7408 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7409 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7414 /* Add an empty line */
7415 fprintf(fff, "\n\n");
7419 /* Close the file */
7422 /* Display the file contents */
7424 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7426 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7430 /* Remove the file */
7436 * Check the status of "autopick"
7438 static void do_cmd_knowledge_autopick(void)
7442 char file_name[1024];
7444 /* Open a new file */
7445 fff = my_fopen_temp(file_name, 1024);
7450 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7452 msg_format("Failed to create temporary file %s.", file_name);
7461 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7463 fprintf(fff, "No preference for auto picker/destroyer.");
7469 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7471 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7475 for (k = 0; k < max_autopick; k++)
7478 byte act = autopick_list[k].action;
7479 if (act & DONT_AUTOPICK)
7487 else if (act & DO_AUTODESTROY)
7504 if (act & DO_DISPLAY)
7505 fprintf(fff, "%11s", format("[%s]", tmp));
7507 fprintf(fff, "%11s", format("(%s)", tmp));
7509 tmp = autopick_line_from_entry(&autopick_list[k]);
7510 fprintf(fff, " %s", tmp);
7514 /* Close the file */
7516 /* Display the file contents */
7518 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7520 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7523 /* Remove the file */
7529 * Interact with "knowledge"
7531 void do_cmd_knowledge(void)
7534 /* File type is "TEXT" */
7535 FILE_TYPE(FILE_TYPE_TEXT);
7536 /* Save the screen */
7538 /* Interact until done */
7543 /* Ask for a choice */
7545 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7546 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7548 prt(format("page %d/2", (p+1)), 2, 65);
7549 prt("Display current knowledge", 3, 0);
7552 /* Give some choices */
7555 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7556 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7557 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7558 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7559 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7560 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7561 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7562 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7563 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7565 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7566 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7567 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7568 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7569 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7570 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7571 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7572 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7573 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7577 prt("(1) Display known artifacts", 6, 5);
7578 prt("(2) Display known objects", 7, 5);
7579 prt("(3) Display remaining uniques", 8, 5);
7580 prt("(4) Display dead uniques", 9, 5);
7581 prt("(5) Display kill count", 10, 5);
7582 prt("(6) Display wanted monsters", 11, 5);
7583 prt("(7) Display current pets", 12, 5);
7584 prt("(8) Display home inventory", 13, 5);
7585 prt("(9) Display *identified* equip.", 14, 5);
7587 prt("(a) Display about yourself", 6, 5);
7588 prt("(b) Display mutations", 7, 5);
7589 prt("(c) Display weapon proficiency", 8, 5);
7590 prt("(d) Display spell proficiency", 9, 5);
7591 prt("(e) Display misc. proficiency", 10, 5);
7592 prt("(f) Display virtues", 11, 5);
7593 prt("(g) Display dungeons", 12, 5);
7594 prt("(h) Display current quests", 13, 5);
7595 prt("(i) Display auto pick/destroy", 14, 5);
7600 prt("-³¤¯-", 16, 8);
7601 prt("ESC) È´¤±¤ë", 21, 1);
7602 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7603 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7604 prt("¥³¥Þ¥ó¥É:", 20, 0);
7606 prt("-more-", 16, 8);
7607 prt("ESC) Exit menu", 21, 1);
7608 prt("SPACE) Next page", 21, 30);
7609 /*prt("-) Previous page", 21, 60);*/
7610 prt("Command: ", 20, 0);
7616 if (i == ESCAPE) break;
7619 case ' ': /* Page change */
7623 case '1': /* Artifacts */
7624 do_cmd_knowledge_artifacts();
7626 case '2': /* Objects */
7627 do_cmd_knowledge_objects();
7629 case '3': /* Uniques */
7630 do_cmd_knowledge_uniques();
7632 case '4': /* Uniques */
7633 do_cmd_knowledge_uniques_dead();
7635 case '5': /* Kill count */
7636 do_cmd_knowledge_kill_count();
7638 case '6': /* wanted */
7639 do_cmd_knowledge_kubi();
7641 case '7': /* Pets */
7642 do_cmd_knowledge_pets();
7644 case '8': /* Home */
7645 do_cmd_knowledge_home();
7647 case '9': /* Resist list */
7648 do_cmd_knowledge_inven();
7651 case 'a': /* Max stat */
7652 do_cmd_knowledge_stat();
7654 case 'b': /* Mutations */
7655 do_cmd_knowledge_mutations();
7657 case 'c': /* weapon-exp */
7658 do_cmd_knowledge_weapon_exp();
7660 case 'd': /* spell-exp */
7661 do_cmd_knowledge_spell_exp();
7663 case 'e': /* skill-exp */
7664 do_cmd_knowledge_skill_exp();
7666 case 'f': /* Virtues */
7667 do_cmd_knowledge_virtues();
7669 case 'g': /* Dungeon */
7670 do_cmd_knowledge_dungeon();
7672 case 'h': /* Quests */
7673 do_cmd_knowledge_quests();
7675 case 'i': /* Autopick */
7676 do_cmd_knowledge_autopick();
7678 default: /* Unknown option */
7681 /* Flush messages */
7684 /* Restore the screen */
7690 * Check on the status of an active quest
7692 void do_cmd_checkquest(void)
7694 /* File type is "TEXT" */
7695 FILE_TYPE(FILE_TYPE_TEXT);
7697 /* Save the screen */
7701 do_cmd_knowledge_quests();
7703 /* Restore the screen */
7709 * Display the time and date
7711 void do_cmd_time(void)
7713 int day, hour, min, full, start, end, num;
7720 extract_day_hour_min(&day, &hour, &min);
7722 full = hour * 100 + min;
7730 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7732 strcpy(desc, "It is a strange time.");
7738 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7740 msg_format("This is day %d. The time is %d:%02d %s.",
7743 day, (hour % 12 == 0) ? 12 : (hour % 12),
7744 min, (hour < 12) ? "AM" : "PM");
7747 if (!randint0(10) || p_ptr->image)
7750 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
7752 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
7759 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
7761 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
7766 /* Open this file */
7767 fff = my_fopen(buf, "rt");
7772 /* Find this time */
7773 while (!my_fgets(fff, buf, sizeof(buf)))
7775 /* Ignore comments */
7776 if (!buf[0] || (buf[0] == '#')) continue;
7778 /* Ignore invalid lines */
7779 if (buf[1] != ':') continue;
7781 /* Process 'Start' */
7784 /* Extract the starting time */
7785 start = atoi(buf + 2);
7787 /* Assume valid for an hour */
7797 /* Extract the ending time */
7798 end = atoi(buf + 2);
7804 /* Ignore incorrect range */
7805 if ((start > full) || (full > end)) continue;
7807 /* Process 'Description' */
7812 /* Apply the randomizer */
7813 if (!randint0(num)) strcpy(desc, buf + 2);
7823 /* Close the file */