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;
1130 /* Process the player name */
1131 process_player_name(FALSE);
1137 sprintf(tmp, "%s.txt", player_base);
1139 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1141 if (get_string("File name: ", tmp, 80))
1145 if (tmp[0] && (tmp[0] != ' '))
1147 file_character(tmp, TRUE);
1164 /* Flush messages */
1168 /* Restore the screen */
1171 /* Redraw everything */
1172 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1179 * Recall the most recent message
1181 void do_cmd_message_one(void)
1183 /* Recall one message XXX XXX XXX */
1184 prt(format("> %s", message_str(0)), 0, 0);
1189 * Show previous messages to the user -BEN-
1191 * The screen format uses line 0 and 23 for headers and prompts,
1192 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1194 * This command shows you which commands you are viewing, and allows
1195 * you to "search" for strings in the recall.
1197 * Note that messages may be longer than 80 characters, but they are
1198 * displayed using "infinite" length, with a special sub-command to
1199 * "slide" the virtual display to the left or right.
1201 * Attempt to only hilite the matching portions of the string.
1203 void do_cmd_messages(int num_now)
1214 Term_get_size(&wid, &hgt);
1223 /* Total messages */
1226 /* Start on first message */
1229 /* Start at leftmost edge */
1232 /* Save the screen */
1235 /* Process requests until done */
1241 /* Dump up to 20 lines of messages */
1242 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1244 cptr msg = message_str(i+j);
1246 /* Apply horizontal scroll */
1247 msg = (strlen(msg) >= q) ? (msg + q) : "";
1249 /* Dump the messages, bottom to top */
1250 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1252 /* Hilite "shower" */
1257 /* Display matches */
1258 while ((str = strstr(str, shower)) != NULL)
1260 int len = strlen(shower);
1262 /* Display the match */
1263 Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
1271 /* Display header XXX XXX XXX */
1274 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1275 i, i+j-1, n, q), 0, 0);
1277 prt(format("Message Recall (%d-%d of %d), Offset %d",
1278 i, i+j-1, n, q), 0, 0);
1282 /* Display prompt (not very informative) */
1284 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1286 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1293 /* Exit on Escape */
1294 if (k == ESCAPE) break;
1296 /* Hack -- Save the old index */
1299 /* Horizontal scroll */
1303 q = (q >= 40) ? (q - 40) : 0;
1309 /* Horizontal scroll */
1319 /* Hack -- handle show */
1324 prt("¶¯Ä´: ", hgt - 1, 0);
1326 prt("Show: ", hgt - 1, 0);
1330 /* Get a "shower" string, or continue */
1331 if (!askfor_aux(shower, 80)) continue;
1337 /* Hack -- handle find */
1344 prt("¸¡º÷: ", hgt - 1, 0);
1346 prt("Find: ", hgt - 1, 0);
1350 /* Get a "finder" string, or continue */
1351 if (!askfor_aux(finder, 80)) continue;
1354 strcpy(shower, finder);
1357 for (z = i + 1; z < n; z++)
1359 cptr msg = message_str(z);
1362 if (strstr(msg, finder))
1373 /* Recall 1 older message */
1374 if ((k == '8') || (k == '\n') || (k == '\r'))
1376 /* Go newer if legal */
1377 if (i + 1 < n) i += 1;
1380 /* Recall 10 older messages */
1383 /* Go older if legal */
1384 if (i + 10 < n) i += 10;
1387 /* Recall 20 older messages */
1388 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1390 /* Go older if legal */
1391 if (i + 20 < n) i += 20;
1394 /* Recall 20 newer messages */
1395 if ((k == 'n') || (k == KTRL('N')))
1397 /* Go newer (if able) */
1398 i = (i >= 20) ? (i - 20) : 0;
1401 /* Recall 10 newer messages */
1404 /* Go newer (if able) */
1405 i = (i >= 20) ? (i - 20) : 0;
1408 /* Recall 1 newer messages */
1411 /* Go newer (if able) */
1412 i = (i >= 1) ? (i - 1) : 0;
1415 /* Hack -- Error of some kind */
1419 /* Restore the screen */
1426 * Number of cheating options
1433 static option_type cheat_info[CHEAT_MAX] =
1435 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1437 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1439 "cheat_peek", "Peek into object creation"
1443 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1445 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1447 "cheat_hear", "Peek into monster creation"
1451 { &cheat_room, FALSE, 255, 0x04, 0x00,
1453 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë"
1455 "cheat_room", "Peek into dungeon creation"
1459 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1461 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë"
1463 "cheat_xtra", "Peek into something else"
1467 { &cheat_know, FALSE, 255, 0x10, 0x00,
1469 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë"
1471 "cheat_know", "Know complete monster info"
1475 { &cheat_live, FALSE, 255, 0x20, 0x00,
1477 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë"
1479 "cheat_live", "Allow player to avoid death"
1485 * Interact with some options for cheating
1487 static void do_cmd_options_cheat(cptr info)
1491 int i, k = 0, n = CHEAT_MAX;
1499 /* Interact with the player */
1504 /* Prompt XXX XXX XXX */
1506 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1508 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1514 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1515 prt(" << Ãí°Õ >>", 11, 0);
1516 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1517 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1518 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1520 /* Display the options */
1521 for (i = 0; i < n; i++)
1523 byte a = TERM_WHITE;
1525 /* Color current option */
1526 if (i == k) a = TERM_L_BLUE;
1528 /* Display the option text */
1529 sprintf(buf, "%-48s: %s (%s)",
1530 cheat_info[i].o_desc,
1532 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1534 (*cheat_info[i].o_var ? "yes" : "no "),
1537 cheat_info[i].o_text);
1538 c_prt(a, buf, i + 2, 0);
1541 /* Hilite current option */
1542 move_cursor(k + 2, 50);
1548 * HACK - Try to translate the key into a direction
1549 * to allow using the roguelike keys for navigation.
1551 dir = get_keymap_dir(ch);
1552 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1566 k = (n + k - 1) % n;
1585 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1587 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1589 p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1590 (*cheat_info[k].o_var) = TRUE;
1599 (*cheat_info[k].o_var) = FALSE;
1607 strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text);
1609 strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text);
1611 /* Peruse the help file */
1612 (void)show_file(TRUE, buf, NULL, 0, 0);
1628 static option_type autosave_info[2] =
1630 { &autosave_l, FALSE, 255, 0x01, 0x00,
1632 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1634 "autosave_l", "Autosave when entering new levels" },
1638 { &autosave_t, FALSE, 255, 0x02, 0x00,
1640 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1642 "autosave_t", "Timed autosave" },
1648 static s16b toggle_frequency(s16b current)
1650 if (current == 0) return 50;
1651 if (current == 50) return 100;
1652 if (current == 100) return 250;
1653 if (current == 250) return 500;
1654 if (current == 500) return 1000;
1655 if (current == 1000) return 2500;
1656 if (current == 2500) return 5000;
1657 if (current == 5000) return 10000;
1658 if (current == 10000) return 25000;
1665 * Interact with some options for cheating
1667 static void do_cmd_options_autosave(cptr info)
1671 int i, k = 0, n = 2;
1679 /* Interact with the player */
1682 /* Prompt XXX XXX XXX */
1684 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1686 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1691 /* Display the options */
1692 for (i = 0; i < n; i++)
1694 byte a = TERM_WHITE;
1696 /* Color current option */
1697 if (i == k) a = TERM_L_BLUE;
1699 /* Display the option text */
1700 sprintf(buf, "%-48s: %s (%s)",
1701 autosave_info[i].o_desc,
1703 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1705 (*autosave_info[i].o_var ? "yes" : "no "),
1708 autosave_info[i].o_text);
1709 c_prt(a, buf, i + 2, 0);
1713 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1715 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1720 /* Hilite current option */
1721 move_cursor(k + 2, 50);
1737 k = (n + k - 1) % n;
1755 (*autosave_info[k].o_var) = TRUE;
1764 (*autosave_info[k].o_var) = FALSE;
1772 autosave_freq = toggle_frequency(autosave_freq);
1774 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1775 autosave_freq), 5, 0);
1777 prt(format("Timed autosave frequency: every %d turns",
1778 autosave_freq), 5, 0);
1786 (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0);
1788 (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0);
1806 #define PAGE_AUTODESTROY 7
1809 * Interact with some options
1811 void do_cmd_options_aux(int page, cptr info)
1814 int i, k = 0, n = 0, l;
1819 /* Lookup the options */
1820 for (i = 0; i < 24; i++) opt[i] = 0;
1822 /* Scan the options */
1823 for (i = 0; option_info[i].o_desc; i++)
1825 /* Notice options on this "page" */
1826 if (option_info[i].o_page == page) opt[n++] = i;
1833 /* Interact with the player */
1838 /* Prompt XXX XXX XXX */
1840 sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, y/n:Êѹ¹, ESC:½ªÎ», ?:¥Ø¥ë¥×) ", info);
1842 sprintf(buf, "%s (RET:next, y/n:change, ESC:accept, ?:help) ", info);
1848 /* HACK -- description for easy-auto-destroy options */
1850 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6);
1852 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3);
1855 /* Display the options */
1856 for (i = 0; i < n; i++)
1858 byte a = TERM_WHITE;
1860 /* Color current option */
1861 if (i == k) a = TERM_L_BLUE;
1863 /* Display the option text */
1864 sprintf(buf, "%-48s: %s (%.19s)",
1865 option_info[opt[i]].o_desc,
1867 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1869 (*option_info[opt[i]].o_var ? "yes" : "no "),
1872 option_info[opt[i]].o_text);
1873 if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1874 else c_prt(a, buf, i + 2, 0);
1877 if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3;
1880 /* Hilite current option */
1881 move_cursor(k + 2 + l, 50);
1887 * HACK - Try to translate the key into a direction
1888 * to allow using the roguelike keys for navigation.
1890 dir = get_keymap_dir(ch);
1891 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1905 k = (n + k - 1) % n;
1922 (*option_info[opt[k]].o_var) = TRUE;
1931 (*option_info[opt[k]].o_var) = FALSE;
1939 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1946 strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text);
1948 strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text);
1950 /* Peruse the help file */
1951 (void)show_file(TRUE, buf, NULL, 0, 0);
1968 * Modify the "window" options
1970 static void do_cmd_options_win(void)
1984 /* Memorize old flags */
1985 for (j = 0; j < 8; j++)
1987 /* Acquire current flags */
1988 old_flag[j] = window_flag[j];
1998 /* Prompt XXX XXX XXX */
2000 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
2002 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
2006 /* Display the windows */
2007 for (j = 0; j < 8; j++)
2009 byte a = TERM_WHITE;
2011 cptr s = angband_term_name[j];
2014 if (j == x) a = TERM_L_BLUE;
2016 /* Window name, staggered, centered */
2017 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
2020 /* Display the options */
2021 for (i = 0; i < 16; i++)
2023 byte a = TERM_WHITE;
2025 cptr str = window_flag_desc[i];
2028 if (i == y) a = TERM_L_BLUE;
2032 if (!str) str = "(̤»ÈÍÑ)";
2034 if (!str) str = "(Unused option)";
2039 Term_putstr(0, i + 5, -1, a, str);
2041 /* Display the windows */
2042 for (j = 0; j < 8; j++)
2044 byte a = TERM_WHITE;
2049 if ((i == y) && (j == x)) a = TERM_L_BLUE;
2052 if (window_flag[j] & (1L << i)) c = 'X';
2055 Term_putch(35 + j * 5, i + 5, a, c);
2060 Term_gotoxy(35 + x * 5, y + 5);
2078 for (j = 0; j < 8; j++)
2080 window_flag[j] &= ~(1L << y);
2084 for (i = 0; i < 16; i++)
2086 window_flag[x] &= ~(1L << i);
2099 window_flag[x] |= (1L << y);
2107 window_flag[x] &= ~(1L << y);
2114 (void)show_file(TRUE, "joption.txt#Window", NULL, 0, 0);
2116 (void)show_file(TRUE, "option.txt#Window", NULL, 0, 0);
2126 d = get_keymap_dir(ch);
2128 x = (x + ddx[d] + 8) % 8;
2129 y = (y + ddy[d] + 16) % 16;
2136 /* Notice changes */
2137 for (j = 0; j < 8; j++)
2142 if (!angband_term[j]) continue;
2144 /* Ignore non-changes */
2145 if (window_flag[j] == old_flag[j]) continue;
2148 Term_activate(angband_term[j]);
2165 * Set or unset various options.
2167 * The user must use the "Ctrl-R" command to "adapt" to changes
2168 * in any options which control "visual" aspects of the game.
2170 void do_cmd_options(void)
2175 /* Save the screen */
2184 /* Why are we here */
2186 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2188 prt("Options", 2, 0);
2192 /* Give some choices */
2194 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2195 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2196 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2197 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2198 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2199 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2200 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2201 /* Special choices */
2202 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2203 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2204 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2206 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2208 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2210 prt("(1) Input Options", 4, 5);
2211 prt("(2) Output Options", 5, 5);
2212 prt("(3) Game-Play Options", 6, 5);
2213 prt("(4) Disturbance Options", 7, 5);
2214 prt("(5) Efficiency Options", 8, 5);
2215 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2216 prt("(R) Play-record Options", 10, 5);
2218 /* Special choices */
2219 prt("(D) Base Delay Factor", 12, 5);
2220 prt("(H) Hitpoint Warning", 13, 5);
2221 prt("(A) Autosave Options", 14, 5);
2225 prt("(W) Window Flags", 15, 5);
2228 prt("(C) Cheating Options", 16, 5);
2234 prt("¥³¥Þ¥ó¥É:", 18, 0);
2236 prt("Command: ", 18, 0);
2244 if (k == ESCAPE) break;
2249 /* General Options */
2252 /* Process the general options */
2254 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2256 do_cmd_options_aux(1, "Input Options");
2262 /* General Options */
2265 /* Process the general options */
2267 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2269 do_cmd_options_aux(2, "Output Options");
2275 /* Inventory Options */
2280 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2282 do_cmd_options_aux(3, "Game-Play Options");
2288 /* Disturbance Options */
2293 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2295 do_cmd_options_aux(4, "Disturbance Options");
2301 /* Efficiency Options */
2306 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2308 do_cmd_options_aux(5, "Efficiency Options");
2314 /* Object auto-destruction Options */
2319 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2321 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2326 /* Play-record Options */
2332 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2334 do_cmd_options_aux(10, "Play-record Option");
2339 /* Cheating Options */
2344 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2346 do_cmd_options_cheat("Cheaters never win");
2356 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2358 do_cmd_options_autosave("Autosave");
2369 do_cmd_options_win();
2370 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2371 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2372 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2373 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2377 /* Hack -- Delay Speed */
2383 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2385 prt("Command: Base Delay Factor", 18, 0);
2389 /* Get a new value */
2392 int msec = delay_factor * delay_factor * delay_factor;
2394 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2395 delay_factor, msec), 22, 0);
2397 prt(format("Current base delay factor: %d (%d msec)",
2398 delay_factor, msec), 22, 0);
2402 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2404 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2408 if (k == ESCAPE) break;
2412 (void)show_file(TRUE, "joption.txt#BaseDelay", NULL, 0, 0);
2414 (void)show_file(TRUE, "option.txt#BaseDelay", NULL, 0, 0);
2418 else if (isdigit(k)) delay_factor = D2I(k);
2425 /* Hack -- hitpoint warning factor */
2431 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2433 prt("Command: Hitpoint Warning", 18, 0);
2437 /* Get a new value */
2441 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2442 hitpoint_warn), 22, 0);
2444 prt(format("Current hitpoint warning: %d0%%",
2445 hitpoint_warn), 22, 0);
2449 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2451 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2455 if (k == ESCAPE) break;
2459 (void)show_file(TRUE, "joption.txt#Hitpoint", NULL, 0, 0);
2461 (void)show_file(TRUE, "option.txt#Hitpoint", NULL, 0, 0);
2465 else if (isdigit(k)) hitpoint_warn = D2I(k);
2474 (void)show_file(TRUE, "joption.txt", NULL, 0, 0);
2476 (void)show_file(TRUE, "option.txt", NULL, 0, 0);
2481 /* Unknown option */
2490 /* Flush messages */
2495 /* Restore the screen */
2498 /* Hack - Redraw equippy chars */
2499 p_ptr->redraw |= (PR_EQUIPPY);
2505 * Ask for a "user pref line" and process it
2507 * XXX XXX XXX Allow absolute file names?
2509 void do_cmd_pref(void)
2516 /* Ask for a "user pref command" */
2518 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2520 if (!get_string("Pref: ", buf, 80)) return;
2524 /* Process that pref command */
2525 (void)process_pref_file_command(buf);
2528 void do_cmd_pickpref(void)
2534 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2536 if(!get_check("Reload auto-pick preference file? ")) return;
2539 /* Free old entries */
2542 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2544 sprintf(buf, "picktype-%s.prf", player_name);
2546 sprintf(buf, "pickpref-%s.prf", player_name);
2548 err = process_pickpref_file(buf);
2553 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2555 msg_format("loaded '%s'.", buf);
2559 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2561 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
2565 err = process_pickpref_file("picktype.prf");
2567 err = process_pickpref_file("pickpref.prf");
2573 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2575 msg_print("loaded 'pickpref.prf'.");
2582 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2584 if(err) msg_print("Failed to reload autopick preference.");
2591 * Hack -- append all current macros to the given file
2593 static errr macro_dump(cptr fname)
2595 static cptr mark = "Macro Dump";
2603 /* Build the filename */
2604 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2606 /* File type is "TEXT" */
2607 FILE_TYPE(FILE_TYPE_TEXT);
2609 /* Append to the file */
2610 fff = open_auto_dump(buf, mark, &line_num);
2611 if (!fff) return (-1);
2615 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2617 fprintf(fff, "\n# Automatic macro dump\n\n");
2622 for (i = 0; i < macro__num; i++)
2624 /* Extract the action */
2625 ascii_to_text(buf, macro__act[i]);
2627 /* Dump the macro */
2628 fprintf(fff, "A:%s\n", buf);
2630 /* Extract the action */
2631 ascii_to_text(buf, macro__pat[i]);
2633 /* Dump normal macros */
2634 fprintf(fff, "P:%s\n", buf);
2639 /* count number of lines */
2644 close_auto_dump(fff, mark, line_num);
2652 * Hack -- ask for a "trigger" (see below)
2654 * Note the complex use of the "inkey()" function from "util.c".
2656 * Note that both "flush()" calls are extremely important.
2658 static void do_cmd_macro_aux(char *buf)
2668 /* Do not process macros */
2674 /* Read the pattern */
2680 /* Do not process macros */
2683 /* Do not wait for keys */
2686 /* Attempt to read a key */
2697 /* Convert the trigger */
2698 ascii_to_text(tmp, buf);
2700 /* Hack -- display the trigger */
2701 Term_addstr(-1, TERM_WHITE, tmp);
2708 * Hack -- ask for a keymap "trigger" (see below)
2710 * Note that both "flush()" calls are extremely important. This may
2711 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2713 static void do_cmd_macro_aux_keymap(char *buf)
2727 /* Convert to ascii */
2728 ascii_to_text(tmp, buf);
2730 /* Hack -- display the trigger */
2731 Term_addstr(-1, TERM_WHITE, tmp);
2740 * Hack -- append all keymaps to the given file
2742 static errr keymap_dump(cptr fname)
2744 static cptr mark = "Keymap Dump";
2756 if (rogue_like_commands)
2758 mode = KEYMAP_MODE_ROGUE;
2764 mode = KEYMAP_MODE_ORIG;
2768 /* Build the filename */
2769 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
2771 /* File type is "TEXT" */
2772 FILE_TYPE(FILE_TYPE_TEXT);
2774 /* Append to the file */
2775 fff = open_auto_dump(buf, mark, &line_num);
2776 if (!fff) return -1;
2780 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2782 fprintf(fff, "\n# Automatic keymap dump\n\n");
2787 for (i = 0; i < 256; i++)
2791 /* Loop up the keymap */
2792 act = keymap_act[mode][i];
2794 /* Skip empty keymaps */
2797 /* Encode the key */
2800 ascii_to_text(key, buf);
2802 /* Encode the action */
2803 ascii_to_text(buf, act);
2805 /* Dump the macro */
2806 fprintf(fff, "A:%s\n", buf);
2807 fprintf(fff, "C:%d:%s\n", mode, key);
2812 close_auto_dump(fff, mark, line_num);
2821 * Interact with "macros"
2823 * Note that the macro "action" must be defined before the trigger.
2825 * Could use some helpful instructions on this page. XXX XXX XXX
2827 void do_cmd_macros(void)
2839 if (rogue_like_commands)
2841 mode = KEYMAP_MODE_ROGUE;
2847 mode = KEYMAP_MODE_ORIG;
2850 /* File type is "TEXT" */
2851 FILE_TYPE(FILE_TYPE_TEXT);
2858 /* Process requests until done */
2866 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2868 prt("Interact with Macros", 2, 0);
2873 /* Describe that action */
2875 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2877 prt("Current action (if any) shown below:", 20, 0);
2881 /* Analyze the current action */
2882 ascii_to_text(buf, macro__buf);
2884 /* Display the current action */
2890 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2892 prt("(1) Load a user pref file", 4, 5);
2897 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2898 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2899 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2900 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2901 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2902 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2903 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2904 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2905 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2907 prt("(2) Append macros to a file", 5, 5);
2908 prt("(3) Query a macro", 6, 5);
2909 prt("(4) Create a macro", 7, 5);
2910 prt("(5) Remove a macro", 8, 5);
2911 prt("(6) Append keymaps to a file", 9, 5);
2912 prt("(7) Query a keymap", 10, 5);
2913 prt("(8) Create a keymap", 11, 5);
2914 prt("(9) Remove a keymap", 12, 5);
2915 prt("(0) Enter a new action", 13, 5);
2918 #endif /* ALLOW_MACROS */
2922 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2924 prt("Command: ", 16, 0);
2932 if (i == ESCAPE) break;
2934 /* Load a 'macro' file */
2941 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2943 prt("Command: Load a user pref file", 16, 0);
2949 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2951 prt("File: ", 18, 0);
2955 /* Default filename */
2956 sprintf(tmp, "%s.prf", player_name);
2958 /* Ask for a file */
2959 if (!askfor_aux(tmp, 80)) continue;
2961 /* Process the given filename */
2962 err = process_pref_file(tmp);
2966 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2968 msg_format("Loaded default '%s'.", tmp);
2975 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2977 msg_format("Failed to load '%s'!");
2983 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2985 msg_format("Loaded '%s'.", tmp);
2997 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2999 prt("Command: Append macros to a file", 16, 0);
3005 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3007 prt("File: ", 18, 0);
3011 /* Default filename */
3012 sprintf(tmp, "%s.prf", player_name);
3014 /* Ask for a file */
3015 if (!askfor_aux(tmp, 80)) continue;
3017 /* Dump the macros */
3018 (void)macro_dump(tmp);
3022 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3024 msg_print("Appended macros.");
3036 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
3038 prt("Command: Query a macro", 16, 0);
3044 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3046 prt("Trigger: ", 18, 0);
3050 /* Get a macro trigger */
3051 do_cmd_macro_aux(buf);
3053 /* Acquire action */
3054 k = macro_find_exact(buf);
3061 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3063 msg_print("Found no macro.");
3071 /* Obtain the action */
3072 strcpy(macro__buf, macro__act[k]);
3074 /* Analyze the current action */
3075 ascii_to_text(buf, macro__buf);
3077 /* Display the current action */
3082 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3084 msg_print("Found a macro.");
3090 /* Create a macro */
3095 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
3097 prt("Command: Create a macro", 16, 0);
3103 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3105 prt("Trigger: ", 18, 0);
3109 /* Get a macro trigger */
3110 do_cmd_macro_aux(buf);
3117 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3119 prt("Action: ", 20, 0);
3123 /* Convert to text */
3124 ascii_to_text(tmp, macro__buf);
3126 /* Get an encoded action */
3127 if (askfor_aux(tmp, 80))
3129 /* Convert to ascii */
3130 text_to_ascii(macro__buf, tmp);
3132 /* Link the macro */
3133 macro_add(buf, macro__buf);
3137 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3139 msg_print("Added a macro.");
3145 /* Remove a macro */
3150 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3152 prt("Command: Remove a macro", 16, 0);
3158 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3160 prt("Trigger: ", 18, 0);
3164 /* Get a macro trigger */
3165 do_cmd_macro_aux(buf);
3167 /* Link the macro */
3168 macro_add(buf, buf);
3172 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3174 msg_print("Removed a macro.");
3184 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3186 prt("Command: Append keymaps to a file", 16, 0);
3192 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3194 prt("File: ", 18, 0);
3198 /* Default filename */
3199 sprintf(tmp, "%s.prf", player_name);
3201 /* Ask for a file */
3202 if (!askfor_aux(tmp, 80)) continue;
3204 /* Dump the macros */
3205 (void)keymap_dump(tmp);
3209 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3211 msg_print("Appended keymaps.");
3216 /* Query a keymap */
3223 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3225 prt("Command: Query a keymap", 16, 0);
3231 prt("²¡¤¹¥¡¼: ", 18, 0);
3233 prt("Keypress: ", 18, 0);
3237 /* Get a keymap trigger */
3238 do_cmd_macro_aux_keymap(buf);
3240 /* Look up the keymap */
3241 act = keymap_act[mode][(byte)(buf[0])];
3248 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3250 msg_print("Found no keymap.");
3258 /* Obtain the action */
3259 strcpy(macro__buf, act);
3261 /* Analyze the current action */
3262 ascii_to_text(buf, macro__buf);
3264 /* Display the current action */
3269 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3271 msg_print("Found a keymap.");
3277 /* Create a keymap */
3282 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3284 prt("Command: Create a keymap", 16, 0);
3290 prt("²¡¤¹¥¡¼: ", 18, 0);
3292 prt("Keypress: ", 18, 0);
3296 /* Get a keymap trigger */
3297 do_cmd_macro_aux_keymap(buf);
3304 prt("¹ÔÆ°: ", 20, 0);
3306 prt("Action: ", 20, 0);
3310 /* Convert to text */
3311 ascii_to_text(tmp, macro__buf);
3313 /* Get an encoded action */
3314 if (askfor_aux(tmp, 80))
3316 /* Convert to ascii */
3317 text_to_ascii(macro__buf, tmp);
3319 /* Free old keymap */
3320 string_free(keymap_act[mode][(byte)(buf[0])]);
3322 /* Make new keymap */
3323 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3327 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3329 msg_print("Added a keymap.");
3335 /* Remove a keymap */
3340 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3342 prt("Command: Remove a keymap", 16, 0);
3348 prt("²¡¤¹¥¡¼: ", 18, 0);
3350 prt("Keypress: ", 18, 0);
3354 /* Get a keymap trigger */
3355 do_cmd_macro_aux_keymap(buf);
3357 /* Free old keymap */
3358 string_free(keymap_act[mode][(byte)(buf[0])]);
3360 /* Make new keymap */
3361 keymap_act[mode][(byte)(buf[0])] = NULL;
3365 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3367 msg_print("Removed a keymap.");
3372 /* Enter a new action */
3377 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3379 prt("Command: Enter a new action", 16, 0);
3383 /* Go to the correct location */
3386 /* Hack -- limit the value */
3389 /* Get an encoded action */
3390 if (!askfor_aux(buf, 80)) continue;
3392 /* Extract an action */
3393 text_to_ascii(macro__buf, buf);
3396 #endif /* ALLOW_MACROS */
3405 /* Flush messages */
3414 static void cmd_visuals_aux(int i, int *num, int max)
3421 sprintf(str, "%d", *num);
3423 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3426 tmp = strtol(str, NULL, 0);
3427 if (tmp >= 0 && tmp < max)
3431 else if (isupper(i))
3432 *num = (*num + max - 1) % max;
3434 *num = (*num + 1) % max;
3440 * Interact with "visuals"
3442 void do_cmd_visuals(void)
3453 /* File type is "TEXT" */
3454 FILE_TYPE(FILE_TYPE_TEXT);
3457 /* Save the screen */
3461 /* Interact until done */
3467 /* Ask for a choice */
3469 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3471 prt("Interact with Visuals", 2, 0);
3475 /* Give some choices */
3477 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3479 prt("(1) Load a user pref file", 4, 5);
3482 #ifdef ALLOW_VISUALS
3484 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3485 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3486 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3487 prt("(5) (̤»ÈÍÑ)", 8, 5);
3488 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3489 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3490 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3491 prt("(9) (̤»ÈÍÑ)", 12, 5);
3493 prt("(2) Dump monster attr/chars", 5, 5);
3494 prt("(3) Dump object attr/chars", 6, 5);
3495 prt("(4) Dump feature attr/chars", 7, 5);
3496 prt("(5) (unused)", 8, 5);
3497 prt("(6) Change monster attr/chars", 9, 5);
3498 prt("(7) Change object attr/chars", 10, 5);
3499 prt("(8) Change feature attr/chars", 11, 5);
3500 prt("(9) (unused)", 12, 5);
3505 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3507 prt("(0) Reset visuals", 13, 5);
3513 prt("¥³¥Þ¥ó¥É:", 18, 0);
3515 prt("Command: ", 15, 0);
3523 if (i == ESCAPE) break;
3525 /* Load a 'pref' file */
3530 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3532 prt("Command: Load a user pref file", 15, 0);
3538 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3540 prt("File: ", 17, 0);
3544 /* Default filename */
3545 sprintf(tmp, "%s.prf", player_name);
3548 if (!askfor_aux(tmp, 70)) continue;
3550 /* Process the given filename */
3551 (void)process_pref_file(tmp);
3554 #ifdef ALLOW_VISUALS
3556 /* Dump monster attr/chars */
3559 static cptr mark = "Monster attr/chars";
3564 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3566 prt("Command: Dump monster attr/chars", 15, 0);
3572 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3574 prt("File: ", 17, 0);
3578 /* Default filename */
3579 sprintf(tmp, "%s.prf", player_name);
3581 /* Get a filename */
3582 if (!askfor_aux(tmp, 70)) continue;
3584 /* Build the filename */
3585 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3587 /* Append to the file */
3588 fff = open_auto_dump(buf, mark, &line_num);
3593 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3595 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3600 for (i = 0; i < max_r_idx; i++)
3602 monster_race *r_ptr = &r_info[i];
3604 /* Skip non-entries */
3605 if (!r_ptr->name) continue;
3607 /* Dump a comment */
3608 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3611 /* Dump the monster attr/char info */
3612 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3613 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3618 close_auto_dump(fff, mark, line_num);
3622 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3624 msg_print("Dumped monster attr/chars.");
3629 /* Dump object attr/chars */
3632 static cptr mark = "Object attr/chars";
3637 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3639 prt("Command: Dump object attr/chars", 15, 0);
3645 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3647 prt("File: ", 17, 0);
3651 /* Default filename */
3652 sprintf(tmp, "%s.prf", player_name);
3654 /* Get a filename */
3655 if (!askfor_aux(tmp, 70)) continue;
3657 /* Build the filename */
3658 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3660 /* Append to the file */
3661 fff = open_auto_dump(buf, mark, &line_num);
3666 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3668 fprintf(fff, "\n# Object attr/char definitions\n\n");
3673 for (i = 0; i < max_k_idx; i++)
3675 object_kind *k_ptr = &k_info[i];
3677 /* Skip non-entries */
3678 if (!k_ptr->name) continue;
3680 /* Dump a comment */
3681 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3684 /* Dump the object attr/char info */
3685 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3686 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3691 close_auto_dump(fff, mark, line_num);
3695 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3697 msg_print("Dumped object attr/chars.");
3702 /* Dump feature attr/chars */
3705 static cptr mark = "Feature attr/chars";
3710 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3712 prt("Command: Dump feature attr/chars", 15, 0);
3718 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3720 prt("File: ", 17, 0);
3724 /* Default filename */
3725 sprintf(tmp, "%s.prf", player_name);
3727 /* Get a filename */
3728 if (!askfor_aux(tmp, 70)) continue;
3730 /* Build the filename */
3731 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
3733 /* Append to the file */
3734 fff = open_auto_dump(buf, mark, &line_num);
3739 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3741 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3746 for (i = 0; i < max_f_idx; i++)
3748 feature_type *f_ptr = &f_info[i];
3750 /* Skip non-entries */
3751 if (!f_ptr->name) continue;
3753 /* Dump a comment */
3754 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3757 /* Dump the feature attr/char info */
3758 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3759 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3764 close_auto_dump(fff, mark, line_num);
3768 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3770 msg_print("Dumped feature attr/chars.");
3775 /* Modify monster attr/chars */
3782 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3784 prt("Command: Change monster attr/chars", 15, 0);
3788 /* Hack -- query until done */
3791 monster_race *r_ptr = &r_info[r];
3795 byte da = (r_ptr->d_attr);
3796 byte dc = (r_ptr->d_char);
3797 byte ca = (r_ptr->x_attr);
3798 byte cc = (r_ptr->x_char);
3800 /* Label the object */
3802 Term_putstr(5, 17, -1, TERM_WHITE,
3803 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3804 r, (r_name + r_ptr->name)));
3806 Term_putstr(5, 17, -1, TERM_WHITE,
3807 format("Monster = %d, Name = %-40.40s",
3808 r, (r_name + r_ptr->name)));
3812 /* Label the Default values */
3814 Term_putstr(10, 19, -1, TERM_WHITE,
3815 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3817 Term_putstr(10, 19, -1, TERM_WHITE,
3818 format("Default attr/char = %3u / %3u", da, dc));
3821 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3822 Term_putch(43, 19, da, dc);
3826 Term_putch(44, 19, 255, -1);
3828 Term_putch(44, 19, 0, ' ');
3831 /* Label the Current values */
3833 Term_putstr(10, 20, -1, TERM_WHITE,
3834 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3836 Term_putstr(10, 20, -1, TERM_WHITE,
3837 format("Current attr/char = %3u / %3u", ca, cc));
3840 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3841 Term_putch(43, 20, ca, cc);
3845 Term_putch(44, 20, 255, -1);
3847 Term_putch(44, 20, 0, ' ');
3852 Term_putstr(0, 22, -1, TERM_WHITE,
3853 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3855 Term_putstr(0, 22, -1, TERM_WHITE,
3856 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3863 if (i == ESCAPE) break;
3865 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3866 else if (isupper(i)) c = 'a' + i - 'A';
3872 cmd_visuals_aux(i, &r, max_r_idx);
3875 t = (int)r_ptr->x_attr;
3876 cmd_visuals_aux(i, &t, 256);
3877 r_ptr->x_attr = (byte)t;
3880 t = (int)r_ptr->x_char;
3881 cmd_visuals_aux(i, &t, 256);
3882 r_ptr->x_char = (byte)t;
3888 /* Modify object attr/chars */
3895 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3897 prt("Command: Change object attr/chars", 15, 0);
3901 /* Hack -- query until done */
3904 object_kind *k_ptr = &k_info[k];
3908 byte da = (byte)k_ptr->d_attr;
3909 byte dc = (byte)k_ptr->d_char;
3910 byte ca = (byte)k_ptr->x_attr;
3911 byte cc = (byte)k_ptr->x_char;
3913 /* Label the object */
3915 Term_putstr(5, 17, -1, TERM_WHITE,
3916 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3917 k, (k_name + k_ptr->name)));
3919 Term_putstr(5, 17, -1, TERM_WHITE,
3920 format("Object = %d, Name = %-40.40s",
3921 k, (k_name + k_ptr->name)));
3925 /* Label the Default values */
3927 Term_putstr(10, 19, -1, TERM_WHITE,
3928 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3930 Term_putstr(10, 19, -1, TERM_WHITE,
3931 format("Default attr/char = %3d / %3d", da, dc));
3934 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3935 Term_putch(43, 19, da, dc);
3939 Term_putch(44, 19, 255, -1);
3941 Term_putch(44, 19, 0, ' ');
3944 /* Label the Current values */
3946 Term_putstr(10, 20, -1, TERM_WHITE,
3947 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3949 Term_putstr(10, 20, -1, TERM_WHITE,
3950 format("Current attr/char = %3d / %3d", ca, cc));
3953 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3954 Term_putch(43, 20, ca, cc);
3958 Term_putch(44, 20, 255, -1);
3960 Term_putch(44, 20, 0, ' ');
3965 Term_putstr(0, 22, -1, TERM_WHITE,
3966 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3968 Term_putstr(0, 22, -1, TERM_WHITE,
3969 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3976 if (i == ESCAPE) break;
3978 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3979 else if (isupper(i)) c = 'a' + i - 'A';
3985 cmd_visuals_aux(i, &k, max_k_idx);
3988 t = (int)k_info[k].x_attr;
3989 cmd_visuals_aux(i, &t, 256);
3990 k_info[k].x_attr = (byte)t;
3993 t = (int)k_info[k].x_char;
3994 cmd_visuals_aux(i, &t, 256);
3995 k_info[k].x_char = (byte)t;
4001 /* Modify feature attr/chars */
4008 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
4010 prt("Command: Change feature attr/chars", 15, 0);
4014 /* Hack -- query until done */
4017 feature_type *f_ptr = &f_info[f];
4021 byte da = (byte)f_ptr->d_attr;
4022 byte dc = (byte)f_ptr->d_char;
4023 byte ca = (byte)f_ptr->x_attr;
4024 byte cc = (byte)f_ptr->x_char;
4026 /* Label the object */
4028 Term_putstr(5, 17, -1, TERM_WHITE,
4029 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
4030 f, (f_name + f_ptr->name)));
4032 Term_putstr(5, 17, -1, TERM_WHITE,
4033 format("Terrain = %d, Name = %-40.40s",
4034 f, (f_name + f_ptr->name)));
4038 /* Label the Default values */
4040 Term_putstr(10, 19, -1, TERM_WHITE,
4041 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
4043 Term_putstr(10, 19, -1, TERM_WHITE,
4044 format("Default attr/char = %3d / %3d", da, dc));
4047 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
4048 Term_putch(43, 19, da, dc);
4052 Term_putch(44, 19, 255, -1);
4054 Term_putch(44, 19, 0, ' ');
4057 /* Label the Current values */
4059 Term_putstr(10, 20, -1, TERM_WHITE,
4060 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
4062 Term_putstr(10, 20, -1, TERM_WHITE,
4063 format("Current attr/char = %3d / %3d", ca, cc));
4066 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
4067 Term_putch(43, 20, ca, cc);
4071 Term_putch(44, 20, 255, -1);
4073 Term_putch(44, 20, 0, ' ');
4078 Term_putstr(0, 22, -1, TERM_WHITE,
4079 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
4081 Term_putstr(0, 22, -1, TERM_WHITE,
4082 "Command (n/N/^N/a/A/^A/c/C/^C): ");
4089 if (i == ESCAPE) break;
4091 if (iscntrl(i)) c = 'a' + i - KTRL('A');
4092 else if (isupper(i)) c = 'a' + i - 'A';
4098 cmd_visuals_aux(i, &f, max_f_idx);
4101 t = (int)f_info[f].x_attr;
4102 cmd_visuals_aux(i, &t, 256);
4103 f_info[f].x_attr = (byte)t;
4106 t = (int)f_info[f].x_char;
4107 cmd_visuals_aux(i, &t, 256);
4108 f_info[f].x_char = (byte)t;
4124 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4126 msg_print("Visual attr/char tables reset.");
4131 /* Unknown option */
4137 /* Flush messages */
4142 /* Restore the screen */
4148 * Interact with "colors"
4150 void do_cmd_colors(void)
4161 /* File type is "TEXT" */
4162 FILE_TYPE(FILE_TYPE_TEXT);
4165 /* Save the screen */
4169 /* Interact until done */
4175 /* Ask for a choice */
4177 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4179 prt("Interact with Colors", 2, 0);
4183 /* Give some choices */
4185 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4187 prt("(1) Load a user pref file", 4, 5);
4192 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4193 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4195 prt("(2) Dump colors", 5, 5);
4196 prt("(3) Modify colors", 6, 5);
4203 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4205 prt("Command: ", 8, 0);
4213 if (i == ESCAPE) break;
4215 /* Load a 'pref' file */
4220 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4222 prt("Command: Load a user pref file", 8, 0);
4228 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4230 prt("File: ", 10, 0);
4235 sprintf(tmp, "%s.prf", player_name);
4238 if (!askfor_aux(tmp, 70)) continue;
4240 /* Process the given filename */
4241 (void)process_pref_file(tmp);
4243 /* Mega-Hack -- react to changes */
4244 Term_xtra(TERM_XTRA_REACT, 0);
4246 /* Mega-Hack -- redraw */
4255 static cptr mark = "Colors";
4260 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4262 prt("Command: Dump colors", 8, 0);
4268 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4270 prt("File: ", 10, 0);
4274 /* Default filename */
4275 sprintf(tmp, "%s.prf", player_name);
4277 /* Get a filename */
4278 if (!askfor_aux(tmp, 70)) continue;
4280 /* Build the filename */
4281 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
4283 /* Append to the file */
4284 fff = open_auto_dump(buf, mark, &line_num);
4289 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4291 fprintf(fff, "\n# Color redefinitions\n\n");
4296 for (i = 0; i < 256; i++)
4298 int kv = angband_color_table[i][0];
4299 int rv = angband_color_table[i][1];
4300 int gv = angband_color_table[i][2];
4301 int bv = angband_color_table[i][3];
4306 cptr name = "unknown";
4310 /* Skip non-entries */
4311 if (!kv && !rv && !gv && !bv) continue;
4313 /* Extract the color name */
4314 if (i < 16) name = color_names[i];
4316 /* Dump a comment */
4318 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4320 fprintf(fff, "# Color '%s'\n", name);
4324 /* Dump the monster attr/char info */
4325 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4331 close_auto_dump(fff, mark, line_num);
4335 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4337 msg_print("Dumped color redefinitions.");
4349 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4351 prt("Command: Modify colors", 8, 0);
4355 /* Hack -- query until done */
4364 /* Exhibit the normal colors */
4365 for (j = 0; j < 16; j++)
4367 /* Exhibit this color */
4368 Term_putstr(j*4, 20, -1, a, "###");
4370 /* Exhibit all colors */
4371 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4374 /* Describe the color */
4376 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4378 name = ((a < 16) ? color_names[a] : "undefined");
4382 /* Describe the color */
4384 Term_putstr(5, 10, -1, TERM_WHITE,
4385 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4387 Term_putstr(5, 10, -1, TERM_WHITE,
4388 format("Color = %d, Name = %s", a, name));
4392 /* Label the Current values */
4393 Term_putstr(5, 12, -1, TERM_WHITE,
4394 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4395 angband_color_table[a][0],
4396 angband_color_table[a][1],
4397 angband_color_table[a][2],
4398 angband_color_table[a][3]));
4402 Term_putstr(0, 14, -1, TERM_WHITE,
4403 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4405 Term_putstr(0, 14, -1, TERM_WHITE,
4406 "Command (n/N/k/K/r/R/g/G/b/B): ");
4414 if (i == ESCAPE) break;
4417 if (i == 'n') a = (byte)(a + 1);
4418 if (i == 'N') a = (byte)(a - 1);
4419 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4420 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4421 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4422 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4423 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4424 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4425 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4426 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4428 /* Hack -- react to changes */
4429 Term_xtra(TERM_XTRA_REACT, 0);
4431 /* Hack -- redraw */
4438 /* Unknown option */
4444 /* Flush messages */
4449 /* Restore the screen */
4455 * Note something in the message recall
4457 void do_cmd_note(void)
4466 if (!get_string("¥á¥â: ", buf, 60)) return;
4468 if (!get_string("Note: ", buf, 60)) return;
4472 /* Ignore empty notes */
4473 if (!buf[0] || (buf[0] == ' ')) return;
4475 /* Add the note to the message recall */
4477 msg_format("¥á¥â: %s", buf);
4479 msg_format("Note: %s", buf);
4486 * Mention the current version
4488 void do_cmd_version(void)
4493 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4494 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4496 msg_format("You are playing Hengband %d.%d.%d.",
4497 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4504 * Array of feeling strings
4506 static cptr do_cmd_feeling_text[11] =
4509 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4511 "Looks like any other level.",
4515 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4517 "You feel there is something special about this level.",
4521 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4523 "You nearly faint as horrible visions of death fill your mind!",
4527 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4529 "This level looks very dangerous.",
4533 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4535 "You have a very bad feeling...",
4539 "°¤¤Í½´¶¤¬¤¹¤ë...",
4541 "You have a bad feeling...",
4547 "You feel nervous.",
4551 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4553 "You feel your luck is turning...",
4557 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4559 "You don't like the look of this place.",
4563 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4565 "This level looks reasonably safe.",
4569 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4571 "What a boring place..."
4576 static cptr do_cmd_feeling_text_combat[11] =
4579 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4581 "Looks like any other level.",
4585 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4587 "You feel there is something special about this level.",
4591 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4593 "You nearly faint as horrible visions of death fill your mind!",
4597 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4599 "This level looks very dangerous.",
4603 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4605 "You have a very bad feeling...",
4609 "°¤¤Í½´¶¤¬¤¹¤ë...",
4611 "You have a bad feeling...",
4617 "You feel nervous.",
4621 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4623 "You feel your luck is turning...",
4627 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4629 "You don't like the look of this place.",
4633 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4635 "This level looks reasonably safe.",
4639 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4641 "What a boring place..."
4646 static cptr do_cmd_feeling_text_lucky[11] =
4649 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4650 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4651 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4652 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4653 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4654 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4655 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4656 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4657 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4658 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4659 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4661 "Looks like any other level.",
4662 "You feel there is something special about this level.",
4663 "You have a superb feeling about this level.",
4664 "You have an excellent feeling...",
4665 "You have a very good feeling...",
4666 "You have a good feeling...",
4667 "You feel strangely lucky...",
4668 "You feel your luck is turning...",
4669 "You like the look of this place...",
4670 "This level can't be all bad...",
4671 "What a boring place..."
4677 * Note that "feeling" is set to zero unless some time has passed.
4678 * Note that this is done when the level is GENERATED, not entered.
4680 void do_cmd_feeling(void)
4682 /* Verify the feeling */
4683 if (feeling > 10) feeling = 10;
4685 /* No useful feeling in quests */
4686 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4689 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4691 msg_print("Looks like a typical quest level.");
4697 /* No useful feeling in town */
4698 else if (p_ptr->town_num && !dun_level)
4701 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4703 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4707 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4709 msg_print("Looks like a strange wilderness.");
4717 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4719 msg_print("Looks like a typical town.");
4726 /* No useful feeling in the wilderness */
4727 else if (!dun_level)
4730 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4732 msg_print("Looks like a typical wilderness.");
4738 /* Display the feeling */
4739 if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
4741 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4743 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4744 msg_print(do_cmd_feeling_text_combat[feeling]);
4746 msg_print(do_cmd_feeling_text[feeling]);
4751 msg_print(do_cmd_feeling_text[0]);
4760 * Encode the screen colors
4762 static char hack[17] = "dwsorgbuDWvyRGBU";
4765 static errr photo_fgets(FILE *fff, char *buf, huge n)
4774 if (fgets(tmp, 1024, fff))
4776 /* Convert weirdness */
4777 for (s = tmp; *s; s++)
4779 /* Handle newline */
4790 else if (*s == '\t')
4792 /* Hack -- require room */
4793 if (i + 8 >= n) break;
4795 /* Append a space */
4798 /* Append some more spaces */
4799 while (!(i % 8)) buf[i++] = ' ';
4803 else if (iskanji(*s))
4810 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4811 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4818 /* Handle printables */
4839 * Hack -- load a screen dump from a file
4841 void do_cmd_load_screen(void)
4856 Term_get_size(&wid, &hgt);
4858 /* Hack -- drop permissions */
4861 /* Build the filename */
4862 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
4864 /* Append to the file */
4865 fff = my_fopen(buf, "r");
4870 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4872 msg_format("Failed to open %s.", buf);
4879 /* Save the screen */
4882 /* Clear the screen */
4886 /* Load the screen */
4887 for (y = 0; okay && (y < hgt); y++)
4889 /* Get a line of data */
4890 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4893 for (x = 0; x < wid - 1; x++)
4895 /* Put the attr/char */
4896 Term_draw(x, y, TERM_WHITE, buf[x]);
4900 /* Get the blank line */
4901 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
4904 /* Dump the screen */
4905 for (y = 0; okay && (y < hgt); y++)
4907 /* Get a line of data */
4908 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4911 for (x = 0; x < wid - 1; x++)
4913 /* Get the attr/char */
4914 (void)(Term_what(x, y, &a, &c));
4916 /* Look up the attr */
4917 for (i = 0; i < 16; i++)
4919 /* Use attr matches */
4920 if (hack[i] == buf[x]) a = i;
4923 /* Put the attr/char */
4924 Term_draw(x, y, a, c);
4929 /* Get the blank line */
4930 if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE;
4936 /* Hack -- grab permissions */
4942 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4944 msg_print("Screen dump loaded.");
4951 /* Restore the screen */
4958 cptr inven_res_label =
4960 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4962 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4965 /* XTRA HACK RESLIST */
4966 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4967 int *j, byte tval, char *where)
4969 char o_name[MAX_NLEN];
4970 u32b flgs[TR_FLAG_SIZE];
4972 if (!o_ptr->k_idx)return;
4973 if (o_ptr->tval != tval)return;
4976 * HACK:Ring of Lordly protection and Dragon shield/helm
4977 * have random resistances.
4979 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4980 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4981 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4982 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4983 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4984 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4985 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4988 object_desc(o_name, o_ptr, TRUE, 0);
4990 while ( o_name[i] && i < 26 ){
4992 if (iskanji(o_name[i])) i++;
4996 if(i<28) while(i<28){o_name[i]=' ';i++;}
4999 fprintf(fff,"%s %s", where, o_name);
5001 if (!(o_ptr->ident & (IDENT_MENTAL)))
5004 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
5006 fprintf(fff, "-------unknown------------ -------unknown------\n");
5010 object_flags_known(o_ptr, flgs);
5013 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"¡ö");
5014 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"¡Ü");
5015 else fprintf(fff,"¡¦");
5017 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"¡ö");
5018 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"¡Ü");
5019 else fprintf(fff,"¡¦");
5021 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"¡ö");
5022 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"¡Ü");
5023 else fprintf(fff,"¡¦");
5025 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"¡ö");
5026 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"¡Ü");
5027 else fprintf(fff,"¡¦");
5029 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"¡Ü");
5030 else fprintf(fff,"¡¦");
5032 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"¡Ü");
5033 else fprintf(fff,"¡¦");
5035 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"¡Ü");
5036 else fprintf(fff,"¡¦");
5038 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"¡Ü");
5039 else fprintf(fff,"¡¦");
5041 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"¡Ü");
5042 else fprintf(fff,"¡¦");
5044 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"¡Ü");
5045 else fprintf(fff,"¡¦");
5047 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"¡Ü");
5048 else fprintf(fff,"¡¦");
5050 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"¡Ü");
5051 else fprintf(fff,"¡¦");
5053 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"¡Ü");
5054 else fprintf(fff,"¡¦");
5058 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"¡Ü");
5059 else fprintf(fff,"¡¦");
5061 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"¡Ü");
5062 else fprintf(fff,"¡¦");
5064 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"¡Ü");
5065 else fprintf(fff,"¡¦");
5067 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"¡Ü");
5068 else fprintf(fff,"¡¦");
5070 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"¡Ü");
5071 else fprintf(fff,"¡¦");
5073 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"¡Ü");
5074 else fprintf(fff,"¡¦");
5076 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"¡Ü");
5077 else fprintf(fff,"¡¦");
5079 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"¡Ü");
5080 else fprintf(fff,"¡¦");
5083 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"¡Ü");
5084 else fprintf(fff,"¡¦");
5086 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"¡Ü");
5087 else fprintf(fff,"¡¦");
5089 if (have_flag(flgs, TR_IM_ACID)) fprintf(fff,"* ");
5090 else if (have_flag(flgs, TR_RES_ACID)) fprintf(fff,"+ ");
5091 else fprintf(fff,". ");
5093 if (have_flag(flgs, TR_IM_ELEC)) fprintf(fff,"* ");
5094 else if (have_flag(flgs, TR_RES_ELEC)) fprintf(fff,"+ ");
5095 else fprintf(fff,". ");
5097 if (have_flag(flgs, TR_IM_FIRE)) fprintf(fff,"* ");
5098 else if (have_flag(flgs, TR_RES_FIRE)) fprintf(fff,"+ ");
5099 else fprintf(fff,". ");
5101 if (have_flag(flgs, TR_IM_COLD)) fprintf(fff,"* ");
5102 else if (have_flag(flgs, TR_RES_COLD)) fprintf(fff,"+ ");
5103 else fprintf(fff,". ");
5105 if (have_flag(flgs, TR_RES_POIS)) fprintf(fff,"+ ");
5106 else fprintf(fff,". ");
5108 if (have_flag(flgs, TR_RES_LITE)) fprintf(fff,"+ ");
5109 else fprintf(fff,". ");
5111 if (have_flag(flgs, TR_RES_DARK)) fprintf(fff,"+ ");
5112 else fprintf(fff,". ");
5114 if (have_flag(flgs, TR_RES_SHARDS)) fprintf(fff,"+ ");
5115 else fprintf(fff,". ");
5117 if (have_flag(flgs, TR_RES_SOUND)) fprintf(fff,"+ ");
5118 else fprintf(fff,". ");
5120 if (have_flag(flgs, TR_RES_NETHER)) fprintf(fff,"+ ");
5121 else fprintf(fff,". ");
5123 if (have_flag(flgs, TR_RES_NEXUS)) fprintf(fff,"+ ");
5124 else fprintf(fff,". ");
5126 if (have_flag(flgs, TR_RES_CHAOS)) fprintf(fff,"+ ");
5127 else fprintf(fff,". ");
5129 if (have_flag(flgs, TR_RES_DISEN)) fprintf(fff,"+ ");
5130 else fprintf(fff,". ");
5134 if (have_flag(flgs, TR_RES_BLIND)) fprintf(fff,"+ ");
5135 else fprintf(fff,". ");
5137 if (have_flag(flgs, TR_RES_FEAR)) fprintf(fff,"+ ");
5138 else fprintf(fff,". ");
5140 if (have_flag(flgs, TR_RES_CONF)) fprintf(fff,"+ ");
5141 else fprintf(fff,". ");
5143 if (have_flag(flgs, TR_FREE_ACT)) fprintf(fff,"+ ");
5144 else fprintf(fff,". ");
5146 if (have_flag(flgs, TR_SEE_INVIS)) fprintf(fff,"+ ");
5147 else fprintf(fff,". ");
5149 if (have_flag(flgs, TR_HOLD_LIFE)) fprintf(fff,"+ ");
5150 else fprintf(fff,". ");
5152 if (have_flag(flgs, TR_TELEPATHY)) fprintf(fff,"+ ");
5153 else fprintf(fff,". ");
5155 if (have_flag(flgs, TR_SLOW_DIGEST)) fprintf(fff,"+ ");
5156 else fprintf(fff,". ");
5159 if (have_flag(flgs, TR_REGEN)) fprintf(fff,"+ ");
5160 else fprintf(fff,". ");
5162 if (have_flag(flgs, TR_FEATHER)) fprintf(fff,"+ ");
5163 else fprintf(fff,". ");
5171 fprintf(fff,"%s\n", inven_res_label);
5177 * Display *ID* ed weapons/armors's resistances
5179 static void do_cmd_knowledge_inven(void)
5184 char file_name[1024];
5195 /* Open a new file */
5196 fff = my_fopen_temp(file_name, 1024);
5199 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5201 msg_format("Failed to create temporally file %s.", file_name);
5206 fprintf(fff,"%s\n",inven_res_label);
5208 for (tval=TV_BOW; tval <= TV_RING; tval++){
5211 for (;j<9;j++) fprintf(fff, "\n");
5213 fprintf(fff,"%s\n",inven_res_label);
5217 strcpy(where, "Áõ");
5219 strcpy(where, "E ");
5221 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5223 o_ptr = &inventory[i];
5224 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5228 strcpy(where, "»ý");
5230 strcpy(where, "I ");
5232 for (i = 0; i < INVEN_PACK; i++)
5234 o_ptr = &inventory[i];
5235 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5239 /* Print all homes in the different towns */
5240 st_ptr = &town[1].store[STORE_HOME];
5242 strcpy(where, "²È");
5244 strcpy(where, "H ");
5247 /* Dump all available items */
5248 for (i = 0; i < st_ptr->stock_num; i++)
5250 o_ptr = &st_ptr->stock[i];
5251 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5255 /* Close the file */
5258 /* Display the file contents */
5260 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5262 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5265 /* Remove the file */
5270 void do_cmd_save_screen_html_aux(char *filename, int message)
5274 byte a = 0, old_a = 0;
5288 cptr html_head[] = {
5289 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5293 cptr html_foot[] = {
5295 "</body>\n</html>\n",
5301 Term_get_size(&wid, &hgt);
5303 /* File type is "TEXT" */
5304 FILE_TYPE(FILE_TYPE_TEXT);
5306 /* Append to the file */
5307 fff = my_fopen(filename, "w");
5313 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5315 msg_format("Failed to open file %s.", filename);
5323 /* Save the screen */
5327 /* Build the filename */
5328 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
5329 tmpfff = my_fopen(buf, "r");
5331 for (i = 0; html_head[i]; i++)
5332 fprintf(fff, html_head[i]);
5336 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5338 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5342 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5344 fprintf(fff, "%s\n", buf);
5349 /* Dump the screen */
5350 for (y = 0; y < hgt; y++)
5357 for (x = 0; x < wid - 1; x++)
5361 /* Get the attr/char */
5362 (void)(Term_what(x, y, &a, &c));
5366 case '&': cc = "&"; break;
5367 case '<': cc = "<"; break;
5368 case '>': cc = ">"; break;
5370 case 0x1f: c = '.'; break;
5371 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5376 if ((y == 0 && x == 0) || a != old_a) {
5377 rv = angband_color_table[a][1];
5378 gv = angband_color_table[a][2];
5379 bv = angband_color_table[a][3];
5380 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5381 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5385 fprintf(fff, "%s", cc);
5387 fprintf(fff, "%c", c);
5390 fprintf(fff, "</font>");
5393 for (i = 0; html_foot[i]; i++)
5394 fprintf(fff, html_foot[i]);
5399 while (!my_fgets(tmpfff, buf, sizeof(buf))) {
5401 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5405 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5407 fprintf(fff, "%s\n", buf);
5422 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5424 msg_print("Screen dump saved.");
5429 /* Restore the screen */
5435 * Hack -- save a screen dump to a file
5437 static void do_cmd_save_screen_html(void)
5439 char buf[1024], tmp[256] = "screen.html";
5442 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5444 if (!get_string("File name: ", tmp, 80))
5448 /* Build the filename */
5449 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
5453 /* Hack -- drop permissions */
5456 do_cmd_save_screen_html_aux(buf, 1);
5458 /* Hack -- grab permissions */
5464 * Redefinable "save_screen" action
5466 void (*screendump_aux)(void) = NULL;
5470 * Hack -- save a screen dump to a file
5472 void do_cmd_save_screen(void)
5474 bool old_use_graphics = use_graphics;
5475 bool html_dump = FALSE;
5480 prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0);
5482 prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0);
5487 if (c == 'Y' || c == 'y')
5489 else if (c == 'H' || c == 'h')
5501 Term_get_size(&wid, &hgt);
5503 if (old_use_graphics)
5505 use_graphics = FALSE;
5508 /* Redraw everything */
5509 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5511 /* Hack -- update */
5517 do_cmd_save_screen_html();
5521 /* Do we use a special screendump function ? */
5522 else if (screendump_aux)
5524 /* Dump the screen to a graphics file */
5525 (*screendump_aux)();
5527 else /* Dump the screen as text */
5539 /* Hack -- drop permissions */
5542 /* Build the filename */
5543 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
5545 /* File type is "TEXT" */
5546 FILE_TYPE(FILE_TYPE_TEXT);
5548 /* Append to the file */
5549 fff = my_fopen(buf, "w");
5554 /* Hack -- grab permissions */
5557 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5559 msg_format("Failed to open file %s.", buf);
5566 /* Save the screen */
5570 /* Dump the screen */
5571 for (y = 0; y < hgt; y++)
5574 for (x = 0; x < wid - 1; x++)
5576 /* Get the attr/char */
5577 (void)(Term_what(x, y, &a, &c));
5587 fprintf(fff, "%s\n", buf);
5594 /* Dump the screen */
5595 for (y = 0; y < hgt; y++)
5598 for (x = 0; x < wid - 1; x++)
5600 /* Get the attr/char */
5601 (void)(Term_what(x, y, &a, &c));
5604 buf[x] = hack[a&0x0F];
5611 fprintf(fff, "%s\n", buf);
5621 /* Hack -- grab permissions */
5626 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5628 msg_print("Screen dump saved.");
5634 /* Restore the screen */
5638 if (old_use_graphics)
5640 use_graphics = TRUE;
5643 /* Redraw everything */
5644 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5646 /* Hack -- update */
5653 * Sorting hook -- Comp function -- see below
5655 * We use "u" to point to array of monster indexes,
5656 * and "v" to select the type of sorting to perform on "u".
5658 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5660 u16b *who = (u16b*)(u);
5662 u16b *why = (u16b*)(v);
5670 /* Sort by total kills */
5673 /* Extract total kills */
5674 z1 = a_info[w1].tval;
5675 z2 = a_info[w2].tval;
5677 /* Compare total kills */
5678 if (z1 < z2) return (TRUE);
5679 if (z1 > z2) return (FALSE);
5683 /* Sort by monster level */
5686 /* Extract levels */
5687 z1 = a_info[w1].sval;
5688 z2 = a_info[w2].sval;
5690 /* Compare levels */
5691 if (z1 < z2) return (TRUE);
5692 if (z1 > z2) return (FALSE);
5696 /* Sort by monster experience */
5699 /* Extract experience */
5700 z1 = a_info[w1].level;
5701 z2 = a_info[w2].level;
5703 /* Compare experience */
5704 if (z1 < z2) return (TRUE);
5705 if (z1 > z2) return (FALSE);
5709 /* Compare indexes */
5715 * Sorting hook -- Swap function -- see below
5717 * We use "u" to point to array of monster indexes,
5718 * and "v" to select the type of sorting to perform.
5720 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5722 u16b *who = (u16b*)(u);
5734 * Check the status of "artifacts"
5736 static void do_cmd_knowledge_artifacts(void)
5738 int i, k, z, x, y, n = 0;
5744 char file_name[1024];
5746 char base_name[MAX_NLEN];
5750 /* Open a new file */
5751 fff = my_fopen_temp(file_name, 1024);
5755 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5757 msg_format("Failed to create temporary file %s.", file_name);
5763 /* Allocate the "who" array */
5764 C_MAKE(who, max_a_idx, s16b);
5766 /* Allocate the "okay" array */
5767 C_MAKE(okay, max_a_idx, bool);
5769 /* Scan the artifacts */
5770 for (k = 0; k < max_a_idx; k++)
5772 artifact_type *a_ptr = &a_info[k];
5777 /* Skip "empty" artifacts */
5778 if (!a_ptr->name) continue;
5780 /* Skip "uncreated" artifacts */
5781 if (!a_ptr->cur_num) continue;
5787 /* Check the dungeon */
5788 for (y = 0; y < cur_hgt; y++)
5790 for (x = 0; x < cur_wid; x++)
5792 cave_type *c_ptr = &cave[y][x];
5794 s16b this_o_idx, next_o_idx = 0;
5796 /* Scan all objects in the grid */
5797 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5801 /* Acquire object */
5802 o_ptr = &o_list[this_o_idx];
5804 /* Acquire next object */
5805 next_o_idx = o_ptr->next_o_idx;
5807 /* Ignore non-artifacts */
5808 if (!artifact_p(o_ptr)) continue;
5810 /* Ignore known items */
5811 if (object_known_p(o_ptr)) continue;
5813 /* Note the artifact */
5814 okay[o_ptr->name1] = FALSE;
5819 /* Check the inventory and equipment */
5820 for (i = 0; i < INVEN_TOTAL; i++)
5822 object_type *o_ptr = &inventory[i];
5824 /* Ignore non-objects */
5825 if (!o_ptr->k_idx) continue;
5827 /* Ignore non-artifacts */
5828 if (!artifact_p(o_ptr)) continue;
5830 /* Ignore known items */
5831 if (object_known_p(o_ptr)) continue;
5833 /* Note the artifact */
5834 okay[o_ptr->name1] = FALSE;
5837 for (k = 0; k < max_a_idx; k++)
5839 if (okay[k]) who[n++] = k;
5842 /* Select the sort method */
5843 ang_sort_comp = ang_sort_art_comp;
5844 ang_sort_swap = ang_sort_art_swap;
5846 /* Sort the array by dungeon depth of monsters */
5847 ang_sort(who, &why, n);
5849 /* Scan the artifacts */
5850 for (k = 0; k < n; k++)
5852 artifact_type *a_ptr = &a_info[who[k]];
5856 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5858 strcpy(base_name, "Unknown Artifact");
5862 /* Obtain the base object type */
5863 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5871 /* Get local object */
5874 /* Create fake object */
5875 object_prep(q_ptr, z);
5877 /* Make it an artifact */
5878 q_ptr->name1 = (byte)who[k];
5880 /* Describe the artifact */
5881 object_desc_store(base_name, q_ptr, FALSE, 0);
5884 /* Hack -- Build the artifact name */
5886 fprintf(fff, " %s\n", base_name);
5888 fprintf(fff, " The %s\n", base_name);
5893 /* Free the "who" array */
5894 C_KILL(who, max_a_idx, s16b);
5896 /* Free the "okay" array */
5897 C_KILL(okay, max_a_idx, bool);
5899 /* Close the file */
5902 /* Display the file contents */
5904 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5906 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5910 /* Remove the file */
5916 * Display known uniques
5918 static void do_cmd_knowledge_uniques(void)
5926 char file_name[1024];
5928 /* Open a new file */
5929 fff = my_fopen_temp(file_name, 1024);
5933 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5935 msg_format("Failed to create temporary file %s.", file_name);
5941 /* Allocate the "who" array */
5942 C_MAKE(who, max_r_idx, s16b);
5944 /* Scan the monsters */
5945 for (i = 1; i < max_r_idx; i++)
5947 monster_race *r_ptr = &r_info[i];
5949 /* Use that monster */
5950 if (r_ptr->name) who[n++] = i;
5953 /* Select the sort method */
5954 ang_sort_comp = ang_sort_comp_hook;
5955 ang_sort_swap = ang_sort_swap_hook;
5957 /* Sort the array by dungeon depth of monsters */
5958 ang_sort(who, &why, n);
5960 /* Scan the monster races */
5961 for (k = 0; k < n; k++)
5963 monster_race *r_ptr = &r_info[who[k]];
5965 /* Only print Uniques */
5966 if (r_ptr->flags1 & (RF1_UNIQUE))
5968 bool dead = (r_ptr->max_num == 0);
5972 /* Only display "known" uniques */
5973 if (dead || cheat_know || r_ptr->r_sights)
5975 /* Print a message */
5977 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5978 (r_name + r_ptr->name));
5980 fprintf(fff, " %s is alive\n",
5981 (r_name + r_ptr->name));
5988 /* Free the "who" array */
5989 C_KILL(who, max_r_idx, s16b);
5991 /* Close the file */
5994 /* Display the file contents */
5996 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5998 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
6002 /* Remove the file */
6008 * Display dead uniques
6010 static void do_cmd_knowledge_uniques_dead(void)
6018 char file_name[1024];
6020 /* Open a new file */
6021 fff = my_fopen_temp(file_name, 1024);
6025 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6027 msg_format("Failed to create temporary file %s.", file_name);
6033 /* Allocate the "who" array */
6034 C_MAKE(who, max_r_idx, s16b);
6036 /* Scan the monsters */
6037 for (i = 1; i < max_r_idx; i++)
6039 monster_race *r_ptr = &r_info[i];
6041 /* Use that monster */
6042 if (r_ptr->name) who[n++] = i;
6045 /* Select the sort method */
6046 ang_sort_comp = ang_sort_comp_hook;
6047 ang_sort_swap = ang_sort_swap_hook;
6049 /* Sort the array by dungeon depth of monsters */
6050 ang_sort(who, &why, n);
6052 /* Scan the monster races */
6053 for (k = 0; k < n; k++)
6055 monster_race *r_ptr = &r_info[who[k]];
6057 /* Only print Uniques */
6058 if (r_ptr->flags1 & (RF1_UNIQUE))
6060 bool dead = (r_ptr->max_num == 0);
6062 if (!dead) continue;
6064 /* Only display "known" uniques */
6065 if (dead || cheat_know || r_ptr->r_sights)
6067 /* Print a message */
6069 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
6070 (r_name + r_ptr->name));
6072 fprintf(fff, " %s is dead\n",
6073 (r_name + r_ptr->name));
6080 /* Free the "who" array */
6081 C_KILL(who, max_r_idx, s16b);
6083 /* Close the file */
6086 /* Display the file contents */
6088 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
6090 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
6094 /* Remove the file */
6100 * Display weapon-exp
6102 static void do_cmd_knowledge_weapon_exp(void)
6104 int i,j, num, shougou;
6108 char file_name[1024];
6111 /* Open a new file */
6112 fff = my_fopen_temp(file_name, 1024);
6115 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6117 msg_format("Failed to create temporary file %s.", file_name);
6123 for(i = 0; i < 5; i++)
6125 for (num = 0; num < 64; num++)
6127 for (j = 0; j < max_k_idx; j++)
6129 object_kind *k_ptr = &k_info[j];
6131 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
6133 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
6135 if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
6136 else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
6137 else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
6138 else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
6141 fprintf(fff,"%-25s ",tmp);
6142 if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6143 else fprintf(fff," ");
6144 fprintf(fff,"%s",shougou_moji[shougou]);
6145 if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
6153 /* Close the file */
6156 /* Display the file contents */
6158 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6160 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6164 /* Remove the file */
6172 static void do_cmd_knowledge_spell_exp(void)
6179 char file_name[1024];
6181 /* Open a new file */
6182 fff = my_fopen_temp(file_name, 1024);
6185 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6187 msg_format("Failed to create temporary file %s.", file_name);
6193 if(p_ptr->realm1 != REALM_NONE)
6196 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6198 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6200 for (i = 0; i < 32; i++)
6202 if (!is_magic(p_ptr->realm1))
6204 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC][i];
6208 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6210 if(s_ptr->slevel == 99) continue;
6211 if(p_ptr->spell_exp[i]<900) shougou=0;
6212 else if(p_ptr->spell_exp[i]<1200) shougou=1;
6213 else if(p_ptr->spell_exp[i]<1400) shougou=2;
6214 else if(p_ptr->spell_exp[i]<1600) shougou=3;
6216 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6217 if (p_ptr->realm1 == REALM_HISSATSU)
6218 fprintf(fff,"[--]");
6221 if (shougou == 4) fprintf(fff,"!");
6222 else fprintf(fff," ");
6223 fprintf(fff,"%s",shougou_moji[shougou]);
6225 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
6230 if(p_ptr->realm2 != REALM_NONE)
6232 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6233 for (i = 0; i < 32; i++)
6235 if (!is_magic(p_ptr->realm1))
6237 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC][i];
6241 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6243 if(s_ptr->slevel == 99) continue;
6245 if(p_ptr->spell_exp[i+32]<900) shougou=0;
6246 else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
6247 else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
6249 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6250 if (shougou == 3) fprintf(fff,"!");
6251 else fprintf(fff," ");
6252 fprintf(fff,"%s",shougou_moji[shougou]);
6253 if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
6258 /* Close the file */
6261 /* Display the file contents */
6263 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6265 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6269 /* Remove the file */
6277 static void do_cmd_knowledge_skill_exp(void)
6283 char file_name[1024];
6285 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6287 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6290 /* Open a new file */
6291 fff = my_fopen_temp(file_name, 1024);
6294 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6296 msg_format("Failed to create temporary file %s.", file_name);
6302 for (i = 0; i < 3; i++)
6304 if(i == GINOU_RIDING)
6306 if(p_ptr->skill_exp[i]<500) shougou=0;
6307 else if(p_ptr->skill_exp[i]<2000) shougou=1;
6308 else if(p_ptr->skill_exp[i]<5000) shougou=2;
6309 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6314 if(p_ptr->skill_exp[i]<4000) shougou=0;
6315 else if(p_ptr->skill_exp[i]<6000) shougou=1;
6316 else if(p_ptr->skill_exp[i]<7000) shougou=2;
6317 else if(p_ptr->skill_exp[i]<8000) shougou=3;
6320 fprintf(fff,"%-20s ",skill_name[i]);
6321 if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6322 else fprintf(fff," ");
6323 fprintf(fff,"%s",shougou_moji[shougou]);
6324 if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
6328 /* Close the file */
6331 /* Display the file contents */
6333 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6335 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6339 /* Remove the file */
6345 * Pluralize a monster name
6347 void plural_aux(char *Name)
6349 int NameLen = strlen(Name);
6351 if (strstr(Name, "Disembodied hand"))
6353 strcpy(Name, "Disembodied hands that strangled people");
6355 else if (strstr(Name, "Colour out of space"))
6357 strcpy(Name, "Colours out of space");
6359 else if (strstr(Name, "stairway to hell"))
6361 strcpy(Name, "stairways to hell");
6363 else if (strstr(Name, "Dweller on the threshold"))
6365 strcpy(Name, "Dwellers on the threshold");
6367 else if (strstr(Name, " of "))
6369 cptr aider = strstr(Name, " of ");
6380 if (dummy[i-1] == 's')
6382 strcpy(&(dummy[i]), "es");
6387 strcpy(&(dummy[i]), "s");
6390 strcpy(&(dummy[i+1]), aider);
6391 strcpy(Name, dummy);
6393 else if (strstr(Name, "coins"))
6396 strcpy(dummy, "piles of ");
6397 strcat(dummy, Name);
6398 strcpy(Name, dummy);
6401 else if (strstr(Name, "Manes"))
6405 else if (streq(&(Name[NameLen - 2]), "ey"))
6407 strcpy(&(Name[NameLen - 2]), "eys");
6409 else if (Name[NameLen - 1] == 'y')
6411 strcpy(&(Name[NameLen - 1]), "ies");
6413 else if (streq(&(Name[NameLen - 4]), "ouse"))
6415 strcpy(&(Name[NameLen - 4]), "ice");
6417 else if (streq(&(Name[NameLen - 2]), "us"))
6419 strcpy(&(Name[NameLen - 2]), "i");
6421 else if (streq(&(Name[NameLen - 6]), "kelman"))
6423 strcpy(&(Name[NameLen - 6]), "kelmen");
6425 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6427 strcpy(&(Name[NameLen - 8]), "wordsmen");
6429 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6431 strcpy(&(Name[NameLen - 7]), "oodsmen");
6433 else if (streq(&(Name[NameLen - 7]), "eastman"))
6435 strcpy(&(Name[NameLen - 7]), "eastmen");
6437 else if (streq(&(Name[NameLen - 8]), "izardman"))
6439 strcpy(&(Name[NameLen - 8]), "izardmen");
6441 else if (streq(&(Name[NameLen - 5]), "geist"))
6443 strcpy(&(Name[NameLen - 5]), "geister");
6445 else if (streq(&(Name[NameLen - 2]), "ex"))
6447 strcpy(&(Name[NameLen - 2]), "ices");
6449 else if (streq(&(Name[NameLen - 2]), "lf"))
6451 strcpy(&(Name[NameLen - 2]), "lves");
6453 else if (suffix(Name, "ch") ||
6454 suffix(Name, "sh") ||
6455 suffix(Name, "nx") ||
6456 suffix(Name, "s") ||
6459 strcpy(&(Name[NameLen]), "es");
6463 strcpy(&(Name[NameLen]), "s");
6468 * Display current pets
6470 static void do_cmd_knowledge_pets(void)
6474 monster_type *m_ptr;
6476 int show_upkeep = 0;
6477 char file_name[1024];
6480 /* Open a new file */
6481 fff = my_fopen_temp(file_name, 1024);
6484 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6486 msg_format("Failed to create temporary file %s.", file_name);
6492 /* Process the monsters (backwards) */
6493 for (i = m_max - 1; i >= 1; i--)
6495 monster_race *r_ptr;
6496 /* Access the monster */
6499 /* Ignore "dead" monsters */
6500 if (!m_ptr->r_idx) continue;
6501 r_ptr = &r_info[m_ptr->r_idx];
6503 /* Calculate "upkeep" for pets */
6508 monster_desc(pet_name, m_ptr, 0x88);
6509 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6510 if (p_ptr->riding == i)
6512 fprintf(fff, " ¾èÇÏÃæ");
6514 fprintf(fff, " Riding");
6520 show_upkeep = calculate_upkeep();
6522 fprintf(fff, "----------------------------------------------\n");
6524 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6525 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6527 fprintf(fff, " Total: %d pet%s.\n",
6528 t_friends, (t_friends == 1 ? "" : "s"));
6529 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6534 /* Close the file */
6537 /* Display the file contents */
6539 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6541 show_file(TRUE, file_name, "Current Pets", 0, 0);
6545 /* Remove the file */
6553 * Note that the player ghosts are ignored. XXX XXX XXX
6555 static void do_cmd_knowledge_kill_count(void)
6563 char file_name[1024];
6568 /* Open a new file */
6569 fff = my_fopen_temp(file_name, 1024);
6573 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6575 msg_format("Failed to create temporary file %s.", file_name);
6581 /* Allocate the "who" array */
6582 C_MAKE(who, max_r_idx, s16b);
6585 /* Monsters slain */
6588 for (kk = 1; kk < max_r_idx; kk++)
6590 monster_race *r_ptr = &r_info[kk];
6592 if (r_ptr->flags1 & (RF1_UNIQUE))
6594 bool dead = (r_ptr->max_num == 0);
6603 s16b This = r_ptr->r_pkills;
6614 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6616 fprintf(fff,"You have defeated no enemies yet.\n\n");
6619 else if (Total == 1)
6621 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6623 fprintf(fff,"You have defeated one enemy.\n\n");
6628 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6630 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6637 /* Scan the monsters */
6638 for (i = 1; i < max_r_idx; i++)
6640 monster_race *r_ptr = &r_info[i];
6642 /* Use that monster */
6643 if (r_ptr->name) who[n++] = i;
6646 /* Select the sort method */
6647 ang_sort_comp = ang_sort_comp_hook;
6648 ang_sort_swap = ang_sort_swap_hook;
6650 /* Sort the array by dungeon depth of monsters */
6651 ang_sort(who, &why, n);
6653 /* Scan the monster races */
6654 for (k = 0; k < n; k++)
6656 monster_race *r_ptr = &r_info[who[k]];
6658 if (r_ptr->flags1 & (RF1_UNIQUE))
6660 bool dead = (r_ptr->max_num == 0);
6664 /* Print a message */
6665 fprintf(fff, " %s\n",
6666 (r_name + r_ptr->name));
6672 s16b This = r_ptr->r_pkills;
6677 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6678 if(strchr("pt",r_ptr->d_char))
6679 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6681 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6685 if (strstr(r_name + r_ptr->name, "coins"))
6687 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6691 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6697 strcpy(ToPlural, (r_name + r_ptr->name));
6698 plural_aux(ToPlural);
6699 fprintf(fff, " %d %s\n", This, ToPlural);
6709 fprintf(fff,"----------------------------------------------\n");
6711 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6713 fprintf(fff," Total: %lu creature%s killed.\n",
6714 Total, (Total == 1 ? "" : "s"));
6718 /* Free the "who" array */
6719 C_KILL(who, max_r_idx, s16b);
6721 /* Close the file */
6724 /* Display the file contents */
6726 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6728 show_file(TRUE, file_name, "Kill Count", 0, 0);
6732 /* Remove the file */
6738 * Display known objects
6740 static void do_cmd_knowledge_objects(void)
6746 char o_name[MAX_NLEN];
6748 char file_name[1024];
6751 /* Open a new file */
6752 fff = my_fopen_temp(file_name, 1024);
6755 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6757 msg_format("Failed to create temporary file %s.", file_name);
6763 /* Scan the object kinds */
6764 for (k = 1; k < max_k_idx; k++)
6766 object_kind *k_ptr = &k_info[k];
6768 /* Hack -- skip artifacts */
6769 if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
6771 /* List known flavored objects */
6772 if (k_ptr->flavor && k_ptr->aware)
6775 object_type object_type_body;
6777 /* Get local object */
6778 i_ptr = &object_type_body;
6780 /* Create fake object */
6781 object_prep(i_ptr, k);
6783 /* Describe the object */
6784 object_desc_store(o_name, i_ptr, FALSE, 0);
6786 /* Print a message */
6787 fprintf(fff, " %s\n", o_name);
6791 /* Close the file */
6794 /* Display the file contents */
6796 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6798 show_file(TRUE, file_name, "Known Objects", 0, 0);
6802 /* Remove the file */
6808 * List virtues & status
6811 static void do_cmd_knowledge_kubi(void)
6816 char file_name[1024];
6819 /* Open a new file */
6820 fff = my_fopen_temp(file_name, 1024);
6823 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6825 msg_format("Failed to create temporary file %s.", file_name);
6834 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6836 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6838 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6840 fprintf(fff, "List of wanted monsters\n");
6842 for (i = 0; i < MAX_KUBI; i++)
6844 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6845 if (kubi_r_idx[i] > 10000)
6847 fprintf(fff, "ºÑ\n");
6849 fprintf(fff, "done\n");
6852 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6856 /* Close the file */
6859 /* Display the file contents */
6861 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6863 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6867 /* Remove the file */
6872 * List virtues & status
6875 static void do_cmd_knowledge_virtues(void)
6879 char file_name[1024];
6882 /* Open a new file */
6883 fff = my_fopen_temp(file_name, 1024);
6886 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6888 msg_format("Failed to create temporary file %s.", file_name);
6897 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6899 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6904 /* Close the file */
6907 /* Display the file contents */
6909 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6911 show_file(TRUE, file_name, "Virtues", 0, 0);
6915 /* Remove the file */
6923 static void do_cmd_knowledge_dungeon(void)
6927 char file_name[1024];
6931 /* Open a new file */
6932 fff = my_fopen_temp(file_name, 1024);
6935 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6937 msg_format("Failed to create temporary file %s.", file_name);
6945 for (i = 1; i < max_d_idx; i++)
6949 if (!d_info[i].maxdepth) continue;
6950 if (!max_dlv[i]) continue;
6951 if (d_info[i].final_guardian)
6953 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6955 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6957 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6959 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6964 /* Close the file */
6967 /* Display the file contents */
6969 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6971 show_file(TRUE, file_name, "Dungeon", 0, 0);
6975 /* Remove the file */
6980 * List virtues & status
6983 static void do_cmd_knowledge_stat(void)
6987 char file_name[1024];
6990 /* Open a new file */
6991 fff = my_fopen_temp(file_name, 1024);
6994 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6996 msg_format("Failed to create temporary file %s.", file_name);
7004 percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
7005 (2 * p_ptr->hitdie +
7006 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
7009 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
7010 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
7011 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
7013 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
7014 else fprintf(fff, "Your current Life Rating is ???.\n\n");
7015 fprintf(fff, "Limits of maximum stats\n\n");
7017 for (v_nr = 0; v_nr < 6; v_nr++)
7019 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);
7020 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
7026 /* Close the file */
7029 /* Display the file contents */
7031 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
7033 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
7037 /* Remove the file */
7042 * Print quest status of all active quests
7044 static void do_cmd_knowledge_quests(void)
7047 char file_name[1024];
7049 char rand_tmp_str[120] = "\0";
7051 monster_race *r_ptr;
7053 int rand_level = 100;
7056 /* Open a new file */
7057 fff = my_fopen_temp(file_name, 1024);
7060 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7062 msg_format("Failed to create temporary file %s.", file_name);
7069 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
7071 fprintf(fff, "< Current Quest >\n");
7074 for (i = 1; i < max_quests; i++)
7076 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
7081 /* Clear the text */
7082 for (j = 0; j < 10; j++)
7084 quest_text[j][0] = '\0';
7087 quest_text_line = 0;
7089 /* Set the quest number temporary */
7090 old_quest = p_ptr->inside_quest;
7091 p_ptr->inside_quest = i;
7093 /* Get the quest text */
7094 init_flags = INIT_SHOW_TEXT;
7096 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7098 /* Reset the old quest number */
7099 p_ptr->inside_quest = old_quest;
7101 /* No info from "silent" quests */
7102 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7106 if (quest[i].type != QUEST_TYPE_RANDOM)
7108 char note[80] = "\0";
7110 if (quest[i].status == QUEST_STATUS_TAKEN)
7112 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
7114 r_ptr = &r_info[quest[i].r_idx];
7115 strcpy(name, r_name + r_ptr->name);
7116 if (quest[i].max_num > 1)
7119 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7122 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
7127 sprintf(note," - %s¤òÅݤ¹¡£",name);
7129 sprintf(note," - kill %s.",name);
7132 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
7135 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
7137 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
7140 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
7142 strcpy(name, a_name + a_info[quest[i].k_idx].name);
7144 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
7146 sprintf(note," - Find out %s.", name);
7149 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
7151 sprintf(note," - õº÷¤¹¤ë¡£");
7153 sprintf(note," - Search.");
7155 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
7157 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
7159 sprintf(note," - Kill all monsters.");
7163 /* Print the quest info */
7165 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
7167 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
7170 quest[i].name, quest[i].level, note);
7172 fprintf(fff, tmp_str);
7174 if (quest[i].status == QUEST_STATUS_COMPLETED)
7177 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
7179 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
7183 fprintf(fff, tmp_str);
7189 while (quest_text[j][0] && j < 10)
7191 fprintf(fff, " %s\n", quest_text[j]);
7196 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
7197 (quest[i].level < rand_level))
7200 rand_level = quest[i].level;
7202 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
7204 /* Print the quest info */
7205 r_ptr = &r_info[quest[i].r_idx];
7206 strcpy(name, r_name + r_ptr->name);
7208 if (quest[i].max_num > 1)
7211 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
7212 quest[i].name, quest[i].level,
7213 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7217 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
7218 quest[i].name, quest[i].level,
7219 quest[i].max_num, name, quest[i].cur_num);
7226 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
7228 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
7231 quest[i].name, quest[i].level, name);
7238 /* Print the current random quest */
7239 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
7242 if (!total) fprintf(fff, "¤Ê¤·\n");
7244 if (!total) fprintf(fff, "Nothing.\n");
7248 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7250 fprintf(fff, "\n< Completed Quest >\n");
7253 for (i = 1; i < max_quests; i++)
7255 if (quest[i].status == QUEST_STATUS_FINISHED)
7257 if (i < MIN_RANDOM_QUEST)
7261 /* Set the quest number temporary */
7262 old_quest = p_ptr->inside_quest;
7263 p_ptr->inside_quest = i;
7266 init_flags = INIT_ASSIGN;
7268 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7270 /* Reset the old quest number */
7271 p_ptr->inside_quest = old_quest;
7273 /* No info from "silent" quests */
7274 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7279 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7281 /* Print the quest info */
7283 if (quest[i].complev == 0)
7287 "%s (%d³¬) - ÉÔÀᄀ\n",
7289 "%s (Dungeon level: %d) - (Cancelled)\n",
7291 r_name+r_info[quest[i].r_idx].name,
7298 "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7300 "%s (Dungeon level: %d) - level %d\n",
7302 r_name+r_info[quest[i].r_idx].name,
7309 /* Print the quest info */
7311 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7313 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7316 quest[i].name, quest[i].level, quest[i].complev);
7319 fprintf(fff, tmp_str);
7323 if (!total) fprintf(fff, "¤Ê¤·\n");
7325 if (!total) fprintf(fff, "Nothing.\n");
7329 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7331 fprintf(fff, "\n< Failed Quest >\n");
7334 for (i = 1; i < max_quests; i++)
7336 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7338 if (i < MIN_RANDOM_QUEST)
7342 /* Set the quest number temporary */
7343 old_quest = p_ptr->inside_quest;
7344 p_ptr->inside_quest = i;
7346 /* Get the quest text */
7347 init_flags = INIT_ASSIGN;
7349 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7351 /* Reset the old quest number */
7352 p_ptr->inside_quest = old_quest;
7354 /* No info from "silent" quests */
7355 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7360 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7362 /* Print the quest info */
7364 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7366 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7369 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7373 /* Print the quest info */
7375 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7377 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7380 quest[i].name, quest[i].level, quest[i].complev);
7382 fprintf(fff, tmp_str);
7386 if (!total) fprintf(fff, "¤Ê¤·\n");
7388 if (!total) fprintf(fff, "Nothing.\n");
7391 if (p_ptr->wizard) {
7393 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7395 fprintf(fff, "\n< Remaining Random Quest >\n");
7398 for (i = 1; i < max_quests; i++)
7400 /* No info from "silent" quests */
7401 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7403 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7407 /* Print the quest info */
7409 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7411 sprintf(tmp_str, "%s (%d, %s)\n",
7414 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7415 fprintf(fff, tmp_str);
7419 if (!total) fprintf(fff, "¤Ê¤·\n");
7421 if (!total) fprintf(fff, "Nothing.\n");
7425 /* Close the file */
7428 /* Display the file contents */
7430 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7432 show_file(TRUE, file_name, "Quest status", 0, 0);
7436 /* Remove the file */
7446 static void do_cmd_knowledge_home(void)
7451 char file_name[1024];
7453 char o_name[MAX_NLEN];
7456 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7458 /* Open a new file */
7459 fff = my_fopen_temp(file_name, 1024);
7462 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7464 msg_format("Failed to create temporary file %s.", file_name);
7472 /* Print all homes in the different towns */
7473 st_ptr = &town[1].store[STORE_HOME];
7475 /* Home -- if anything there */
7476 if (st_ptr->stock_num)
7478 /* Header with name of the town */
7480 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7482 fprintf(fff, " [Home Inventory]\n");
7486 /* Dump all available items */
7487 for (i = 0; i < st_ptr->stock_num; i++)
7490 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7491 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7492 if (strlen(o_name) <= 80-3)
7494 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7500 for (n = 0, t = o_name; n < 80-3; n++, t++)
7501 if(iskanji(*t)) {t++; n++;}
7502 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7504 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7505 fprintf(fff, " %.77s\n", o_name+n);
7508 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7509 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7514 /* Add an empty line */
7515 fprintf(fff, "\n\n");
7519 /* Close the file */
7522 /* Display the file contents */
7524 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7526 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7530 /* Remove the file */
7536 * Check the status of "autopick"
7538 static void do_cmd_knowledge_autopick(void)
7542 char file_name[1024];
7544 /* Open a new file */
7545 fff = my_fopen_temp(file_name, 1024);
7550 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7552 msg_format("Failed to create temporary file %s.", file_name);
7561 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7563 fprintf(fff, "No preference for auto picker/destroyer.");
7569 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7571 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7575 for (k = 0; k < max_autopick; k++)
7578 byte act = autopick_list[k].action;
7579 if (act & DONT_AUTOPICK)
7587 else if (act & DO_AUTODESTROY)
7595 else if (act & DO_AUTOPICK)
7603 else if (act & DO_QUERY_AUTOPICK)
7612 if (act & DO_DISPLAY)
7613 fprintf(fff, "%11s", format("[%s]", tmp));
7615 fprintf(fff, "%11s", format("(%s)", tmp));
7617 tmp = autopick_line_from_entry(&autopick_list[k]);
7618 fprintf(fff, " %s", tmp);
7622 /* Close the file */
7624 /* Display the file contents */
7626 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7628 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7631 /* Remove the file */
7637 * Interact with "knowledge"
7639 void do_cmd_knowledge(void)
7642 /* File type is "TEXT" */
7643 FILE_TYPE(FILE_TYPE_TEXT);
7644 /* Save the screen */
7646 /* Interact until done */
7651 /* Ask for a choice */
7653 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7654 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7656 prt(format("page %d/2", (p+1)), 2, 65);
7657 prt("Display current knowledge", 3, 0);
7660 /* Give some choices */
7663 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7664 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7665 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7666 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7667 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7668 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7669 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7670 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7671 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7673 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7674 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7675 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7676 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7677 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7678 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7679 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7680 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7681 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7685 prt("(1) Display known artifacts", 6, 5);
7686 prt("(2) Display known objects", 7, 5);
7687 prt("(3) Display remaining uniques", 8, 5);
7688 prt("(4) Display dead uniques", 9, 5);
7689 prt("(5) Display kill count", 10, 5);
7690 prt("(6) Display wanted monsters", 11, 5);
7691 prt("(7) Display current pets", 12, 5);
7692 prt("(8) Display home inventory", 13, 5);
7693 prt("(9) Display *identified* equip.", 14, 5);
7695 prt("(a) Display about yourself", 6, 5);
7696 prt("(b) Display mutations", 7, 5);
7697 prt("(c) Display weapon proficiency", 8, 5);
7698 prt("(d) Display spell proficiency", 9, 5);
7699 prt("(e) Display misc. proficiency", 10, 5);
7700 prt("(f) Display virtues", 11, 5);
7701 prt("(g) Display dungeons", 12, 5);
7702 prt("(h) Display current quests", 13, 5);
7703 prt("(i) Display auto pick/destroy", 14, 5);
7708 prt("-³¤¯-", 16, 8);
7709 prt("ESC) È´¤±¤ë", 21, 1);
7710 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7711 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7712 prt("¥³¥Þ¥ó¥É:", 20, 0);
7714 prt("-more-", 16, 8);
7715 prt("ESC) Exit menu", 21, 1);
7716 prt("SPACE) Next page", 21, 30);
7717 /*prt("-) Previous page", 21, 60);*/
7718 prt("Command: ", 20, 0);
7724 if (i == ESCAPE) break;
7727 case ' ': /* Page change */
7731 case '1': /* Artifacts */
7732 do_cmd_knowledge_artifacts();
7734 case '2': /* Objects */
7735 do_cmd_knowledge_objects();
7737 case '3': /* Uniques */
7738 do_cmd_knowledge_uniques();
7740 case '4': /* Uniques */
7741 do_cmd_knowledge_uniques_dead();
7743 case '5': /* Kill count */
7744 do_cmd_knowledge_kill_count();
7746 case '6': /* wanted */
7747 do_cmd_knowledge_kubi();
7749 case '7': /* Pets */
7750 do_cmd_knowledge_pets();
7752 case '8': /* Home */
7753 do_cmd_knowledge_home();
7755 case '9': /* Resist list */
7756 do_cmd_knowledge_inven();
7759 case 'a': /* Max stat */
7760 do_cmd_knowledge_stat();
7762 case 'b': /* Mutations */
7763 do_cmd_knowledge_mutations();
7765 case 'c': /* weapon-exp */
7766 do_cmd_knowledge_weapon_exp();
7768 case 'd': /* spell-exp */
7769 do_cmd_knowledge_spell_exp();
7771 case 'e': /* skill-exp */
7772 do_cmd_knowledge_skill_exp();
7774 case 'f': /* Virtues */
7775 do_cmd_knowledge_virtues();
7777 case 'g': /* Dungeon */
7778 do_cmd_knowledge_dungeon();
7780 case 'h': /* Quests */
7781 do_cmd_knowledge_quests();
7783 case 'i': /* Autopick */
7784 do_cmd_knowledge_autopick();
7786 default: /* Unknown option */
7789 /* Flush messages */
7792 /* Restore the screen */
7798 * Check on the status of an active quest
7800 void do_cmd_checkquest(void)
7802 /* File type is "TEXT" */
7803 FILE_TYPE(FILE_TYPE_TEXT);
7805 /* Save the screen */
7809 do_cmd_knowledge_quests();
7811 /* Restore the screen */
7817 * Display the time and date
7819 void do_cmd_time(void)
7821 int day, hour, min, full, start, end, num;
7828 extract_day_hour_min(&day, &hour, &min);
7830 full = hour * 100 + min;
7838 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7840 strcpy(desc, "It is a strange time.");
7846 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7848 msg_format("This is day %d. The time is %d:%02d %s.",
7851 day, (hour % 12 == 0) ? 12 : (hour % 12),
7852 min, (hour < 12) ? "AM" : "PM");
7855 if (!randint0(10) || p_ptr->image)
7858 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun_j.txt");
7860 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timefun.txt");
7867 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm_j.txt");
7869 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "timenorm.txt");
7874 /* Open this file */
7875 fff = my_fopen(buf, "rt");
7880 /* Find this time */
7881 while (!my_fgets(fff, buf, sizeof(buf)))
7883 /* Ignore comments */
7884 if (!buf[0] || (buf[0] == '#')) continue;
7886 /* Ignore invalid lines */
7887 if (buf[1] != ':') continue;
7889 /* Process 'Start' */
7892 /* Extract the starting time */
7893 start = atoi(buf + 2);
7895 /* Assume valid for an hour */
7905 /* Extract the ending time */
7906 end = atoi(buf + 2);
7912 /* Ignore incorrect range */
7913 if ((start > full) || (full > end)) continue;
7915 /* Process 'Description' */
7920 /* Apply the randomizer */
7921 if (!randint0(num)) strcpy(desc, buf + 2);
7931 /* Close the file */