3 /* Purpose: Interface commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 * mark strings for auto dump
19 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
20 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
23 * Remove old lines automatically generated before.
25 static void remove_auto_dump(cptr orig_file, cptr mark)
27 FILE *tmp_fff, *orig_fff;
31 bool between_mark = FALSE;
34 long header_location = 0;
35 char header_mark_str[80];
36 char footer_mark_str[80];
39 sprintf(header_mark_str, auto_dump_header, mark);
40 sprintf(footer_mark_str, auto_dump_footer, mark);
42 mark_len = strlen(footer_mark_str);
44 /* If original file is not exist, nothing to do */
45 orig_fff = my_fopen(orig_file, "r");
52 tmp_fff = my_fopen_temp(tmp_file, 1024);
55 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
57 msg_format("Failed to create temporary file %s.", tmp_file);
65 if (my_fgets(orig_fff, buf, 1024))
69 fseek(orig_fff, header_location, SEEK_SET);
81 if (!strcmp(buf, header_mark_str))
83 header_location = ftell(orig_fff);
90 fprintf(tmp_fff, "%s\n", buf);
95 if (!strncmp(buf, footer_mark_str, mark_len))
99 if (!sscanf(buf + mark_len, " (%d)", &tmp)
102 fseek(orig_fff, header_location, SEEK_SET);
105 between_mark = FALSE;
118 /* copy contents of temporally file */
120 tmp_fff = my_fopen(tmp_file, "r");
121 orig_fff = my_fopen(orig_file, "w");
123 while (!my_fgets(tmp_fff, buf, 1024))
124 fprintf(orig_fff, "%s\n", buf);
135 * Open file to append auto dump.
137 static FILE *open_auto_dump(cptr buf, cptr mark, int *line)
141 char header_mark_str[80];
146 sprintf(header_mark_str, auto_dump_header, mark);
148 /* Remove old macro dumps */
149 remove_auto_dump(buf, mark);
151 /* Append to the file */
152 fff = my_fopen(buf, "a");
157 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
159 msg_format("Failed to open %s.", buf);
170 fprintf(fff, "%s\n", header_mark_str);
173 fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
174 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
176 fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
177 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
185 * Append foot part and close auto dump.
187 static void close_auto_dump(FILE *fff, cptr mark, int line_num)
189 char footer_mark_str[80];
191 sprintf(footer_mark_str, auto_dump_footer, mark);
195 fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
196 fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
198 fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
199 fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
203 fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
215 * Take note to the dialy.
218 errr do_cmd_write_nikki(int type, int num, cptr note)
224 cptr note_level = "";
225 bool do_level = TRUE;
227 s32b len = 20L * TOWN_DAWN;
228 s32b tick = turn % len + len / 4;
230 static bool disable_nikki = FALSE;
232 if (disable_nikki) return(-1);
234 if ((p_ptr->prace == RACE_VAMPIRE) ||
235 (p_ptr->prace == RACE_SKELETON) ||
236 (p_ptr->prace == RACE_ZOMBIE) ||
237 (p_ptr->prace == RACE_SPECTRE))
238 day = (turn - (15L * TOWN_DAWN))/ len + 1;
240 day = (turn + (5L * TOWN_DAWN))/ len + 1;
242 hour = (24 * tick / len) % 24;
243 min = (1440 * tick / len) % 60;
245 if (type == NIKKI_FIX_QUEST_C ||
246 type == NIKKI_FIX_QUEST_F ||
247 type == NIKKI_RAND_QUEST_C ||
248 type == NIKKI_RAND_QUEST_F ||
249 type == NIKKI_TO_QUEST)
253 old_quest = p_ptr->inside_quest;
254 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
256 /* Get the quest text */
257 init_flags = INIT_ASSIGN;
259 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
261 /* Reset the old quest number */
262 p_ptr->inside_quest = old_quest;
266 sprintf(file_name,"playrecord-%s.txt",savefile_base);
268 /* different filne name to avoid mixing */
269 sprintf(file_name,"playrec-%s.txt",savefile_base);
272 /* Hack -- drop permissions */
275 /* Build the filename */
276 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
278 /* File type is "TEXT" */
279 FILE_TYPE(FILE_TYPE_TEXT);
281 fff = my_fopen(buf, "a");
286 /* Hack -- grab permissions */
289 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
291 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
300 if (p_ptr->inside_arena)
302 note_level = "¥¢¥ê¡¼¥Ê:";
304 note_level = "Arane:";
308 note_level = "ÃϾå:";
310 note_level = "Surface:";
312 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
314 note_level = "¥¯¥¨¥¹¥È:";
316 note_level = "Quest:";
320 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
322 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
331 fprintf(fff, "%dÆüÌÜ\n",day);
333 fprintf(fff, "Day %d\n",day);
342 fprintf(fff, "%s\n",note);
346 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
352 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
354 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
361 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
363 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
367 case NIKKI_FIX_QUEST_C:
369 if (quest[num].flags & QUEST_FLAG_SILENT) break;
371 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
373 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
377 case NIKKI_FIX_QUEST_F:
379 if (quest[num].flags & QUEST_FLAG_SILENT) break;
381 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
383 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
387 case NIKKI_RAND_QUEST_C:
390 strcpy(name, r_name+r_info[quest[num].r_idx].name);
392 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
394 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
398 case NIKKI_RAND_QUEST_F:
401 strcpy(name, r_name+r_info[quest[num].r_idx].name);
403 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
405 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
409 case NIKKI_MAXDEAPTH:
412 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
414 fprintf(fff, " %2d:%02d %20s reached level %d of %s for the first time.\n", hour, min, note_level, num, d_name+d_info[dungeon_type].name);
421 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
423 fprintf(fff, " %2d:%02d %20s reset recall level of %s to %d %s.\n", hour, min, note_level, d_name + d_info[num].name, max_dlv[num], note);
430 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
441 if (!(dun_level+num)) to = "ÃϾå";
442 else to = format("%d³¬", dun_level+num);
444 if (!(dun_level+num)) to = "the surfice";
445 else to = format("level %d", dun_level+num);
450 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
452 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
460 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
462 fprintf(fff, " %2d:%02d %20s recall to dungeon level %d of %s.\n", hour, min, note_level, max_dlv[dungeon_type], d_name+d_info[dungeon_type].name);
466 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
468 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
474 if (quest[num].flags & QUEST_FLAG_SILENT) break;
476 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
478 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
493 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
504 if (!(dun_level+num)) to = "ÃϾå";
505 else to = format("%d³¬", dun_level+num);
507 if (!(dun_level+num)) to = "surface";
508 else to = format("level %d", dun_level+num);
513 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
515 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
522 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
524 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
531 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
533 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
543 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, p_ptr->arena_number + 1, note);
545 int n = p_ptr->arena_number + 1;
546 fprintf(fff, " %2d:%02d %20s beaten by %s in the %d%s fight.\n", hour, min, note_level, note, n, (n%10==1?"st":n%10==2?"nd":n%10==3?"rd":"th"));
551 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
553 fprintf(fff, " %2d:%02d %20s win the %d%s fight (%s).\n", hour, min, note_level, num, (num%10==1?"st":num%10==2?"nd":num%10==3?"rd":"th"), note);
555 if (num == MAX_ARENA_MONS)
558 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
560 fprintf(fff, " win all fight to become a Chanpion.\n");
569 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
571 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
586 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
588 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
592 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
594 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
601 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
603 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
607 case NIKKI_GAMESTART:
609 time_t ct = time((time_t*)0);
613 fprintf(fff, "%s %s",note, ctime(&ct));
616 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
619 case NIKKI_NAMED_PET:
621 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
626 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
628 fprintf(fff, "decide to travel together with %s.\n", note);
633 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
635 fprintf(fff, "unname %s.\n", note);
640 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
642 fprintf(fff, "dismiss %s.\n", note);
647 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
649 fprintf(fff, "%s die.\n", note);
654 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
656 fprintf(fff, "move to other map leaving %s behind.\n", note);
661 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
663 fprintf(fff, "lose sight of %s.\n", note);
668 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
670 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
675 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
677 fprintf(fff, "%s is crushed by falling rocks.\n", note);
692 /* Hack -- grab permissions */
695 if (do_level) write_level = FALSE;
701 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
703 static void do_cmd_disp_nikki(void)
705 char nikki_title[256];
710 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
711 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
722 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
723 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
724 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
725 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
730 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
739 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
741 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
742 "Attack is the best form of defence.",
744 "An unexpected windfall",
745 "A drowning man will catch at a straw",
746 "Don't count your chickens before they are hatched.",
747 "It is no use crying over spilt milk.",
748 "Seeing is believing.",
749 "Strike the iron while it is hot.",
750 "I don't care what follows.",
751 "To dig a well to put out a house on fire.",
752 "Tomorrow is another day.",
753 "Easy come, easy go.",
754 "The more haste, the less speed.",
755 "Where there is life, there is hope.",
756 "There is no royal road to *WINNER*.",
757 "Danger past, God forgotten.",
758 "The best thing to do now is to run away.",
759 "Life is but an empty dream.",
760 "Dead men tell no tales.",
761 "A book that remains shut is but a block.",
762 "Misfortunes never come singly.",
763 "A little knowledge is a dangerous thing.",
764 "History repeats itself.",
765 "*WINNER* was not built in a day.",
766 "Ignorance is bliss.",
767 "To lose is to win?",
768 "No medicine can cure folly.",
769 "All good things come to an end.",
770 "M$ Empire strikes back.",
771 "To see is to believe",
773 "Quest of The World's Greatest Brain"};
776 sprintf(file_name,"playrecord-%s.txt",savefile_base);
778 sprintf(file_name,"playrec-%s.txt",savefile_base);
781 /* Hack -- drop permissions */
784 /* Build the filename */
785 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
787 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
788 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
789 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
790 strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
791 else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
794 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
795 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
797 sprintf(nikki_title, "Legend of %s %s '%s'",
798 ap_ptr->title, player_name, tmp);
801 /* Display the file contents */
802 show_file(FALSE, buf, nikki_title, -1, 0);
804 /* Hack -- grab permissions */
808 static void do_cmd_bunshou(void)
811 char bunshou[80] = "\0";
814 if (get_string("ÆâÍÆ: ", tmp, 79))
816 if (get_string("diary note: ", tmp, 79))
819 strcpy(bunshou, tmp);
821 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
825 static void do_cmd_last_get(void)
830 if (record_o_name[0] == '\0') return;
833 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
835 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
837 if (!get_check(buf)) return;
842 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
844 sprintf(buf,"descover %s.", record_o_name);
846 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
850 static void do_cmd_erase_nikki(void)
857 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
859 if (!get_check("Do you really want to delete all your record? ")) return;
863 sprintf(file_name,"playrecord-%s.txt",savefile_base);
865 sprintf(file_name,"playrec-%s.txt",savefile_base);
868 /* Hack -- drop permissions */
871 /* Build the filename */
872 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
874 /* Remove the file */
877 fff = my_fopen(buf, "w");
881 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
883 msg_format("deleted record.");
887 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
889 msg_format("failed to delete %s.", buf);
894 /* Hack -- grab permissions */
901 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
907 void do_cmd_nikki(void)
911 /* File type is "TEXT" */
912 FILE_TYPE(FILE_TYPE_TEXT);
914 /* Save the screen */
917 /* Interact until done */
923 /* Ask for a choice */
925 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
927 prt("[ Play Record ]", 2, 0);
931 /* Give some choices */
933 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
934 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
935 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
936 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
938 prt("(1) Display your record", 4, 5);
939 prt("(2) Add record", 5, 5);
940 prt("(3) Record item you last get/identify", 6, 5);
941 prt("(4) Delete your record", 7, 5);
947 prt("¥³¥Þ¥ó¥É:", 18, 0);
949 prt("Command: ", 18, 0);
957 if (i == ESCAPE) break;
971 do_cmd_erase_nikki();
978 default: /* Unknown option */
986 /* Restore the screen */
991 * Hack -- redraw the screen
993 * This command performs various low level updates, clears all the "extra"
994 * windows, does a total redraw of the main window, and requests all of the
995 * interesting updates and redraws that I can think of.
997 * This command is also used to "instantiate" the results of the user
998 * selecting various things, such as graphics mode, so it must call
999 * the "TERM_XTRA_REACT" hook before redrawing the windows.
1001 void do_cmd_redraw(void)
1008 /* Hack -- react to changes */
1009 Term_xtra(TERM_XTRA_REACT, 0);
1012 /* Combine and Reorder the pack (later) */
1013 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1017 p_ptr->update |= (PU_TORCH);
1020 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1022 /* Forget lite/view */
1023 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
1025 /* Update lite/view */
1026 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
1028 /* Update monsters */
1029 p_ptr->update |= (PU_MONSTERS);
1031 /* Redraw everything */
1032 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1035 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
1038 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
1042 /* Hack -- update */
1045 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1048 /* Redraw every window */
1049 for (j = 0; j < 8; j++)
1052 if (!angband_term[j]) continue;
1055 Term_activate(angband_term[j]);
1070 * Hack -- change name
1072 void do_cmd_change_name(void)
1081 /* Save the screen */
1089 /* Display the player */
1090 display_player(mode);
1095 display_player(mode);
1100 Term_putstr(2, 23, -1, TERM_WHITE,
1101 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
1103 Term_putstr(2, 23, -1, TERM_WHITE,
1104 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
1112 if (c == ESCAPE) break;
1123 sprintf(tmp, "%s.txt", player_base);
1125 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
1127 if (get_string("File name: ", tmp, 80))
1131 if (tmp[0] && (tmp[0] != ' '))
1133 file_character(tmp, TRUE);
1150 /* Flush messages */
1154 /* Restore the screen */
1157 /* Redraw everything */
1158 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1165 * Recall the most recent message
1167 void do_cmd_message_one(void)
1169 /* Recall one message XXX XXX XXX */
1170 prt(format("> %s", message_str(0)), 0, 0);
1175 * Show previous messages to the user -BEN-
1177 * The screen format uses line 0 and 23 for headers and prompts,
1178 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
1180 * This command shows you which commands you are viewing, and allows
1181 * you to "search" for strings in the recall.
1183 * Note that messages may be longer than 80 characters, but they are
1184 * displayed using "infinite" length, with a special sub-command to
1185 * "slide" the virtual display to the left or right.
1187 * Attempt to only hilite the matching portions of the string.
1189 void do_cmd_messages(int num_now)
1200 Term_get_size(&wid, &hgt);
1209 /* Total messages */
1212 /* Start on first message */
1215 /* Start at leftmost edge */
1218 /* Save the screen */
1221 /* Process requests until done */
1227 /* Dump up to 20 lines of messages */
1228 for (j = 0; (j < hgt - 4) && (i + j < n); j++)
1230 cptr msg = message_str(i+j);
1232 /* Apply horizontal scroll */
1233 msg = (strlen(msg) >= q) ? (msg + q) : "";
1235 /* Dump the messages, bottom to top */
1236 Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
1238 /* Hilite "shower" */
1243 /* Display matches */
1244 while ((str = strstr(str, shower)) != NULL)
1246 int len = strlen(shower);
1248 /* Display the match */
1249 Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
1257 /* Display header XXX XXX XXX */
1260 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1261 i, i+j-1, n, q), 0, 0);
1263 prt(format("Message Recall (%d-%d of %d), Offset %d",
1264 i, i+j-1, n, q), 0, 0);
1268 /* Display prompt (not very informative) */
1270 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
1272 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
1279 /* Exit on Escape */
1280 if (k == ESCAPE) break;
1282 /* Hack -- Save the old index */
1285 /* Horizontal scroll */
1289 q = (q >= 40) ? (q - 40) : 0;
1295 /* Horizontal scroll */
1305 /* Hack -- handle show */
1310 prt("¶¯Ä´: ", hgt - 1, 0);
1312 prt("Show: ", hgt - 1, 0);
1316 /* Get a "shower" string, or continue */
1317 if (!askfor_aux(shower, 80)) continue;
1323 /* Hack -- handle find */
1330 prt("¸¡º÷: ", hgt - 1, 0);
1332 prt("Find: ", hgt - 1, 0);
1336 /* Get a "finder" string, or continue */
1337 if (!askfor_aux(finder, 80)) continue;
1340 strcpy(shower, finder);
1343 for (z = i + 1; z < n; z++)
1345 cptr msg = message_str(z);
1348 if (strstr(msg, finder))
1359 /* Recall 1 older message */
1360 if ((k == '8') || (k == '\n') || (k == '\r'))
1362 /* Go newer if legal */
1363 if (i + 1 < n) i += 1;
1366 /* Recall 10 older messages */
1369 /* Go older if legal */
1370 if (i + 10 < n) i += 10;
1373 /* Recall 20 older messages */
1374 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1376 /* Go older if legal */
1377 if (i + 20 < n) i += 20;
1380 /* Recall 20 newer messages */
1381 if ((k == 'n') || (k == KTRL('N')))
1383 /* Go newer (if able) */
1384 i = (i >= 20) ? (i - 20) : 0;
1387 /* Recall 10 newer messages */
1390 /* Go newer (if able) */
1391 i = (i >= 20) ? (i - 20) : 0;
1394 /* Recall 1 newer messages */
1397 /* Go newer (if able) */
1398 i = (i >= 1) ? (i - 1) : 0;
1401 /* Hack -- Error of some kind */
1405 /* Restore the screen */
1412 * Number of cheating options
1419 static option_type cheat_info[CHEAT_MAX] =
1421 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1423 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1425 "cheat_peek", "Peek into object creation" },
1429 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1431 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1433 "cheat_hear", "Peek into monster creation" },
1437 { &cheat_room, FALSE, 255, 0x04, 0x00,
1439 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1441 "cheat_room", "Peek into dungeon creation" },
1445 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1447 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1449 "cheat_xtra", "Peek into something else" },
1453 { &cheat_know, FALSE, 255, 0x10, 0x00,
1455 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1457 "cheat_know", "Know complete monster info" },
1461 { &cheat_live, FALSE, 255, 0x20, 0x00,
1463 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1465 "cheat_live", "Allow player to avoid death" }
1471 * Interact with some options for cheating
1473 static void do_cmd_options_cheat(cptr info)
1477 int i, k = 0, n = CHEAT_MAX;
1485 /* Interact with the player */
1488 /* Prompt XXX XXX XXX */
1490 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1492 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1498 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1499 prt(" << Ãí°Õ >>", 11, 0);
1500 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1501 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1502 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1504 /* Display the options */
1505 for (i = 0; i < n; i++)
1507 byte a = TERM_WHITE;
1509 /* Color current option */
1510 if (i == k) a = TERM_L_BLUE;
1512 /* Display the option text */
1513 sprintf(buf, "%-48s: %s (%s)",
1514 cheat_info[i].o_desc,
1516 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1518 (*cheat_info[i].o_var ? "yes" : "no "),
1521 cheat_info[i].o_text);
1522 c_prt(a, buf, i + 2, 0);
1525 /* Hilite current option */
1526 move_cursor(k + 2, 50);
1542 k = (n + k - 1) % n;
1561 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1563 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1565 noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1566 (*cheat_info[k].o_var) = TRUE;
1575 (*cheat_info[k].o_var) = FALSE;
1590 static option_type autosave_info[2] =
1592 { &autosave_l, FALSE, 255, 0x01, 0x00,
1594 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1596 "autosave_l", "Autosave when entering new levels" },
1600 { &autosave_t, FALSE, 255, 0x02, 0x00,
1602 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1604 "autosave_t", "Timed autosave" },
1610 static s16b toggle_frequency(s16b current)
1612 if (current == 0) return 50;
1613 if (current == 50) return 100;
1614 if (current == 100) return 250;
1615 if (current == 250) return 500;
1616 if (current == 500) return 1000;
1617 if (current == 1000) return 2500;
1618 if (current == 2500) return 5000;
1619 if (current == 5000) return 10000;
1620 if (current == 10000) return 25000;
1627 * Interact with some options for cheating
1629 static void do_cmd_options_autosave(cptr info)
1633 int i, k = 0, n = 2;
1641 /* Interact with the player */
1644 /* Prompt XXX XXX XXX */
1646 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1648 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1653 /* Display the options */
1654 for (i = 0; i < n; i++)
1656 byte a = TERM_WHITE;
1658 /* Color current option */
1659 if (i == k) a = TERM_L_BLUE;
1661 /* Display the option text */
1662 sprintf(buf, "%-48s: %s (%s)",
1663 autosave_info[i].o_desc,
1665 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1667 (*autosave_info[i].o_var ? "yes" : "no "),
1670 autosave_info[i].o_text);
1671 c_prt(a, buf, i + 2, 0);
1675 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1677 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1682 /* Hilite current option */
1683 move_cursor(k + 2, 50);
1699 k = (n + k - 1) % n;
1717 (*autosave_info[k].o_var) = TRUE;
1726 (*autosave_info[k].o_var) = FALSE;
1734 autosave_freq = toggle_frequency(autosave_freq);
1736 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1738 prt(format("Timed autosave frequency: every %d turns",
1741 autosave_freq), 5, 0);
1754 #define PAGE_AUTODESTROY 7
1757 * Interact with some options
1759 void do_cmd_options_aux(int page, cptr info)
1762 int i, k = 0, n = 0, l;
1767 /* Lookup the options */
1768 for (i = 0; i < 24; i++) opt[i] = 0;
1770 /* Scan the options */
1771 for (i = 0; option_info[i].o_desc; i++)
1773 /* Notice options on this "page" */
1774 if (option_info[i].o_page == page) opt[n++] = i;
1782 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
1784 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
1787 /* Interact with the player */
1790 /* Prompt XXX XXX XXX */
1792 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1794 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1799 /* Display the options */
1800 for (i = 0; i < n; i++)
1802 byte a = TERM_WHITE;
1804 /* Color current option */
1805 if (i == k) a = TERM_L_BLUE;
1807 /* Display the option text */
1808 sprintf(buf, "%-48s: %s (%.19s)",
1809 option_info[opt[i]].o_desc,
1811 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1813 (*option_info[opt[i]].o_var ? "yes" : "no "),
1816 option_info[opt[i]].o_text);
1817 if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
1818 else c_prt(a, buf, i + 2, 0);
1821 if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
1823 /* Hilite current option */
1824 move_cursor(k + 2 + l, 50);
1842 k = (n + k - 1) % n;
1863 (*option_info[opt[k]].o_var) = TRUE;
1874 (*option_info[opt[k]].o_var) = FALSE;
1882 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1897 * Modify the "window" options
1899 static void do_cmd_options_win(void)
1913 /* Memorize old flags */
1914 for (j = 0; j < 8; j++)
1916 /* Acquire current flags */
1917 old_flag[j] = window_flag[j];
1927 /* Prompt XXX XXX XXX */
1929 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1931 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1935 /* Display the windows */
1936 for (j = 0; j < 8; j++)
1938 byte a = TERM_WHITE;
1940 cptr s = angband_term_name[j];
1943 if (j == x) a = TERM_L_BLUE;
1945 /* Window name, staggered, centered */
1946 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1949 /* Display the options */
1950 for (i = 0; i < 16; i++)
1952 byte a = TERM_WHITE;
1954 cptr str = window_flag_desc[i];
1957 if (i == y) a = TERM_L_BLUE;
1961 if (!str) str = "(̤»ÈÍÑ)";
1963 if (!str) str = "(Unused option)";
1968 Term_putstr(0, i + 5, -1, a, str);
1970 /* Display the windows */
1971 for (j = 0; j < 8; j++)
1973 byte a = TERM_WHITE;
1978 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1981 if (window_flag[j] & (1L << i)) c = 'X';
1984 Term_putch(35 + j * 5, i + 5, a, c);
1989 Term_gotoxy(35 + x * 5, y + 5);
2007 for (j = 0; j < 8; j++)
2009 window_flag[j] &= ~(1L << y);
2013 for (i = 0; i < 16; i++)
2015 window_flag[x] &= ~(1L << i);
2028 window_flag[x] |= (1L << y);
2036 window_flag[x] &= ~(1L << y);
2042 d = get_keymap_dir(ch);
2044 x = (x + ddx[d] + 8) % 8;
2045 y = (y + ddy[d] + 16) % 16;
2052 /* Notice changes */
2053 for (j = 0; j < 8; j++)
2058 if (!angband_term[j]) continue;
2060 /* Ignore non-changes */
2061 if (window_flag[j] == old_flag[j]) continue;
2064 Term_activate(angband_term[j]);
2081 * Set or unset various options.
2083 * The user must use the "Ctrl-R" command to "adapt" to changes
2084 * in any options which control "visual" aspects of the game.
2086 void do_cmd_options(void)
2091 /* Save the screen */
2101 /* Why are we here */
2103 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
2105 prt("Options", 2, 0);
2109 /* Give some choices */
2111 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
2112 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
2113 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
2114 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
2115 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
2116 prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
2117 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
2118 /* Special choices */
2119 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
2120 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
2121 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
2123 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
2125 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
2127 prt("(1) Input Options", 4, 5);
2128 prt("(2) Output Options", 5, 5);
2129 prt("(3) Game-Play Options", 6, 5);
2130 prt("(4) Disturbance Options", 7, 5);
2131 prt("(5) Efficiency Options", 8, 5);
2132 prt("(6) Easy Auto-Destroyer Options", 9, 5);
2133 prt("(R) Play-record Options", 10, 5);
2135 /* Special choices */
2136 prt("(D) Base Delay Factor", 12, 5);
2137 prt("(H) Hitpoint Warning", 13, 5);
2138 prt("(A) Autosave Options", 14, 5);
2142 prt("(W) Window Flags", 15, 5);
2145 prt("(C) Cheating Options", 16, 5);
2151 prt("¥³¥Þ¥ó¥É:", 18, 0);
2153 prt("Command: ", 18, 0);
2161 if (k == ESCAPE) break;
2166 /* General Options */
2169 /* Process the general options */
2171 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
2173 do_cmd_options_aux(1, "Input Options");
2179 /* General Options */
2182 /* Process the general options */
2184 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
2186 do_cmd_options_aux(2, "Output Options");
2192 /* Inventory Options */
2197 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
2199 do_cmd_options_aux(3, "Game-Play Options");
2205 /* Disturbance Options */
2210 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
2212 do_cmd_options_aux(4, "Disturbance Options");
2218 /* Efficiency Options */
2223 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
2225 do_cmd_options_aux(5, "Efficiency Options");
2231 /* Object auto-destruction Options */
2236 do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
2238 do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
2243 /* Play-record Options */
2249 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2251 do_cmd_options_aux(10, "Play-record Option");
2256 /* Cheating Options */
2261 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2263 do_cmd_options_cheat("Cheaters never win");
2273 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2275 do_cmd_options_autosave("Autosave");
2286 do_cmd_options_win();
2287 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2288 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2289 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2290 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2294 /* Hack -- Delay Speed */
2300 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2302 prt("Command: Base Delay Factor", 18, 0);
2306 /* Get a new value */
2309 int msec = delay_factor * delay_factor * delay_factor;
2311 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2313 prt(format("Current base delay factor: %d (%d msec)",
2316 delay_factor, msec), 22, 0);
2318 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2320 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2324 if (k == ESCAPE) break;
2325 if (isdigit(k)) delay_factor = D2I(k);
2332 /* Hack -- hitpoint warning factor */
2338 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2340 prt("Command: Hitpoint Warning", 18, 0);
2344 /* Get a new value */
2348 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2349 hitpoint_warn), 22, 0);
2351 prt(format("Current hitpoint warning: %d0%%",
2352 hitpoint_warn), 22, 0);
2356 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2358 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2362 if (k == ESCAPE) break;
2363 if (isdigit(k)) hitpoint_warn = D2I(k);
2370 /* Unknown option */
2379 /* Flush messages */
2384 /* Restore the screen */
2387 /* Hack - Redraw equippy chars */
2388 p_ptr->redraw |= (PR_EQUIPPY);
2394 * Ask for a "user pref line" and process it
2396 * XXX XXX XXX Allow absolute file names?
2398 void do_cmd_pref(void)
2405 /* Ask for a "user pref command" */
2407 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2409 if (!get_string("Pref: ", buf, 80)) return;
2413 /* Process that pref command */
2414 (void)process_pref_file_command(buf);
2417 void do_cmd_pickpref(void)
2424 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2426 if(!get_check("Reload auto-pick preference file? ")) return;
2428 /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
2429 for( i = 0; i < max_autopick; i++){
2430 string_free(autopick_name[i]);
2431 string_free(autopick_insc[i]);
2435 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2437 sprintf(buf, "picktype-%s.prf", player_name);
2439 sprintf(buf, "pickpref-%s.prf", player_name);
2441 if( process_pickpref_file(buf) == 0 ){
2444 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2446 msg_format("loaded '%s'.", buf);
2450 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2452 if( process_pickpref_file("picktype.prf") == 0 )
2454 if( process_pickpref_file("pickpref.prf") == 0 )
2459 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2461 msg_print("loaded 'pickpref.prf'.");
2466 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2468 if(err) msg_print("Failed to reload autopick preference.");
2475 * Hack -- append all current macros to the given file
2477 static errr macro_dump(cptr fname)
2479 static cptr mark = "Macro Dump";
2487 /* Build the filename */
2488 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2490 /* File type is "TEXT" */
2491 FILE_TYPE(FILE_TYPE_TEXT);
2493 /* Append to the file */
2494 fff = open_auto_dump(buf, mark, &line_num);
2495 if (!fff) return (-1);
2499 fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2501 fprintf(fff, "\n# Automatic macro dump\n\n");
2506 for (i = 0; i < macro__num; i++)
2508 /* Extract the action */
2509 ascii_to_text(buf, macro__act[i]);
2511 /* Dump the macro */
2512 fprintf(fff, "A:%s\n", buf);
2514 /* Extract the action */
2515 ascii_to_text(buf, macro__pat[i]);
2517 /* Dump normal macros */
2518 fprintf(fff, "P:%s\n", buf);
2523 /* count number of lines */
2528 close_auto_dump(fff, mark, line_num);
2536 * Hack -- ask for a "trigger" (see below)
2538 * Note the complex use of the "inkey()" function from "util.c".
2540 * Note that both "flush()" calls are extremely important.
2542 static void do_cmd_macro_aux(char *buf)
2552 /* Do not process macros */
2558 /* Read the pattern */
2564 /* Do not process macros */
2567 /* Do not wait for keys */
2570 /* Attempt to read a key */
2581 /* Convert the trigger */
2582 ascii_to_text(tmp, buf);
2584 /* Hack -- display the trigger */
2585 Term_addstr(-1, TERM_WHITE, tmp);
2592 * Hack -- ask for a keymap "trigger" (see below)
2594 * Note that both "flush()" calls are extremely important. This may
2595 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2597 static void do_cmd_macro_aux_keymap(char *buf)
2611 /* Convert to ascii */
2612 ascii_to_text(tmp, buf);
2614 /* Hack -- display the trigger */
2615 Term_addstr(-1, TERM_WHITE, tmp);
2624 * Hack -- append all keymaps to the given file
2626 static errr keymap_dump(cptr fname)
2628 static cptr mark = "Keymap Dump";
2640 if (rogue_like_commands)
2642 mode = KEYMAP_MODE_ROGUE;
2648 mode = KEYMAP_MODE_ORIG;
2652 /* Build the filename */
2653 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2655 /* File type is "TEXT" */
2656 FILE_TYPE(FILE_TYPE_TEXT);
2658 /* Append to the file */
2659 fff = open_auto_dump(buf, mark, &line_num);
2660 if (!fff) return -1;
2664 fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2666 fprintf(fff, "\n# Automatic keymap dump\n\n");
2671 for (i = 0; i < 256; i++)
2675 /* Loop up the keymap */
2676 act = keymap_act[mode][i];
2678 /* Skip empty keymaps */
2681 /* Encode the key */
2684 ascii_to_text(key, buf);
2686 /* Encode the action */
2687 ascii_to_text(buf, act);
2689 /* Dump the macro */
2690 fprintf(fff, "A:%s\n", buf);
2691 fprintf(fff, "C:%d:%s\n", mode, key);
2696 close_auto_dump(fff, mark, line_num);
2705 * Interact with "macros"
2707 * Note that the macro "action" must be defined before the trigger.
2709 * Could use some helpful instructions on this page. XXX XXX XXX
2711 void do_cmd_macros(void)
2723 if (rogue_like_commands)
2725 mode = KEYMAP_MODE_ROGUE;
2731 mode = KEYMAP_MODE_ORIG;
2734 /* File type is "TEXT" */
2735 FILE_TYPE(FILE_TYPE_TEXT);
2742 /* Process requests until done */
2750 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2752 prt("Interact with Macros", 2, 0);
2757 /* Describe that action */
2759 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2761 prt("Current action (if any) shown below:", 20, 0);
2765 /* Analyze the current action */
2766 ascii_to_text(buf, macro__buf);
2768 /* Display the current action */
2774 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2776 prt("(1) Load a user pref file", 4, 5);
2781 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2782 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2783 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2784 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2785 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2786 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2787 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2788 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2789 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2791 prt("(2) Append macros to a file", 5, 5);
2792 prt("(3) Query a macro", 6, 5);
2793 prt("(4) Create a macro", 7, 5);
2794 prt("(5) Remove a macro", 8, 5);
2795 prt("(6) Append keymaps to a file", 9, 5);
2796 prt("(7) Query a keymap", 10, 5);
2797 prt("(8) Create a keymap", 11, 5);
2798 prt("(9) Remove a keymap", 12, 5);
2799 prt("(0) Enter a new action", 13, 5);
2802 #endif /* ALLOW_MACROS */
2806 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2808 prt("Command: ", 16, 0);
2816 if (i == ESCAPE) break;
2818 /* Load a 'macro' file */
2825 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2827 prt("Command: Load a user pref file", 16, 0);
2833 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2835 prt("File: ", 18, 0);
2839 /* Default filename */
2840 sprintf(tmp, "%s.prf", player_name);
2842 /* Ask for a file */
2843 if (!askfor_aux(tmp, 80)) continue;
2845 /* Process the given filename */
2846 err = process_pref_file(tmp);
2850 msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2852 msg_format("Loaded default '%s'.", tmp);
2859 msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
2861 msg_format("Failed to load '%s'!");
2867 msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
2869 msg_format("Loaded '%s'.", tmp);
2881 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2883 prt("Command: Append macros to a file", 16, 0);
2889 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2891 prt("File: ", 18, 0);
2895 /* Default filename */
2896 sprintf(tmp, "%s.prf", player_name);
2898 /* Ask for a file */
2899 if (!askfor_aux(tmp, 80)) continue;
2901 /* Dump the macros */
2902 (void)macro_dump(tmp);
2906 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2908 msg_print("Appended macros.");
2920 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2922 prt("Command: Query a macro", 16, 0);
2928 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2930 prt("Trigger: ", 18, 0);
2934 /* Get a macro trigger */
2935 do_cmd_macro_aux(buf);
2937 /* Acquire action */
2938 k = macro_find_exact(buf);
2945 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2947 msg_print("Found no macro.");
2955 /* Obtain the action */
2956 strcpy(macro__buf, macro__act[k]);
2958 /* Analyze the current action */
2959 ascii_to_text(buf, macro__buf);
2961 /* Display the current action */
2966 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2968 msg_print("Found a macro.");
2974 /* Create a macro */
2979 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2981 prt("Command: Create a macro", 16, 0);
2987 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2989 prt("Trigger: ", 18, 0);
2993 /* Get a macro trigger */
2994 do_cmd_macro_aux(buf);
3001 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
3003 prt("Action: ", 20, 0);
3007 /* Convert to text */
3008 ascii_to_text(tmp, macro__buf);
3010 /* Get an encoded action */
3011 if (askfor_aux(tmp, 80))
3013 /* Convert to ascii */
3014 text_to_ascii(macro__buf, tmp);
3016 /* Link the macro */
3017 macro_add(buf, macro__buf);
3021 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
3023 msg_print("Added a macro.");
3029 /* Remove a macro */
3034 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
3036 prt("Command: Remove a macro", 16, 0);
3042 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
3044 prt("Trigger: ", 18, 0);
3048 /* Get a macro trigger */
3049 do_cmd_macro_aux(buf);
3051 /* Link the macro */
3052 macro_add(buf, buf);
3056 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
3058 msg_print("Removed a macro.");
3068 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
3070 prt("Command: Append keymaps to a file", 16, 0);
3076 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3078 prt("File: ", 18, 0);
3082 /* Default filename */
3083 sprintf(tmp, "%s.prf", player_name);
3085 /* Ask for a file */
3086 if (!askfor_aux(tmp, 80)) continue;
3088 /* Dump the macros */
3089 (void)keymap_dump(tmp);
3093 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3095 msg_print("Appended keymaps.");
3100 /* Query a keymap */
3107 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
3109 prt("Command: Query a keymap", 16, 0);
3115 prt("²¡¤¹¥¡¼: ", 18, 0);
3117 prt("Keypress: ", 18, 0);
3121 /* Get a keymap trigger */
3122 do_cmd_macro_aux_keymap(buf);
3124 /* Look up the keymap */
3125 act = keymap_act[mode][(byte)(buf[0])];
3132 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
3134 msg_print("Found no keymap.");
3142 /* Obtain the action */
3143 strcpy(macro__buf, act);
3145 /* Analyze the current action */
3146 ascii_to_text(buf, macro__buf);
3148 /* Display the current action */
3153 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
3155 msg_print("Found a keymap.");
3161 /* Create a keymap */
3166 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
3168 prt("Command: Create a keymap", 16, 0);
3174 prt("²¡¤¹¥¡¼: ", 18, 0);
3176 prt("Keypress: ", 18, 0);
3180 /* Get a keymap trigger */
3181 do_cmd_macro_aux_keymap(buf);
3188 prt("¹ÔÆ°: ", 20, 0);
3190 prt("Action: ", 20, 0);
3194 /* Convert to text */
3195 ascii_to_text(tmp, macro__buf);
3197 /* Get an encoded action */
3198 if (askfor_aux(tmp, 80))
3200 /* Convert to ascii */
3201 text_to_ascii(macro__buf, tmp);
3203 /* Free old keymap */
3204 string_free(keymap_act[mode][(byte)(buf[0])]);
3206 /* Make new keymap */
3207 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3211 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3213 msg_print("Added a keymap.");
3219 /* Remove a keymap */
3224 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3226 prt("Command: Remove a keymap", 16, 0);
3232 prt("²¡¤¹¥¡¼: ", 18, 0);
3234 prt("Keypress: ", 18, 0);
3238 /* Get a keymap trigger */
3239 do_cmd_macro_aux_keymap(buf);
3241 /* Free old keymap */
3242 string_free(keymap_act[mode][(byte)(buf[0])]);
3244 /* Make new keymap */
3245 keymap_act[mode][(byte)(buf[0])] = NULL;
3249 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3251 msg_print("Removed a keymap.");
3256 /* Enter a new action */
3261 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3263 prt("Command: Enter a new action", 16, 0);
3267 /* Go to the correct location */
3270 /* Hack -- limit the value */
3273 /* Get an encoded action */
3274 if (!askfor_aux(buf, 80)) continue;
3276 /* Extract an action */
3277 text_to_ascii(macro__buf, buf);
3280 #endif /* ALLOW_MACROS */
3289 /* Flush messages */
3298 static void cmd_visuals_aux(char i, int *num, int max)
3305 sprintf(str, "%d", *num);
3307 if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
3310 tmp = strtol(str, NULL, 0);
3311 if (tmp >= 0 && tmp < max)
3315 else if (isupper(i))
3316 *num = (*num + max - 1) % max;
3318 *num = (*num + 1) % max;
3324 * Interact with "visuals"
3326 void do_cmd_visuals(void)
3337 /* File type is "TEXT" */
3338 FILE_TYPE(FILE_TYPE_TEXT);
3341 /* Save the screen */
3345 /* Interact until done */
3351 /* Ask for a choice */
3353 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3355 prt("Interact with Visuals", 2, 0);
3359 /* Give some choices */
3361 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3363 prt("(1) Load a user pref file", 4, 5);
3366 #ifdef ALLOW_VISUALS
3368 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3369 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3370 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3371 prt("(5) (̤»ÈÍÑ)", 8, 5);
3372 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3373 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3374 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3375 prt("(9) (̤»ÈÍÑ)", 12, 5);
3377 prt("(2) Dump monster attr/chars", 5, 5);
3378 prt("(3) Dump object attr/chars", 6, 5);
3379 prt("(4) Dump feature attr/chars", 7, 5);
3380 prt("(5) (unused)", 8, 5);
3381 prt("(6) Change monster attr/chars", 9, 5);
3382 prt("(7) Change object attr/chars", 10, 5);
3383 prt("(8) Change feature attr/chars", 11, 5);
3384 prt("(9) (unused)", 12, 5);
3389 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3391 prt("(0) Reset visuals", 13, 5);
3397 prt("¥³¥Þ¥ó¥É:", 18, 0);
3399 prt("Command: ", 15, 0);
3407 if (i == ESCAPE) break;
3409 /* Load a 'pref' file */
3414 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3416 prt("Command: Load a user pref file", 15, 0);
3422 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3424 prt("File: ", 17, 0);
3428 /* Default filename */
3429 sprintf(tmp, "%s.prf", player_name);
3432 if (!askfor_aux(tmp, 70)) continue;
3434 /* Process the given filename */
3435 (void)process_pref_file(tmp);
3438 #ifdef ALLOW_VISUALS
3440 /* Dump monster attr/chars */
3443 static cptr mark = "Monster attr/chars";
3448 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3450 prt("Command: Dump monster attr/chars", 15, 0);
3456 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3458 prt("File: ", 17, 0);
3462 /* Default filename */
3463 sprintf(tmp, "%s.prf", player_name);
3465 /* Get a filename */
3466 if (!askfor_aux(tmp, 70)) continue;
3468 /* Build the filename */
3469 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3471 /* Append to the file */
3472 fff = open_auto_dump(buf, mark, &line_num);
3477 fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3479 fprintf(fff, "\n# Monster attr/char definitions\n\n");
3484 for (i = 0; i < max_r_idx; i++)
3486 monster_race *r_ptr = &r_info[i];
3488 /* Skip non-entries */
3489 if (!r_ptr->name) continue;
3491 /* Dump a comment */
3492 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3495 /* Dump the monster attr/char info */
3496 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3497 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3502 close_auto_dump(fff, mark, line_num);
3506 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3508 msg_print("Dumped monster attr/chars.");
3513 /* Dump object attr/chars */
3516 static cptr mark = "Object attr/chars";
3521 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3523 prt("Command: Dump object attr/chars", 15, 0);
3529 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3531 prt("File: ", 17, 0);
3535 /* Default filename */
3536 sprintf(tmp, "%s.prf", player_name);
3538 /* Get a filename */
3539 if (!askfor_aux(tmp, 70)) continue;
3541 /* Build the filename */
3542 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3544 /* Append to the file */
3545 fff = open_auto_dump(buf, mark, &line_num);
3550 fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3552 fprintf(fff, "\n# Object attr/char definitions\n\n");
3557 for (i = 0; i < max_k_idx; i++)
3559 object_kind *k_ptr = &k_info[i];
3561 /* Skip non-entries */
3562 if (!k_ptr->name) continue;
3564 /* Dump a comment */
3565 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3568 /* Dump the object attr/char info */
3569 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3570 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3575 close_auto_dump(fff, mark, line_num);
3579 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3581 msg_print("Dumped object attr/chars.");
3586 /* Dump feature attr/chars */
3589 static cptr mark = "Feature attr/chars";
3594 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3596 prt("Command: Dump feature attr/chars", 15, 0);
3602 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3604 prt("File: ", 17, 0);
3608 /* Default filename */
3609 sprintf(tmp, "%s.prf", player_name);
3611 /* Get a filename */
3612 if (!askfor_aux(tmp, 70)) continue;
3614 /* Build the filename */
3615 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3617 /* Append to the file */
3618 fff = open_auto_dump(buf, mark, &line_num);
3623 fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3625 fprintf(fff, "\n# Feature attr/char definitions\n\n");
3630 for (i = 0; i < max_f_idx; i++)
3632 feature_type *f_ptr = &f_info[i];
3634 /* Skip non-entries */
3635 if (!f_ptr->name) continue;
3637 /* Dump a comment */
3638 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3641 /* Dump the feature attr/char info */
3642 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3643 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3648 close_auto_dump(fff, mark, line_num);
3652 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3654 msg_print("Dumped feature attr/chars.");
3659 /* Modify monster attr/chars */
3666 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3668 prt("Command: Change monster attr/chars", 15, 0);
3672 /* Hack -- query until done */
3675 monster_race *r_ptr = &r_info[r];
3679 byte da = (r_ptr->d_attr);
3680 byte dc = (r_ptr->d_char);
3681 byte ca = (r_ptr->x_attr);
3682 byte cc = (r_ptr->x_char);
3684 /* Label the object */
3686 Term_putstr(5, 17, -1, TERM_WHITE,
3687 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3688 r, (r_name + r_ptr->name)));
3690 Term_putstr(5, 17, -1, TERM_WHITE,
3691 format("Monster = %d, Name = %-40.40s",
3692 r, (r_name + r_ptr->name)));
3696 /* Label the Default values */
3698 Term_putstr(10, 19, -1, TERM_WHITE,
3699 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3701 Term_putstr(10, 19, -1, TERM_WHITE,
3702 format("Default attr/char = %3u / %3u", da, dc));
3705 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3706 Term_putch(43, 19, da, dc);
3710 Term_putch(44, 19, 255, 255);
3712 Term_putch(44, 19, 0, ' ');
3715 /* Label the Current values */
3717 Term_putstr(10, 20, -1, TERM_WHITE,
3718 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3720 Term_putstr(10, 20, -1, TERM_WHITE,
3721 format("Current attr/char = %3u / %3u", ca, cc));
3724 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3725 Term_putch(43, 20, ca, cc);
3729 Term_putch(44, 20, 255, 255);
3731 Term_putch(44, 20, 0, ' ');
3736 Term_putstr(0, 22, -1, TERM_WHITE,
3737 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3739 Term_putstr(0, 22, -1, TERM_WHITE,
3740 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3747 if (i == ESCAPE) break;
3749 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3750 else if (isupper(i)) c = 'a' + i - 'A';
3756 cmd_visuals_aux(i, &r, max_r_idx);
3759 t = (int)r_ptr->x_attr;
3760 cmd_visuals_aux(i, &t, 256);
3761 r_ptr->x_attr = (byte)t;
3764 t = (int)r_ptr->x_char;
3765 cmd_visuals_aux(i, &t, 256);
3766 r_ptr->x_char = (byte)t;
3772 /* Modify object attr/chars */
3779 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3781 prt("Command: Change object attr/chars", 15, 0);
3785 /* Hack -- query until done */
3788 object_kind *k_ptr = &k_info[k];
3792 byte da = (byte)k_ptr->d_attr;
3793 byte dc = (byte)k_ptr->d_char;
3794 byte ca = (byte)k_ptr->x_attr;
3795 byte cc = (byte)k_ptr->x_char;
3797 /* Label the object */
3799 Term_putstr(5, 17, -1, TERM_WHITE,
3800 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3801 k, (k_name + k_ptr->name)));
3803 Term_putstr(5, 17, -1, TERM_WHITE,
3804 format("Object = %d, Name = %-40.40s",
3805 k, (k_name + k_ptr->name)));
3809 /* Label the Default values */
3811 Term_putstr(10, 19, -1, TERM_WHITE,
3812 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3814 Term_putstr(10, 19, -1, TERM_WHITE,
3815 format("Default attr/char = %3d / %3d", da, dc));
3818 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3819 Term_putch(43, 19, da, dc);
3823 Term_putch(44, 19, 255, 255);
3825 Term_putch(44, 19, 0, ' ');
3828 /* Label the Current values */
3830 Term_putstr(10, 20, -1, TERM_WHITE,
3831 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3833 Term_putstr(10, 20, -1, TERM_WHITE,
3834 format("Current attr/char = %3d / %3d", ca, cc));
3837 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3838 Term_putch(43, 20, ca, cc);
3842 Term_putch(44, 20, 255, 255);
3844 Term_putch(44, 20, 0, ' ');
3849 Term_putstr(0, 22, -1, TERM_WHITE,
3850 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3852 Term_putstr(0, 22, -1, TERM_WHITE,
3853 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3860 if (i == ESCAPE) break;
3862 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3863 else if (isupper(i)) c = 'a' + i - 'A';
3869 cmd_visuals_aux(i, &k, max_k_idx);
3872 t = (int)k_info[k].x_attr;
3873 cmd_visuals_aux(i, &t, 256);
3874 k_info[k].x_attr = (byte)t;
3877 t = (int)k_info[k].x_char;
3878 cmd_visuals_aux(i, &t, 256);
3879 k_info[k].x_char = (byte)t;
3885 /* Modify feature attr/chars */
3892 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3894 prt("Command: Change feature attr/chars", 15, 0);
3898 /* Hack -- query until done */
3901 feature_type *f_ptr = &f_info[f];
3905 byte da = (byte)f_ptr->d_attr;
3906 byte dc = (byte)f_ptr->d_char;
3907 byte ca = (byte)f_ptr->x_attr;
3908 byte cc = (byte)f_ptr->x_char;
3910 /* Label the object */
3912 Term_putstr(5, 17, -1, TERM_WHITE,
3913 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3914 f, (f_name + f_ptr->name)));
3916 Term_putstr(5, 17, -1, TERM_WHITE,
3917 format("Terrain = %d, Name = %-40.40s",
3918 f, (f_name + f_ptr->name)));
3922 /* Label the Default values */
3924 Term_putstr(10, 19, -1, TERM_WHITE,
3925 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3927 Term_putstr(10, 19, -1, TERM_WHITE,
3928 format("Default attr/char = %3d / %3d", da, dc));
3931 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3932 Term_putch(43, 19, da, dc);
3936 Term_putch(44, 19, 255, 255);
3938 Term_putch(44, 19, 0, ' ');
3941 /* Label the Current values */
3943 Term_putstr(10, 20, -1, TERM_WHITE,
3944 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3946 Term_putstr(10, 20, -1, TERM_WHITE,
3947 format("Current attr/char = %3d / %3d", ca, cc));
3950 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3951 Term_putch(43, 20, ca, cc);
3955 Term_putch(44, 20, 255, 255);
3957 Term_putch(44, 20, 0, ' ');
3962 Term_putstr(0, 22, -1, TERM_WHITE,
3963 "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
3965 Term_putstr(0, 22, -1, TERM_WHITE,
3966 "Command (n/N/^N/a/A/^A/c/C/^C): ");
3973 if (i == ESCAPE) break;
3975 if (iscntrl(i)) c = 'a' + i - KTRL('A');
3976 else if (isupper(i)) c = 'a' + i - 'A';
3982 cmd_visuals_aux(i, &f, max_f_idx);
3985 t = (int)f_info[f].x_attr;
3986 cmd_visuals_aux(i, &t, 256);
3987 f_info[f].x_attr = (byte)t;
3990 t = (int)f_info[f].x_char;
3991 cmd_visuals_aux(i, &t, 256);
3992 f_info[f].x_char = (byte)t;
4008 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
4010 msg_print("Visual attr/char tables reset.");
4015 /* Unknown option */
4021 /* Flush messages */
4026 /* Restore the screen */
4032 * Interact with "colors"
4034 void do_cmd_colors(void)
4045 /* File type is "TEXT" */
4046 FILE_TYPE(FILE_TYPE_TEXT);
4049 /* Save the screen */
4053 /* Interact until done */
4059 /* Ask for a choice */
4061 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
4063 prt("Interact with Colors", 2, 0);
4067 /* Give some choices */
4069 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
4071 prt("(1) Load a user pref file", 4, 5);
4076 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
4077 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
4079 prt("(2) Dump colors", 5, 5);
4080 prt("(3) Modify colors", 6, 5);
4087 prt("¥³¥Þ¥ó¥É: ", 8, 0);
4089 prt("Command: ", 8, 0);
4097 if (i == ESCAPE) break;
4099 /* Load a 'pref' file */
4104 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
4106 prt("Command: Load a user pref file", 8, 0);
4112 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4114 prt("File: ", 10, 0);
4119 sprintf(tmp, "%s.prf", player_name);
4122 if (!askfor_aux(tmp, 70)) continue;
4124 /* Process the given filename */
4125 (void)process_pref_file(tmp);
4127 /* Mega-Hack -- react to changes */
4128 Term_xtra(TERM_XTRA_REACT, 0);
4130 /* Mega-Hack -- redraw */
4139 static cptr mark = "Colors";
4144 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
4146 prt("Command: Dump colors", 8, 0);
4152 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
4154 prt("File: ", 10, 0);
4158 /* Default filename */
4159 sprintf(tmp, "%s.prf", player_name);
4161 /* Get a filename */
4162 if (!askfor_aux(tmp, 70)) continue;
4164 /* Build the filename */
4165 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
4167 /* Append to the file */
4168 fff = open_auto_dump(buf, mark, &line_num);
4173 fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
4175 fprintf(fff, "\n# Color redefinitions\n\n");
4180 for (i = 0; i < 256; i++)
4182 int kv = angband_color_table[i][0];
4183 int rv = angband_color_table[i][1];
4184 int gv = angband_color_table[i][2];
4185 int bv = angband_color_table[i][3];
4190 cptr name = "unknown";
4194 /* Skip non-entries */
4195 if (!kv && !rv && !gv && !bv) continue;
4197 /* Extract the color name */
4198 if (i < 16) name = color_names[i];
4200 /* Dump a comment */
4202 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
4204 fprintf(fff, "# Color '%s'\n", name);
4208 /* Dump the monster attr/char info */
4209 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
4215 close_auto_dump(fff, mark, line_num);
4219 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
4221 msg_print("Dumped color redefinitions.");
4233 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
4235 prt("Command: Modify colors", 8, 0);
4239 /* Hack -- query until done */
4248 /* Exhibit the normal colors */
4249 for (j = 0; j < 16; j++)
4251 /* Exhibit this color */
4252 Term_putstr(j*4, 20, -1, a, "###");
4254 /* Exhibit all colors */
4255 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4258 /* Describe the color */
4260 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4262 name = ((a < 16) ? color_names[a] : "undefined");
4266 /* Describe the color */
4268 Term_putstr(5, 10, -1, TERM_WHITE,
4269 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4271 Term_putstr(5, 10, -1, TERM_WHITE,
4272 format("Color = %d, Name = %s", a, name));
4276 /* Label the Current values */
4277 Term_putstr(5, 12, -1, TERM_WHITE,
4278 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4279 angband_color_table[a][0],
4280 angband_color_table[a][1],
4281 angband_color_table[a][2],
4282 angband_color_table[a][3]));
4286 Term_putstr(0, 14, -1, TERM_WHITE,
4287 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4289 Term_putstr(0, 14, -1, TERM_WHITE,
4290 "Command (n/N/k/K/r/R/g/G/b/B): ");
4298 if (i == ESCAPE) break;
4301 if (i == 'n') a = (byte)(a + 1);
4302 if (i == 'N') a = (byte)(a - 1);
4303 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4304 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4305 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4306 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4307 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4308 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4309 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4310 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4312 /* Hack -- react to changes */
4313 Term_xtra(TERM_XTRA_REACT, 0);
4315 /* Hack -- redraw */
4322 /* Unknown option */
4328 /* Flush messages */
4333 /* Restore the screen */
4339 * Note something in the message recall
4341 void do_cmd_note(void)
4350 if (!get_string("¥á¥â: ", buf, 60)) return;
4352 if (!get_string("Note: ", buf, 60)) return;
4356 /* Ignore empty notes */
4357 if (!buf[0] || (buf[0] == ' ')) return;
4359 /* Add the note to the message recall */
4361 msg_format("¥á¥â: %s", buf);
4363 msg_format("Note: %s", buf);
4370 * Mention the current version
4372 void do_cmd_version(void)
4376 #ifndef FAKE_VERSION
4377 msg_format("You are playing Angband %d.%d.%d.",
4378 VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
4381 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4382 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4384 msg_format("You are playing Hengband %d.%d.%d.",
4385 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4395 * Array of feeling strings
4397 static cptr do_cmd_feeling_text[11] =
4400 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4402 "Looks like any other level.",
4406 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4408 "You feel there is something special about this level.",
4412 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4414 "You nearly faint as horrible visions of death fill your mind!",
4418 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4420 "This level looks very dangerous.",
4424 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4426 "You have a very bad feeling...",
4430 "°¤¤Í½´¶¤¬¤¹¤ë...",
4432 "You have a bad feeling...",
4438 "You feel nervous.",
4442 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4444 "You feel your luck is turning...",
4448 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4450 "You don't like the look of this place.",
4454 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4456 "This level looks reasonably safe.",
4460 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4462 "What a boring place..."
4467 static cptr do_cmd_feeling_text_combat[11] =
4470 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4472 "Looks like any other level.",
4476 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4478 "You feel there is something special about this level.",
4482 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4484 "You nearly faint as horrible visions of death fill your mind!",
4488 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4490 "This level looks very dangerous.",
4494 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4496 "You have a very bad feeling...",
4500 "°¤¤Í½´¶¤¬¤¹¤ë...",
4502 "You have a bad feeling...",
4508 "You feel nervous.",
4512 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4514 "You feel your luck is turning...",
4518 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4520 "You don't like the look of this place.",
4524 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4526 "This level looks reasonably safe.",
4530 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4532 "What a boring place..."
4537 static cptr do_cmd_feeling_text_lucky[11] =
4540 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4541 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4542 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4543 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4544 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4545 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4546 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4547 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4548 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4549 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4550 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4552 "Looks like any other level.",
4553 "You feel there is something special about this level.",
4554 "You have a superb feeling about this level.",
4555 "You have an excellent feeling...",
4556 "You have a very good feeling...",
4557 "You have a good feeling...",
4558 "You feel strangely lucky...",
4559 "You feel your luck is turning...",
4560 "You like the look of this place...",
4561 "This level can't be all bad...",
4562 "What a boring place..."
4568 * Note that "feeling" is set to zero unless some time has passed.
4569 * Note that this is done when the level is GENERATED, not entered.
4571 void do_cmd_feeling(void)
4573 /* Verify the feeling */
4574 if (feeling > 10) feeling = 10;
4576 /* No useful feeling in quests */
4577 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4580 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4582 msg_print("Looks like a typical quest level.");
4588 /* No useful feeling in town */
4589 else if (p_ptr->town_num && !dun_level)
4592 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4594 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4598 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4600 msg_print("Looks like a strange wilderness.");
4608 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4610 msg_print("Looks like a typical town.");
4617 /* No useful feeling in the wilderness */
4618 else if (!dun_level)
4621 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4623 msg_print("Looks like a typical wilderness.");
4629 /* Display the feeling */
4630 if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
4632 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4634 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4635 msg_print(do_cmd_feeling_text_combat[feeling]);
4637 msg_print(do_cmd_feeling_text[feeling]);
4642 msg_print(do_cmd_feeling_text[0]);
4651 * Encode the screen colors
4653 static char hack[17] = "dwsorgbuDWvyRGBU";
4656 static errr photo_fgets(FILE *fff, char *buf, huge n)
4665 if (fgets(tmp, 1024, fff))
4667 /* Convert weirdness */
4668 for (s = tmp; *s; s++)
4670 /* Handle newline */
4681 else if (*s == '\t')
4683 /* Hack -- require room */
4684 if (i + 8 >= n) break;
4686 /* Append a space */
4689 /* Append some more spaces */
4690 while (!(i % 8)) buf[i++] = ' ';
4694 else if (iskanji(*s))
4701 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4702 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4709 /* Handle printables */
4730 * Hack -- load a screen dump from a file
4732 void do_cmd_load_screen(void)
4746 /* Hack -- drop permissions */
4749 /* Build the filename */
4750 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4752 /* Append to the file */
4753 fff = my_fopen(buf, "r");
4758 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4760 msg_format("Failed to open %s.", buf);
4767 /* Save the screen */
4770 /* Clear the screen */
4774 /* Load the screen */
4775 for (y = 0; okay && (y < 24); y++)
4777 /* Get a line of data */
4778 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4781 for (x = 0; x < 79; x++)
4783 /* Put the attr/char */
4784 Term_draw(x, y, TERM_WHITE, buf[x]);
4788 /* Get the blank line */
4789 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4792 /* Dump the screen */
4793 for (y = 0; okay && (y < 24); y++)
4795 /* Get a line of data */
4796 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4799 for (x = 0; x < 79; x++)
4801 /* Get the attr/char */
4802 (void)(Term_what(x, y, &a, &c));
4804 /* Look up the attr */
4805 for (i = 0; i < 16; i++)
4807 /* Use attr matches */
4808 if (hack[i] == buf[x]) a = i;
4811 /* Put the attr/char */
4812 Term_draw(x, y, a, c);
4817 /* Get the blank line */
4818 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4824 /* Hack -- grab permissions */
4830 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4832 msg_print("Screen dump loaded.");
4839 /* Restore the screen */
4846 cptr inven_res_label =
4848 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4850 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4853 /* XTRA HACK RESLIST */
4854 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4855 int *j, byte tval, char *where)
4857 char o_name[MAX_NLEN];
4860 if (!o_ptr->k_idx)return;
4861 if (o_ptr->tval != tval)return;
4864 * HACK:Ring of Lordly protection and Dragon shield/helm
4865 * have random resistances.
4867 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4868 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4869 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4870 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4871 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4872 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4873 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4876 object_desc(o_name, o_ptr, TRUE, 0);
4878 while ( o_name[i] && i < 26 ){
4880 if (iskanji(o_name[i])) i++;
4884 if(i<28) while(i<28){o_name[i]=' ';i++;}
4887 fprintf(fff,"%s %s", where, o_name);
4889 if (!(o_ptr->ident & (IDENT_MENTAL)))
4892 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4894 fprintf(fff, "-------unknown------------ -------unknown------\n");
4898 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4901 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4902 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4903 else fprintf(fff,"¡¦");
4905 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4906 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4907 else fprintf(fff,"¡¦");
4909 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4910 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4911 else fprintf(fff,"¡¦");
4913 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4914 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4915 else fprintf(fff,"¡¦");
4917 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4918 else fprintf(fff,"¡¦");
4920 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4921 else fprintf(fff,"¡¦");
4923 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4924 else fprintf(fff,"¡¦");
4926 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4927 else fprintf(fff,"¡¦");
4929 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4930 else fprintf(fff,"¡¦");
4932 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4933 else fprintf(fff,"¡¦");
4935 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4936 else fprintf(fff,"¡¦");
4938 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4939 else fprintf(fff,"¡¦");
4941 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4942 else fprintf(fff,"¡¦");
4946 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4947 else fprintf(fff,"¡¦");
4949 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4950 else fprintf(fff,"¡¦");
4952 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4953 else fprintf(fff,"¡¦");
4955 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4956 else fprintf(fff,"¡¦");
4958 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4959 else fprintf(fff,"¡¦");
4961 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4962 else fprintf(fff,"¡¦");
4964 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4965 else fprintf(fff,"¡¦");
4967 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4968 else fprintf(fff,"¡¦");
4971 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4972 else fprintf(fff,"¡¦");
4974 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4975 else fprintf(fff,"¡¦");
4977 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4978 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4979 else fprintf(fff,". ");
4981 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4982 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4983 else fprintf(fff,". ");
4985 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4986 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4987 else fprintf(fff,". ");
4989 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4990 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4991 else fprintf(fff,". ");
4993 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4994 else fprintf(fff,". ");
4996 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4997 else fprintf(fff,". ");
4999 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
5000 else fprintf(fff,". ");
5002 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
5003 else fprintf(fff,". ");
5005 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
5006 else fprintf(fff,". ");
5008 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
5009 else fprintf(fff,". ");
5011 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
5012 else fprintf(fff,". ");
5014 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
5015 else fprintf(fff,". ");
5017 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
5018 else fprintf(fff,". ");
5022 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
5023 else fprintf(fff,". ");
5025 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
5026 else fprintf(fff,". ");
5028 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
5029 else fprintf(fff,". ");
5031 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
5032 else fprintf(fff,". ");
5034 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
5035 else fprintf(fff,". ");
5037 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
5038 else fprintf(fff,". ");
5040 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
5041 else fprintf(fff,". ");
5043 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
5044 else fprintf(fff,". ");
5047 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
5048 else fprintf(fff,". ");
5050 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
5051 else fprintf(fff,". ");
5059 fprintf(fff,"%s\n", inven_res_label);
5065 * Display *ID* ed weapons/armors's resistances
5067 static void do_cmd_knowledge_inven(void)
5072 char file_name[1024];
5083 /* Open a new file */
5084 fff = my_fopen_temp(file_name, 1024);
5087 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5089 msg_format("Failed to create temporally file %s.", file_name);
5094 fprintf(fff,"%s\n",inven_res_label);
5096 for (tval=TV_BOW; tval <= TV_RING; tval++){
5099 for (;j<9;j++) fprintf(fff, "\n");
5101 fprintf(fff,"%s\n",inven_res_label);
5105 strcpy(where, "Áõ");
5107 strcpy(where, "E ");
5109 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5111 o_ptr = &inventory[i];
5112 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5116 strcpy(where, "»ý");
5118 strcpy(where, "I ");
5120 for (i = 0; i < INVEN_PACK; i++)
5122 o_ptr = &inventory[i];
5123 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5127 /* Print all homes in the different towns */
5128 st_ptr = &town[1].store[STORE_HOME];
5130 strcpy(where, "²È");
5132 strcpy(where, "H ");/*nanka*/
5135 /* Dump all available items */
5136 for (i = 0; i < st_ptr->stock_num; i++)
5138 o_ptr = &st_ptr->stock[i];
5139 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
5143 /* Close the file */
5146 /* Display the file contents */
5148 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
5150 show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
5153 /* Remove the file */
5158 void do_cmd_save_screen_html_aux(char *filename, int message)
5162 byte a = 0, old_a = 0;
5176 char *html_head[] = {
5177 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
5181 char *html_foot[] = {
5183 "</body>\n</html>\n",
5187 /* File type is "TEXT" */
5188 FILE_TYPE(FILE_TYPE_TEXT);
5190 /* Append to the file */
5191 fff = my_fopen(filename, "w");
5197 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
5199 msg_format("Failed to open file %s.", filename);
5207 /* Save the screen */
5211 /* Build the filename */
5212 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
5213 tmpfff = my_fopen(buf, "r");
5215 for (i = 0; html_head[i]; i++)
5216 fprintf(fff, html_head[i]);
5220 while (!my_fgets(tmpfff, buf, 1024)) {
5222 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
5226 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
5228 fprintf(fff, "%s\n", buf);
5233 /* Dump the screen */
5234 for (y = 0; y < 24; y++)
5241 for (x = 0; x < 79; x++)
5245 /* Get the attr/char */
5246 (void)(Term_what(x, y, &a, &c));
5250 case '&': cc = "&"; break;
5251 case '<': cc = "<"; break;
5252 case '>': cc = ">"; break;
5254 case 0x1f: c = '.'; break;
5255 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5260 if ((y == 0 && x == 0) || a != old_a) {
5261 rv = angband_color_table[a][1];
5262 gv = angband_color_table[a][2];
5263 bv = angband_color_table[a][3];
5264 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5265 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5269 fprintf(fff, "%s", cc);
5271 fprintf(fff, "%c", c);
5274 fprintf(fff, "</font>");
5277 for (i = 0; html_foot[i]; i++)
5278 fprintf(fff, html_foot[i]);
5283 while (!my_fgets(tmpfff, buf, 1024)) {
5285 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5289 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5291 fprintf(fff, "%s\n", buf);
5306 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5308 msg_print("Screen dump saved.");
5313 /* Restore the screen */
5319 * Hack -- save a screen dump to a file
5321 void do_cmd_save_screen_html(void)
5323 char buf[1024], tmp[256] = "screen.html";
5326 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5328 if (!get_string("File name: ", tmp, 80))
5332 /* Build the filename */
5333 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5337 /* Hack -- drop permissions */
5340 do_cmd_save_screen_html_aux(buf, 1);
5342 /* Hack -- grab permissions */
5348 * Redefinable "save_screen" action
5350 void (*screendump_aux)(void) = NULL;
5354 * Hack -- save a screen dump to a file
5356 void do_cmd_save_screen(void)
5358 bool old_use_graphics = use_graphics;
5360 if (old_use_graphics)
5362 use_graphics = FALSE;
5365 /* Redraw everything */
5366 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5368 /* Hack -- update */
5373 if (get_check_strict("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©", 4))
5375 if (get_check_strict("Save screen dump as HTML? ", 4))
5378 do_cmd_save_screen_html();
5382 /* Do we use a special screendump function ? */
5383 else if (screendump_aux)
5385 /* Dump the screen to a graphics file */
5386 (*screendump_aux)();
5388 else /* Dump the screen as text */
5400 /* Hack -- drop permissions */
5403 /* Build the filename */
5404 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5406 /* File type is "TEXT" */
5407 FILE_TYPE(FILE_TYPE_TEXT);
5409 /* Append to the file */
5410 fff = my_fopen(buf, "w");
5415 /* Hack -- grab permissions */
5418 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5420 msg_format("Failed to open file %s.", buf);
5427 /* Save the screen */
5431 /* Dump the screen */
5432 for (y = 0; y < 24; y++)
5435 for (x = 0; x < 79; x++)
5437 /* Get the attr/char */
5438 (void)(Term_what(x, y, &a, &c));
5448 fprintf(fff, "%s\n", buf);
5455 /* Dump the screen */
5456 for (y = 0; y < 24; y++)
5459 for (x = 0; x < 79; x++)
5461 /* Get the attr/char */
5462 (void)(Term_what(x, y, &a, &c));
5465 buf[x] = hack[a&0x0F];
5472 fprintf(fff, "%s\n", buf);
5482 /* Hack -- grab permissions */
5487 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5489 msg_print("Screen dump saved.");
5495 /* Restore the screen */
5499 if (old_use_graphics)
5501 use_graphics = TRUE;
5504 /* Redraw everything */
5505 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
5507 /* Hack -- update */
5514 * Sorting hook -- Comp function -- see below
5516 * We use "u" to point to array of monster indexes,
5517 * and "v" to select the type of sorting to perform on "u".
5519 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5521 u16b *who = (u16b*)(u);
5523 u16b *why = (u16b*)(v);
5531 /* Sort by total kills */
5534 /* Extract total kills */
5535 z1 = a_info[w1].tval;
5536 z2 = a_info[w2].tval;
5538 /* Compare total kills */
5539 if (z1 < z2) return (TRUE);
5540 if (z1 > z2) return (FALSE);
5544 /* Sort by monster level */
5547 /* Extract levels */
5548 z1 = a_info[w1].sval;
5549 z2 = a_info[w2].sval;
5551 /* Compare levels */
5552 if (z1 < z2) return (TRUE);
5553 if (z1 > z2) return (FALSE);
5557 /* Sort by monster experience */
5560 /* Extract experience */
5561 z1 = a_info[w1].level;
5562 z2 = a_info[w2].level;
5564 /* Compare experience */
5565 if (z1 < z2) return (TRUE);
5566 if (z1 > z2) return (FALSE);
5570 /* Compare indexes */
5576 * Sorting hook -- Swap function -- see below
5578 * We use "u" to point to array of monster indexes,
5579 * and "v" to select the type of sorting to perform.
5581 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5583 u16b *who = (u16b*)(u);
5595 * Check the status of "artifacts"
5597 void do_cmd_knowledge_artifacts(void)
5599 int i, k, z, x, y, n = 0;
5605 char file_name[1024];
5607 char base_name[MAX_NLEN];
5611 /* Open a new file */
5612 fff = my_fopen_temp(file_name, 1024);
5616 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5618 msg_format("Failed to create temporary file %s.", file_name);
5624 /* Allocate the "who" array */
5625 C_MAKE(who, max_r_idx, s16b);
5627 /* Allocate the "okay" array */
5628 C_MAKE(okay, max_a_idx, bool);
5630 /* Scan the artifacts */
5631 for (k = 0; k < max_a_idx; k++)
5633 artifact_type *a_ptr = &a_info[k];
5638 /* Skip "empty" artifacts */
5639 if (!a_ptr->name) continue;
5641 /* Skip "uncreated" artifacts */
5642 if (!a_ptr->cur_num) continue;
5648 /* Check the dungeon */
5649 for (y = 0; y < cur_hgt; y++)
5651 for (x = 0; x < cur_wid; x++)
5653 cave_type *c_ptr = &cave[y][x];
5655 s16b this_o_idx, next_o_idx = 0;
5657 /* Scan all objects in the grid */
5658 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5662 /* Acquire object */
5663 o_ptr = &o_list[this_o_idx];
5665 /* Acquire next object */
5666 next_o_idx = o_ptr->next_o_idx;
5668 /* Ignore non-artifacts */
5669 if (!artifact_p(o_ptr)) continue;
5671 /* Ignore known items */
5672 if (object_known_p(o_ptr)) continue;
5674 /* Note the artifact */
5675 okay[o_ptr->name1] = FALSE;
5680 /* Check the inventory and equipment */
5681 for (i = 0; i < INVEN_TOTAL; i++)
5683 object_type *o_ptr = &inventory[i];
5685 /* Ignore non-objects */
5686 if (!o_ptr->k_idx) continue;
5688 /* Ignore non-artifacts */
5689 if (!artifact_p(o_ptr)) continue;
5691 /* Ignore known items */
5692 if (object_known_p(o_ptr)) continue;
5694 /* Note the artifact */
5695 okay[o_ptr->name1] = FALSE;
5698 for (k = 0; k < max_a_idx; k++)
5700 if (okay[k]) who[n++] = k;
5703 /* Select the sort method */
5704 ang_sort_comp = ang_sort_art_comp;
5705 ang_sort_swap = ang_sort_art_swap;
5707 /* Sort the array by dungeon depth of monsters */
5708 ang_sort(who, &why, n);
5710 /* Scan the artifacts */
5711 for (k = 0; k < n; k++)
5713 artifact_type *a_ptr = &a_info[who[k]];
5717 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5719 strcpy(base_name, "Unknown Artifact");
5723 /* Obtain the base object type */
5724 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5732 /* Get local object */
5735 /* Create fake object */
5736 object_prep(q_ptr, z);
5738 /* Make it an artifact */
5739 q_ptr->name1 = (byte)who[k];
5741 /* Describe the artifact */
5742 object_desc_store(base_name, q_ptr, FALSE, 0);
5745 /* Hack -- Build the artifact name */
5747 fprintf(fff, " %s\n", base_name);
5749 fprintf(fff, " The %s\n", base_name);
5754 /* Free the "who" array */
5755 C_KILL(who, max_r_idx, s16b);
5757 /* Free the "okay" array */
5758 C_KILL(okay, max_a_idx, bool);
5760 /* Close the file */
5763 /* Display the file contents */
5765 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5767 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5771 /* Remove the file */
5777 * Display known uniques
5779 static void do_cmd_knowledge_uniques(void)
5787 char file_name[1024];
5789 /* Open a new file */
5790 fff = my_fopen_temp(file_name, 1024);
5794 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5796 msg_format("Failed to create temporary file %s.", file_name);
5802 /* Allocate the "who" array */
5803 C_MAKE(who, max_r_idx, s16b);
5805 /* Scan the monsters */
5806 for (i = 1; i < max_r_idx; i++)
5808 monster_race *r_ptr = &r_info[i];
5810 /* Use that monster */
5811 if (r_ptr->name) who[n++] = i;
5814 /* Select the sort method */
5815 ang_sort_comp = ang_sort_comp_hook;
5816 ang_sort_swap = ang_sort_swap_hook;
5818 /* Sort the array by dungeon depth of monsters */
5819 ang_sort(who, &why, n);
5821 /* Scan the monster races */
5822 for (k = 0; k < n; k++)
5824 monster_race *r_ptr = &r_info[who[k]];
5826 /* Only print Uniques */
5827 if (r_ptr->flags1 & (RF1_UNIQUE))
5829 bool dead = (r_ptr->max_num == 0);
5833 /* Only display "known" uniques */
5834 if (dead || cheat_know || r_ptr->r_sights)
5836 /* Print a message */
5838 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5839 (r_name + r_ptr->name));
5841 fprintf(fff, " %s is alive\n",
5842 (r_name + r_ptr->name));
5849 /* Free the "who" array */
5850 C_KILL(who, max_r_idx, s16b);
5852 /* Close the file */
5855 /* Display the file contents */
5857 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5859 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5863 /* Remove the file */
5869 * Display dead uniques
5871 static void do_cmd_knowledge_uniques_dead(void)
5879 char file_name[1024];
5881 /* Open a new file */
5882 fff = my_fopen_temp(file_name, 1024);
5886 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5888 msg_format("Failed to create temporary file %s.", file_name);
5894 /* Allocate the "who" array */
5895 C_MAKE(who, max_r_idx, s16b);
5897 /* Scan the monsters */
5898 for (i = 1; i < max_r_idx; i++)
5900 monster_race *r_ptr = &r_info[i];
5902 /* Use that monster */
5903 if (r_ptr->name) who[n++] = i;
5906 /* Select the sort method */
5907 ang_sort_comp = ang_sort_comp_hook;
5908 ang_sort_swap = ang_sort_swap_hook;
5910 /* Sort the array by dungeon depth of monsters */
5911 ang_sort(who, &why, n);
5913 /* Scan the monster races */
5914 for (k = 0; k < n; k++)
5916 monster_race *r_ptr = &r_info[who[k]];
5918 /* Only print Uniques */
5919 if (r_ptr->flags1 & (RF1_UNIQUE))
5921 bool dead = (r_ptr->max_num == 0);
5923 if (!dead) continue;
5925 /* Only display "known" uniques */
5926 if (dead || cheat_know || r_ptr->r_sights)
5928 /* Print a message */
5930 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5931 (r_name + r_ptr->name));
5933 fprintf(fff, " %s is dead\n",
5934 (r_name + r_ptr->name));
5941 /* Free the "who" array */
5942 C_KILL(who, max_r_idx, s16b);
5944 /* Close the file */
5947 /* Display the file contents */
5949 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5951 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5955 /* Remove the file */
5961 * Display weapon-exp
5963 static void do_cmd_knowledge_weapon_exp(void)
5965 int i,j, num, shougou;
5969 char file_name[1024];
5972 /* Open a new file */
5973 fff = my_fopen_temp(file_name, 1024);
5976 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5978 msg_format("Failed to create temporary file %s.", file_name);
5984 for(i = 0; i < 5; i++)
5986 for (num = 0; num < 64; num++)
5988 for (j = 0; j < max_k_idx; j++)
5990 object_kind *k_ptr = &k_info[j];
5992 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
5994 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
5996 if(weapon_exp[4-i][num]<4000) shougou=0;
5997 else if(weapon_exp[4-i][num]<6000) shougou=1;
5998 else if(weapon_exp[4-i][num]<7000) shougou=2;
5999 else if(weapon_exp[4-i][num]<8000) shougou=3;
6002 fprintf(fff,"%-25s ",tmp);
6003 if (weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
6004 else fprintf(fff," ");
6005 fprintf(fff,"%s",shougou_moji[shougou]);
6006 if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
6014 /* Close the file */
6017 /* Display the file contents */
6019 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
6021 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
6025 /* Remove the file */
6033 static void do_cmd_knowledge_spell_exp(void)
6040 char file_name[1024];
6042 /* Open a new file */
6043 fff = my_fopen_temp(file_name, 1024);
6046 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6048 msg_format("Failed to create temporary file %s.", file_name);
6054 if(p_ptr->realm1 != REALM_NONE)
6057 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
6059 fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
6061 for (i = 0; i < 32; i++)
6063 if (!is_magic(p_ptr->realm1))
6065 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC - 1][i];
6069 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
6071 if(s_ptr->slevel == 99) continue;
6072 if(spell_exp[i]<900) shougou=0;
6073 else if(spell_exp[i]<1200) shougou=1;
6074 else if(spell_exp[i]<1400) shougou=2;
6075 else if(spell_exp[i]<1600) shougou=3;
6077 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
6078 if (p_ptr->realm1 == REALM_HISSATSU)
6079 fprintf(fff,"[--]");
6082 if (shougou == 4) fprintf(fff,"!");
6083 else fprintf(fff," ");
6084 fprintf(fff,"%s",shougou_moji[shougou]);
6086 if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
6091 if(p_ptr->realm2 != REALM_NONE)
6093 fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
6094 for (i = 0; i < 32; i++)
6096 if (!is_magic(p_ptr->realm1))
6098 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC - 1][i];
6102 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
6104 if(s_ptr->slevel == 99) continue;
6106 if(spell_exp[i+32]<900) shougou=0;
6107 else if(spell_exp[i+32]<1200) shougou=1;
6108 else if(spell_exp[i+32]<1400) shougou=2;
6110 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
6111 if (shougou == 3) fprintf(fff,"!");
6112 else fprintf(fff," ");
6113 fprintf(fff,"%s",shougou_moji[shougou]);
6114 if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
6119 /* Close the file */
6122 /* Display the file contents */
6124 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
6126 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
6130 /* Remove the file */
6138 static void do_cmd_knowledge_skill_exp(void)
6144 char file_name[1024];
6146 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
6148 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
6151 /* Open a new file */
6152 fff = my_fopen_temp(file_name, 1024);
6155 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6157 msg_format("Failed to create temporary file %s.", file_name);
6163 for (i = 0; i < 3; i++)
6165 if(i == GINOU_RIDING)
6167 if(skill_exp[i]<500) shougou=0;
6168 else if(skill_exp[i]<2000) shougou=1;
6169 else if(skill_exp[i]<5000) shougou=2;
6170 else if(skill_exp[i]<8000) shougou=3;
6175 if(skill_exp[i]<4000) shougou=0;
6176 else if(skill_exp[i]<6000) shougou=1;
6177 else if(skill_exp[i]<7000) shougou=2;
6178 else if(skill_exp[i]<8000) shougou=3;
6181 fprintf(fff,"%-20s ",skill_name[i]);
6182 if (skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
6183 else fprintf(fff," ");
6184 fprintf(fff,"%s",shougou_moji[shougou]);
6185 if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
6189 /* Close the file */
6192 /* Display the file contents */
6194 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
6196 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
6200 /* Remove the file */
6206 * Pluralize a monster name
6208 void plural_aux(char *Name)
6210 int NameLen = strlen(Name);
6212 if (strstr(Name, "Disembodied hand"))
6214 strcpy(Name, "Disembodied hands that strangled people");
6216 else if (strstr(Name, "Colour out of space"))
6218 strcpy(Name, "Colours out of space");
6220 else if (strstr(Name, "stairway to hell"))
6222 strcpy(Name, "stairways to hell");
6224 else if (strstr(Name, "Dweller on the threshold"))
6226 strcpy(Name, "Dwellers on the threshold");
6228 else if (strstr(Name, " of "))
6230 cptr aider = strstr(Name, " of ");
6241 if (dummy[i-1] == 's')
6243 strcpy(&(dummy[i]), "es");
6248 strcpy(&(dummy[i]), "s");
6251 strcpy(&(dummy[i+1]), aider);
6252 strcpy(Name, dummy);
6254 else if (strstr(Name, "coins"))
6257 strcpy(dummy, "piles of ");
6258 strcat(dummy, Name);
6259 strcpy(Name, dummy);
6262 else if (strstr(Name, "Manes"))
6266 else if (streq(&(Name[NameLen - 2]), "ey"))
6268 strcpy(&(Name[NameLen - 2]), "eys");
6270 else if (Name[NameLen - 1] == 'y')
6272 strcpy(&(Name[NameLen - 1]), "ies");
6274 else if (streq(&(Name[NameLen - 4]), "ouse"))
6276 strcpy(&(Name[NameLen - 4]), "ice");
6278 else if (streq(&(Name[NameLen - 2]), "us"))
6280 strcpy(&(Name[NameLen - 2]), "i");
6282 else if (streq(&(Name[NameLen - 6]), "kelman"))
6284 strcpy(&(Name[NameLen - 6]), "kelmen");
6286 else if (streq(&(Name[NameLen - 8]), "wordsman"))
6288 strcpy(&(Name[NameLen - 8]), "wordsmen");
6290 else if (streq(&(Name[NameLen - 7]), "oodsman"))
6292 strcpy(&(Name[NameLen - 7]), "oodsmen");
6294 else if (streq(&(Name[NameLen - 7]), "eastman"))
6296 strcpy(&(Name[NameLen - 7]), "eastmen");
6298 else if (streq(&(Name[NameLen - 8]), "izardman"))
6300 strcpy(&(Name[NameLen - 8]), "izardmen");
6302 else if (streq(&(Name[NameLen - 5]), "geist"))
6304 strcpy(&(Name[NameLen - 5]), "geister");
6306 else if (streq(&(Name[NameLen - 2]), "ex"))
6308 strcpy(&(Name[NameLen - 2]), "ices");
6310 else if (streq(&(Name[NameLen - 2]), "lf"))
6312 strcpy(&(Name[NameLen - 2]), "lves");
6314 else if (suffix(Name, "ch") ||
6315 suffix(Name, "sh") ||
6316 suffix(Name, "nx") ||
6317 suffix(Name, "s") ||
6320 strcpy(&(Name[NameLen]), "es");
6324 strcpy(&(Name[NameLen]), "s");
6329 * Display current pets
6331 static void do_cmd_knowledge_pets(void)
6335 monster_type *m_ptr;
6337 int show_upkeep = 0;
6338 char file_name[1024];
6341 /* Open a new file */
6342 fff = my_fopen_temp(file_name, 1024);
6345 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6347 msg_format("Failed to create temporary file %s.", file_name);
6353 /* Process the monsters (backwards) */
6354 for (i = m_max - 1; i >= 1; i--)
6356 monster_race *r_ptr;
6357 /* Access the monster */
6360 /* Ignore "dead" monsters */
6361 if (!m_ptr->r_idx) continue;
6362 r_ptr = &r_info[m_ptr->r_idx];
6364 /* Calculate "upkeep" for pets */
6369 monster_desc(pet_name, m_ptr, 0x88);
6370 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6371 if (p_ptr->riding == i)
6373 fprintf(fff, " ¾èÇÏÃæ");
6375 fprintf(fff, " Riding");
6381 show_upkeep = calculate_upkeep();
6383 fprintf(fff, "----------------------------------------------\n");
6385 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6386 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6388 fprintf(fff, " Total: %d pet%s.\n",
6389 t_friends, (t_friends == 1 ? "" : "s"));
6390 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6395 /* Close the file */
6398 /* Display the file contents */
6400 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6402 show_file(TRUE, file_name, "Current Pets", 0, 0);
6406 /* Remove the file */
6414 * Note that the player ghosts are ignored. XXX XXX XXX
6416 static void do_cmd_knowledge_kill_count(void)
6424 char file_name[1024];
6429 /* Open a new file */
6430 fff = my_fopen_temp(file_name, 1024);
6434 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6436 msg_format("Failed to create temporary file %s.", file_name);
6442 /* Allocate the "who" array */
6443 C_MAKE(who, max_r_idx, s16b);
6446 /* Monsters slain */
6449 for (kk = 1; kk < max_r_idx; kk++)
6451 monster_race *r_ptr = &r_info[kk];
6453 if (r_ptr->flags1 & (RF1_UNIQUE))
6455 bool dead = (r_ptr->max_num == 0);
6464 s16b This = r_ptr->r_pkills;
6475 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6477 fprintf(fff,"You have defeated no enemies yet.\n\n");
6480 else if (Total == 1)
6482 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6484 fprintf(fff,"You have defeated one enemy.\n\n");
6489 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6491 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6498 /* Scan the monsters */
6499 for (i = 1; i < max_r_idx; i++)
6501 monster_race *r_ptr = &r_info[i];
6503 /* Use that monster */
6504 if (r_ptr->name) who[n++] = i;
6507 /* Select the sort method */
6508 ang_sort_comp = ang_sort_comp_hook;
6509 ang_sort_swap = ang_sort_swap_hook;
6511 /* Sort the array by dungeon depth of monsters */
6512 ang_sort(who, &why, n);
6514 /* Scan the monster races */
6515 for (k = 0; k < n; k++)
6517 monster_race *r_ptr = &r_info[who[k]];
6519 if (r_ptr->flags1 & (RF1_UNIQUE))
6521 bool dead = (r_ptr->max_num == 0);
6525 /* Print a message */
6526 fprintf(fff, " %s\n",
6527 (r_name + r_ptr->name));
6533 s16b This = r_ptr->r_pkills;
6538 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6539 if(strchr("pt",r_ptr->d_char))
6540 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6542 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6546 if (strstr(r_name + r_ptr->name, "coins"))
6548 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6552 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6558 strcpy(ToPlural, (r_name + r_ptr->name));
6559 plural_aux(ToPlural);
6560 fprintf(fff, " %d %s\n", This, ToPlural);
6570 fprintf(fff,"----------------------------------------------\n");
6572 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6574 fprintf(fff," Total: %lu creature%s killed.\n",
6575 Total, (Total == 1 ? "" : "s"));
6579 /* Free the "who" array */
6580 C_KILL(who, max_r_idx, s16b);
6582 /* Close the file */
6585 /* Display the file contents */
6587 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6589 show_file(TRUE, file_name, "Kill Count", 0, 0);
6593 /* Remove the file */
6599 * Display known objects
6601 static void do_cmd_knowledge_objects(void)
6607 char o_name[MAX_NLEN];
6609 char file_name[1024];
6612 /* Open a new file */
6613 fff = my_fopen_temp(file_name, 1024);
6616 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6618 msg_format("Failed to create temporary file %s.", file_name);
6624 /* Scan the object kinds */
6625 for (k = 1; k < max_k_idx; k++)
6627 object_kind *k_ptr = &k_info[k];
6629 /* Hack -- skip artifacts */
6630 if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
6632 /* List known flavored objects */
6633 if (k_ptr->flavor && k_ptr->aware)
6636 object_type object_type_body;
6638 /* Get local object */
6639 i_ptr = &object_type_body;
6641 /* Create fake object */
6642 object_prep(i_ptr, k);
6644 /* Describe the object */
6645 object_desc_store(o_name, i_ptr, FALSE, 0);
6647 /* Print a message */
6648 fprintf(fff, " %s\n", o_name);
6652 /* Close the file */
6655 /* Display the file contents */
6657 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6659 show_file(TRUE, file_name, "Known Objects", 0, 0);
6663 /* Remove the file */
6669 * List virtues & status
6672 void do_cmd_knowledge_kubi(void)
6677 char file_name[1024];
6680 /* Open a new file */
6681 fff = my_fopen_temp(file_name, 1024);
6684 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6686 msg_format("Failed to create temporary file %s.", file_name);
6695 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6697 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6699 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6701 fprintf(fff, "List of wanted monsters\n");
6703 for (i = 0; i < MAX_KUBI; i++)
6705 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6706 if (kubi_r_idx[i] > 10000)
6708 fprintf(fff, "ºÑ\n");
6710 fprintf(fff, "done\n");
6713 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6717 /* Close the file */
6720 /* Display the file contents */
6722 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6724 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6728 /* Remove the file */
6733 * List virtues & status
6736 void do_cmd_knowledge_virtues(void)
6740 char file_name[1024];
6743 /* Open a new file */
6744 fff = my_fopen_temp(file_name, 1024);
6747 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6749 msg_format("Failed to create temporary file %s.", file_name);
6758 fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
6760 fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
6765 /* Close the file */
6768 /* Display the file contents */
6770 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6772 show_file(TRUE, file_name, "Virtues", 0, 0);
6776 /* Remove the file */
6784 void do_cmd_knowledge_dungeon(void)
6788 char file_name[1024];
6792 /* Open a new file */
6793 fff = my_fopen_temp(file_name, 1024);
6796 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6798 msg_format("Failed to create temporary file %s.", file_name);
6806 for (i = 1; i < max_d_idx; i++)
6810 if (!d_info[i].maxdepth) continue;
6811 if (!max_dlv[i]) continue;
6812 if (d_info[i].final_guardian)
6814 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6816 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6818 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6820 fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6825 /* Close the file */
6828 /* Display the file contents */
6830 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6832 show_file(TRUE, file_name, "Dungeon", 0, 0);
6836 /* Remove the file */
6841 * List virtues & status
6844 static void do_cmd_knowledge_stat(void)
6848 char file_name[1024];
6851 /* Open a new file */
6852 fff = my_fopen_temp(file_name, 1024);
6855 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6857 msg_format("Failed to create temporary file %s.", file_name);
6865 percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
6866 (2 * p_ptr->hitdie +
6867 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6870 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6871 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6872 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6874 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6875 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6876 fprintf(fff, "Limits of maximum stats\n\n");
6878 for (v_nr = 0; v_nr < 6; v_nr++)
6880 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);
6881 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6887 /* Close the file */
6890 /* Display the file contents */
6892 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6894 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6898 /* Remove the file */
6903 * Print quest status of all active quests
6905 static void do_cmd_knowledge_quests(void)
6908 char file_name[1024];
6910 char rand_tmp_str[120] = "\0";
6912 monster_race *r_ptr;
6914 int rand_level = 100;
6917 /* Open a new file */
6918 fff = my_fopen_temp(file_name, 1024);
6921 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6923 msg_format("Failed to create temporary file %s.", file_name);
6930 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6932 fprintf(fff, "< Current Quest >\n");
6935 for (i = 1; i < max_quests; i++)
6937 /* No info from "silent" quests */
6938 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6940 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6945 /* Clear the text */
6946 for (j = 0; j < 10; j++)
6948 quest_text[j][0] = '\0';
6951 quest_text_line = 0;
6955 /* Set the quest number temporary */
6956 old_quest = p_ptr->inside_quest;
6957 p_ptr->inside_quest = i;
6959 /* Get the quest text */
6960 init_flags = INIT_SHOW_TEXT;
6962 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6964 /* Reset the old quest number */
6965 p_ptr->inside_quest = old_quest;
6967 if (quest[i].type != QUEST_TYPE_RANDOM)
6969 char note[80] = "\0";
6971 if (quest[i].status == QUEST_STATUS_TAKEN)
6973 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6975 r_ptr = &r_info[quest[i].r_idx];
6976 strcpy(name, r_name + r_ptr->name);
6977 if (quest[i].max_num > 1)
6980 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6983 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
6988 sprintf(note," - %s¤òÅݤ¹¡£",name);
6990 sprintf(note," - kill %s.",name);
6993 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
6996 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
6998 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
7001 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
7003 strcpy(name, a_name + a_info[quest[i].k_idx].name);
7005 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
7007 sprintf(note," - Find out %s.", name);
7010 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
7012 sprintf(note," - õº÷¤¹¤ë¡£");
7014 sprintf(note," - Search.");
7016 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
7018 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
7020 sprintf(note," - Kill all monsters.");
7024 /* Print the quest info */
7026 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
7028 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
7031 quest[i].name, quest[i].level, note);
7033 fprintf(fff, tmp_str);
7035 if (quest[i].status == QUEST_STATUS_COMPLETED)
7038 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
7040 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
7044 fprintf(fff, tmp_str);
7050 while (quest_text[j][0] && j < 10)
7052 fprintf(fff, " %s\n", quest_text[j]);
7057 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
7058 (quest[i].level < rand_level))
7061 rand_level = quest[i].level;
7063 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
7065 /* Print the quest info */
7066 r_ptr = &r_info[quest[i].r_idx];
7067 strcpy(name, r_name + r_ptr->name);
7069 if (quest[i].max_num > 1)
7072 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
7073 quest[i].name, quest[i].level,
7074 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
7078 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
7079 quest[i].name, quest[i].level,
7080 quest[i].max_num, name, quest[i].cur_num);
7087 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
7089 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
7092 quest[i].name, quest[i].level, name);
7099 /* Print the current random quest */
7100 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
7103 if (!total) fprintf(fff, "¤Ê¤·\n");
7105 if (!total) fprintf(fff, "Nothing.\n");
7109 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7111 fprintf(fff, "\n< Completed Quest >\n");
7114 for (i = 1; i < max_quests; i++)
7116 /* No info from "silent" quests */
7117 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7119 if (quest[i].status == QUEST_STATUS_FINISHED)
7125 if (i < MIN_RANDOM_QUEST)
7127 /* Set the quest number temporary */
7128 old_quest = p_ptr->inside_quest;
7129 p_ptr->inside_quest = i;
7132 init_flags = INIT_ASSIGN;
7134 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7136 /* Reset the old quest number */
7137 p_ptr->inside_quest = old_quest;
7140 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7142 /* Print the quest info */
7144 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7146 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7149 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7153 /* Print the quest info */
7155 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7157 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7160 quest[i].name, quest[i].level, quest[i].complev);
7163 fprintf(fff, tmp_str);
7167 if (!total) fprintf(fff, "¤Ê¤·\n");
7169 if (!total) fprintf(fff, "Nothing.\n");
7173 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
7175 fprintf(fff, "\n< Failed Quest >\n");
7178 for (i = 1; i < max_quests; i++)
7180 /* No info from "silent" quests */
7181 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7183 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
7189 if (i < MIN_RANDOM_QUEST)
7191 /* Set the quest number temporary */
7192 old_quest = p_ptr->inside_quest;
7193 p_ptr->inside_quest = i;
7195 /* Get the quest text */
7196 init_flags = INIT_ASSIGN;
7198 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
7200 /* Reset the old quest number */
7201 p_ptr->inside_quest = old_quest;
7204 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
7206 /* Print the quest info */
7208 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
7210 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
7213 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
7217 /* Print the quest info */
7219 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
7221 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
7224 quest[i].name, quest[i].level, quest[i].complev);
7226 fprintf(fff, tmp_str);
7230 if (!total) fprintf(fff, "¤Ê¤·\n");
7232 if (!total) fprintf(fff, "Nothing.\n");
7237 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
7239 fprintf(fff, "\n< Remaining Random Quest >\n");
7242 for (i = 1; i < max_quests; i++)
7244 /* No info from "silent" quests */
7245 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
7247 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
7251 /* Print the quest info */
7253 sprintf(tmp_str, "%s (%d³¬, %s)\n",
7255 sprintf(tmp_str, "%s (%d, %s)\n",
7258 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
7259 fprintf(fff, tmp_str);
7263 if (!total) fprintf(fff, "¤Ê¤·\n");
7265 if (!total) fprintf(fff, "Nothing.\n");
7269 /* Close the file */
7272 /* Display the file contents */
7274 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
7276 show_file(TRUE, file_name, "Quest status", 0, 0);
7280 /* Remove the file */
7290 void do_cmd_knowledge_home(void)
7295 char file_name[1024];
7297 char o_name[MAX_NLEN];
7300 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7302 /* Open a new file */
7303 fff = my_fopen_temp(file_name, 1024);
7306 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7308 msg_format("Failed to create temporary file %s.", file_name);
7316 /* Print all homes in the different towns */
7317 st_ptr = &town[1].store[STORE_HOME];
7319 /* Home -- if anything there */
7320 if (st_ptr->stock_num)
7322 /* Header with name of the town */
7324 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7326 fprintf(fff, " [Home Inventory]\n");
7330 /* Dump all available items */
7331 for (i = 0; i < st_ptr->stock_num; i++)
7334 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7335 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7336 if (strlen(o_name) <= 80-3)
7338 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7344 for (n = 0, t = o_name; n < 80-3; n++, t++)
7345 if(iskanji(*t)) {t++; n++;}
7346 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7348 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7349 fprintf(fff, " %.77s\n", o_name+n);
7352 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7353 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7358 /* Add an empty line */
7359 fprintf(fff, "\n\n");
7363 /* Close the file */
7366 /* Display the file contents */
7368 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7370 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7374 /* Remove the file */
7380 * Check the status of "autopick"
7382 static void do_cmd_knowledge_autopick(void)
7386 char file_name[1024];
7388 /* Open a new file */
7389 fff = my_fopen_temp(file_name, 1024);
7394 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7396 msg_format("Failed to create temporary file %s.", file_name);
7405 fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
7407 fprintf(fff, "No preference for auto picker/destroyer.");
7413 fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
7415 fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
7419 for (k = 0; k < max_autopick; k++)
7422 byte act = autopick_action[k];
7423 if (act & DONT_AUTOPICK)
7431 else if (act & DO_AUTODESTROY)
7448 if (act & DO_DISPLAY)
7449 fprintf(fff, "%11s", format("[%s]", tmp));
7451 fprintf(fff, "%11s", format("(%s)", tmp));
7453 fprintf(fff, " %s", autopick_name[k]);
7454 if(autopick_insc[k] != NULL)
7455 fprintf(fff, " {%s}", autopick_insc[k]);
7458 /* Close the file */
7460 /* Display the file contents */
7462 show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
7464 show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
7467 /* Remove the file */
7474 * Interact with "knowledge"
7476 void do_cmd_knowledge(void)
7479 /* File type is "TEXT" */
7480 FILE_TYPE(FILE_TYPE_TEXT);
7481 /* Save the screen */
7483 /* Interact until done */
7488 /* Ask for a choice */
7490 prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
7491 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
7493 prt(format("page %d/2", (p+1)), 2, 65);
7494 prt("Display current knowledge", 3, 0);
7497 /* Give some choices */
7500 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
7501 prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7502 prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
7503 prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
7504 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
7505 prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
7506 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
7507 prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
7508 prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
7510 prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
7511 prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
7512 prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
7513 prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
7514 prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
7515 prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
7516 prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
7517 prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
7518 prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
7522 prt("(1) Display known artifacts", 6, 5);
7523 prt("(2) Display known objects", 7, 5);
7524 prt("(3) Display remaining uniques", 8, 5);
7525 prt("(4) Display dead uniques", 9, 5);
7526 prt("(5) Display kill count", 10, 5);
7527 prt("(6) Display wanted monsters", 11, 5);
7528 prt("(7) Display current pets", 12, 5);
7529 prt("(8) Display home inventory", 13, 5);
7530 prt("(9) Display *identified* equip.", 14, 5);
7532 prt("(a) Display about yourself", 6, 5);
7533 prt("(b) Display mutations", 7, 5);
7534 prt("(c) Display weapon proficiency", 8, 5);
7535 prt("(d) Display spell proficiency", 9, 5);
7536 prt("(e) Display misc. proficiency", 10, 5);
7537 prt("(f) Display virtues", 11, 5);
7538 prt("(g) Display dungeons", 12, 5);
7539 prt("(h) Display current quests", 13, 5);
7540 prt("(i) Display auto pick/destroy", 14, 5);
7545 prt("-³¤¯-", 16, 8);
7546 prt("ESC) È´¤±¤ë", 21, 1);
7547 prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
7548 /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
7549 prt("¥³¥Þ¥ó¥É:", 20, 0);
7551 prt("-more-", 16, 8);
7552 prt("ESC) Exit menu", 21, 1);
7553 prt("SPACE) Next page", 21, 30);
7554 /*prt("-) Previous page", 21, 60);*/
7555 prt("Command: ", 20, 0);
7561 if (i == ESCAPE) break;
7564 case ' ': /* Page change */
7568 case '1': /* Artifacts */
7569 do_cmd_knowledge_artifacts();
7571 case '2': /* Objects */
7572 do_cmd_knowledge_objects();
7574 case '3': /* Uniques */
7575 do_cmd_knowledge_uniques();
7577 case '4': /* Uniques */
7578 do_cmd_knowledge_uniques_dead();
7580 case '5': /* Kill count */
7581 do_cmd_knowledge_kill_count();
7583 case '6': /* wanted */
7584 do_cmd_knowledge_kubi();
7586 case '7': /* Pets */
7587 do_cmd_knowledge_pets();
7589 case '8': /* Home */
7590 do_cmd_knowledge_home();
7592 case '9': /* Resist list */
7593 do_cmd_knowledge_inven();
7596 case 'a': /* Max stat */
7597 do_cmd_knowledge_stat();
7599 case 'b': /* Mutations */
7600 do_cmd_knowledge_mutations();
7602 case 'c': /* weapon-exp */
7603 do_cmd_knowledge_weapon_exp();
7605 case 'd': /* spell-exp */
7606 do_cmd_knowledge_spell_exp();
7608 case 'e': /* skill-exp */
7609 do_cmd_knowledge_skill_exp();
7611 case 'f': /* Virtues */
7612 do_cmd_knowledge_virtues();
7614 case 'g': /* Dungeon */
7615 do_cmd_knowledge_dungeon();
7617 case 'h': /* Quests */
7618 do_cmd_knowledge_quests();
7620 case 'i': /* Autopick */
7621 do_cmd_knowledge_autopick();
7623 default: /* Unknown option */
7626 /* Flush messages */
7629 /* Restore the screen */
7635 * Check on the status of an active quest
7637 void do_cmd_checkquest(void)
7639 /* File type is "TEXT" */
7640 FILE_TYPE(FILE_TYPE_TEXT);
7642 /* Save the screen */
7646 do_cmd_knowledge_quests();
7648 /* Restore the screen */
7654 * Display the time and date
7656 void do_cmd_time(void)
7658 int day, hour, min, full, start, end, num;
7665 s32b len = 20L * TOWN_DAWN;
7666 s32b tick = turn % len + len / 4;
7668 if ((p_ptr->prace == RACE_VAMPIRE) ||
7669 (p_ptr->prace == RACE_SKELETON) ||
7670 (p_ptr->prace == RACE_ZOMBIE) ||
7671 (p_ptr->prace == RACE_SPECTRE))
7672 day = (turn - (15L * TOWN_DAWN))/ len + 1;
7674 day = (turn + (5L * TOWN_DAWN))/ len + 1;
7675 hour = (24 * tick / len) % 24;
7676 min = (1440 * tick / len) % 60;
7677 full = hour * 100 + min;
7685 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7687 strcpy(desc, "It is a strange time.");
7693 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7695 msg_format("This is day %d. The time is %d:%02d %s.",
7698 day, (hour % 12 == 0) ? 12 : (hour % 12),
7699 min, (hour < 12) ? "AM" : "PM");
7702 if (!randint0(10) || p_ptr->image)
7705 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7707 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7714 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7716 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7721 /* Open this file */
7722 fff = my_fopen(buf, "rt");
7727 /* Find this time */
7728 while (!my_fgets(fff, buf, 1024))
7730 /* Ignore comments */
7731 if (!buf[0] || (buf[0] == '#')) continue;
7733 /* Ignore invalid lines */
7734 if (buf[1] != ':') continue;
7736 /* Process 'Start' */
7739 /* Extract the starting time */
7740 start = atoi(buf + 2);
7742 /* Assume valid for an hour */
7752 /* Extract the ending time */
7753 end = atoi(buf + 2);
7759 /* Ignore incorrect range */
7760 if ((start > full) || (full > end)) continue;
7762 /* Process 'Description' */
7767 /* Apply the randomizer */
7768 if (!randint0(num)) strcpy(desc, buf + 2);
7778 /* Close the file */