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.
15 errr do_cmd_write_nikki(int type, int num, cptr note)
24 s32b len = 20L * TOWN_DAWN;
25 s32b tick = turn % len + len / 4;
27 static bool disable_nikki = FALSE;
29 if (disable_nikki) return(-1);
31 if ((p_ptr->prace == RACE_VAMPIRE) ||
32 (p_ptr->prace == RACE_SKELETON) ||
33 (p_ptr->prace == RACE_ZOMBIE) ||
34 (p_ptr->prace == RACE_SPECTRE))
35 day = (turn - (15L * TOWN_DAWN))/ len + 1;
37 day = (turn + (5L * TOWN_DAWN))/ len + 1;
39 hour = (24 * tick / len) % 24;
40 min = (1440 * tick / len) % 60;
42 if (type == NIKKI_FIX_QUEST_C ||
43 type == NIKKI_FIX_QUEST_F ||
44 type == NIKKI_RAND_QUEST_C ||
45 type == NIKKI_RAND_QUEST_F ||
46 type == NIKKI_TO_QUEST)
50 old_quest = p_ptr->inside_quest;
51 p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
53 /* Get the quest text */
54 init_flags = INIT_ASSIGN;
56 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
58 /* Reset the old quest number */
59 p_ptr->inside_quest = old_quest;
63 sprintf(file_name,"playrecord-%s.txt",savefile_base);
65 /* different filne name to avoid mixing */
66 sprintf(file_name,"playrec-%s.txt",savefile_base);
69 /* Build the filename */
70 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
72 /* File type is "TEXT" */
73 FILE_TYPE(FILE_TYPE_TEXT);
75 fff = my_fopen(buf, "a");
80 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
82 msg_format("Failed to open %s. Play-Record is disabled temporally.", buf);
91 if (p_ptr->inside_arena)
93 note_level = "¥¢¥ê¡¼¥Ê:";
95 note_level = "Arane:";
101 note_level = "Surface:";
103 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)))
105 note_level = "¥¯¥¨¥¹¥È:";
107 note_level = "Quest:";
111 note_level = format("%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name);
113 note_level = format("%s L%d:", d_name+d_info[dungeon_type].name, dun_level);
122 fprintf(fff, "%dÆüÌÜ\n",day);
124 fprintf(fff, "Day %d\n",day);
133 fprintf(fff, "%s\n",note);
137 fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
143 fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note);
145 fprintf(fff, " %2d:%02d %20s discover %s.\n", hour, min, note_level, note);
152 fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note);
154 fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note);
158 case NIKKI_FIX_QUEST_C:
160 if (quest[num].flags & QUEST_FLAG_SILENT) break;
162 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
164 fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name);
168 case NIKKI_FIX_QUEST_F:
170 if (quest[num].flags & QUEST_FLAG_SILENT) break;
172 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name);
174 fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name);
178 case NIKKI_RAND_QUEST_C:
181 strcpy(name, r_name+r_info[quest[num].r_idx].name);
183 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name);
185 fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name);
189 case NIKKI_RAND_QUEST_F:
192 strcpy(name, r_name+r_info[quest[num].r_idx].name);
194 fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name);
196 fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name);
200 case NIKKI_MAXDEAPTH:
203 fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num);
205 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);
212 fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]);
214 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);
221 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
232 if (!(dun_level+num)) to = "ÃϾå";
233 else to = format("%d³¬", dun_level+num);
235 if (!(dun_level+num)) to = "the surfice";
236 else to = format("level %d", dun_level+num);
241 fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note);
243 fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to);
251 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]);
253 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);
257 fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level);
259 fprintf(fff, " %2d:%02d %20s recall from dungeon to surface.\n", hour, min, note_level);
265 if (quest[num].flags & QUEST_FLAG_SILENT) break;
267 fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name);
269 fprintf(fff, " %2d:%02d %20s enter quest '%s'.\n", hour, min, note_level, quest[num].name);
284 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)))
295 if (!(dun_level+num)) to = "ÃϾå";
296 else to = format("%d³¬", dun_level+num);
298 if (!(dun_level+num)) to = "surface";
299 else to = format("level %d", dun_level+num);
304 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
306 fprintf(fff, " %2d:%02d %20s teleport level to %s.\n", hour, min, note_level, to);
313 fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note);
315 fprintf(fff, " %2d:%02d %20s buy %s.\n", hour, min, note_level, note);
322 fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note);
324 fprintf(fff, " %2d:%02d %20s sell %s.\n", hour, min, note_level, note);
331 fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
333 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);
335 if (num == MAX_ARENA_MONS)
338 fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n");
340 fprintf(fff, " win all fight to become a Chanpion.\n");
349 fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note);
351 fprintf(fff, " %2d:%02d %20s identify %s.\n", hour, min, note_level, note);
366 to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name);
368 to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name);
372 fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to);
374 fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to);
381 fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num);
383 fprintf(fff, " %2d:%02d %20s reach player level %d.\n", hour, min, note_level, num);
387 case NIKKI_GAMESTART:
389 time_t ct = time((time_t*)0);
393 fprintf(fff, "%s %s",note, ctime(&ct));
396 fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
399 case NIKKI_NAMED_PET:
401 fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
406 fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note);
408 fprintf(fff, "decide to travel together with %s.\n", note);
413 fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note);
415 fprintf(fff, "unname %s.\n", note);
420 fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note);
422 fprintf(fff, "dismiss %s.\n", note);
427 fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note);
429 fprintf(fff, "%s die.\n", note);
434 fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note);
436 fprintf(fff, "move to other map leaving %s behind.\n", note);
441 fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note);
443 fprintf(fff, "lose sight of %s.\n", note);
448 fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note);
450 fprintf(fff, "%s is made disappeared by *destruction*.\n", note);
455 fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note);
457 fprintf(fff, "%s is crushed by falling rocks.\n", note);
472 if (do_level) write_level = FALSE;
478 #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0]))
480 static void do_cmd_disp_nikki(void)
482 char nikki_title[256];
487 static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ",
488 "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤",
499 "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä",
500 "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡",
501 "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í",
502 "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿",
507 "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤",
516 "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"};
518 static const char subtitle[][51] ={"Quest of The World's Toughest Body",
519 "Attack is the best form of defence.",
521 "An unexpected windfall",
522 "A drowning man will catch at a straw",
523 "Don't count your chickens before they are hatched.",
524 "It is no use crying over spilt milk.",
525 "Seeing is believing.",
526 "Strike the iron while it is hot.",
527 "I don't care what follows.",
528 "To dig a well to put out a house on fire.",
529 "Tomorrow is another day.",
530 "Easy come, easy go.",
531 "The more haste, the less speed.",
532 "Where there is life, there is hope.",
533 "There is no royal road to *WINNER*.",
534 "Danger past, God forgotten.",
535 "The best thing to do now is to run away.",
536 "Life is but an empty dream.",
537 "Dead men tell no tales.",
538 "A book that remains shut is but a block.",
539 "Misfortunes never come singly.",
540 "A little knowledge is a dangerous thing.",
541 "History repeats itself.",
542 "*WINNER* was not built in a day.",
543 "Ignorance is bliss.",
544 "To lose is to win?",
545 "No medicine can cure folly.",
546 "All good things come to an end.",
547 "M$ Empire strikes back.",
548 "To see is to believe",
550 "Quest of The World's Greatest Brain"};
553 sprintf(file_name,"playrecord-%s.txt",savefile_base);
555 sprintf(file_name,"playrec-%s.txt",savefile_base);
558 /* Build the filename */
559 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
561 if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
562 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)]);
563 else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
564 strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)+1]);
565 else strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-2)+1]);
568 sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
569 ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp);
571 sprintf(nikki_title, "Legend of %s %s '%s'",
572 ap_ptr->title, player_name, tmp);
575 /* Display the file contents */
576 show_file(FALSE, buf, nikki_title, -1, 0);
579 static void do_cmd_bunshou(void)
582 char bunshou[80] = "\0";
585 if (get_string("ÆâÍÆ: ", tmp, 79))
587 if (get_string("diary note: ", tmp, 79))
590 strcpy(bunshou, tmp);
592 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, bunshou);
596 static void do_cmd_last_get(void)
601 if (record_o_name[0] == '\0') return;
604 sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name);
606 sprintf(buf,"Do you really want to record getting %s? ",record_o_name);
608 if (!get_check(buf)) return;
613 sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name);
615 sprintf(buf,"descover %s.", record_o_name);
617 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
621 static void do_cmd_erase_nikki(void)
628 if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return;
630 if (!get_check("Do you really want to delete all your record? ")) return;
634 sprintf(file_name,"playrecord-%s.txt",savefile_base);
636 sprintf(file_name,"playrec-%s.txt",savefile_base);
639 /* Build the filename */
640 path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
642 /* Remove the file */
645 fff = my_fopen(buf, "w");
649 msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£");
651 msg_format("deleted record.");
655 msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf);
657 msg_format("failed to delete %s.", buf);
666 msg_format("%d %d %d:%d",py,px, p_ptr->energy, p_ptr->skill_dis);
672 void do_cmd_nikki(void)
676 /* File type is "TEXT" */
677 FILE_TYPE(FILE_TYPE_TEXT);
679 /* Save the screen */
682 /* Interact until done */
688 /* Ask for a choice */
690 prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0);
692 prt("[ Play Record ]", 2, 0);
696 /* Give some choices */
698 prt("(1) µÏ¿¤ò¸«¤ë", 4, 5);
699 prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5);
700 prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5);
701 prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5);
703 prt("(1) Display your record", 4, 5);
704 prt("(2) Add record", 5, 5);
705 prt("(3) Record item you last get/identify", 6, 5);
706 prt("(4) Delete your record", 7, 5);
712 prt("¥³¥Þ¥ó¥É:", 18, 0);
714 prt("Command: ", 18, 0);
722 if (i == ESCAPE) break;
736 do_cmd_erase_nikki();
743 default: /* Unknown option */
751 /* Restore the screen */
756 * Hack -- redraw the screen
758 * This command performs various low level updates, clears all the "extra"
759 * windows, does a total redraw of the main window, and requests all of the
760 * interesting updates and redraws that I can think of.
762 * This command is also used to "instantiate" the results of the user
763 * selecting various things, such as graphics mode, so it must call
764 * the "TERM_XTRA_REACT" hook before redrawing the windows.
766 void do_cmd_redraw(void)
773 /* Hack -- react to changes */
774 Term_xtra(TERM_XTRA_REACT, 0);
777 /* Combine and Reorder the pack (later) */
778 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
782 p_ptr->update |= (PU_TORCH);
785 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
787 /* Forget lite/view */
788 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
790 /* Update lite/view */
791 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
793 /* Update monsters */
794 p_ptr->update |= (PU_MONSTERS);
796 /* Redraw everything */
797 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
800 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
803 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
810 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
813 /* Redraw every window */
814 for (j = 0; j < 8; j++)
817 if (!angband_term[j]) continue;
820 Term_activate(angband_term[j]);
835 * Hack -- change name
837 void do_cmd_change_name(void)
846 /* Save the screen */
854 /* Display the player */
855 display_player(mode);
860 display_player(mode);
865 Term_putstr(2, 23, -1, TERM_WHITE,
866 "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]");
868 Term_putstr(2, 23, -1, TERM_WHITE,
869 "['c' to change name, 'f' to file, 'h' to change mode, or ESC]");
877 if (c == ESCAPE) break;
888 sprintf(tmp, "%s.txt", player_base);
890 if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
892 if (get_string("File name: ", tmp, 80))
896 if (tmp[0] && (tmp[0] != ' '))
898 file_character(tmp, TRUE);
919 /* Restore the screen */
922 /* Redraw everything */
923 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
930 * Recall the most recent message
932 void do_cmd_message_one(void)
934 /* Recall one message XXX XXX XXX */
935 prt(format("> %s", message_str(0)), 0, 0);
940 * Show previous messages to the user -BEN-
942 * The screen format uses line 0 and 23 for headers and prompts,
943 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
945 * This command shows you which commands you are viewing, and allows
946 * you to "search" for strings in the recall.
948 * Note that messages may be longer than 80 characters, but they are
949 * displayed using "infinite" length, with a special sub-command to
950 * "slide" the virtual display to the left or right.
952 * Attempt to only hilite the matching portions of the string.
954 void do_cmd_messages(int num_now)
973 /* Start on first message */
976 /* Start at leftmost edge */
979 /* Save the screen */
982 /* Process requests until done */
988 /* Dump up to 20 lines of messages */
989 for (j = 0; (j < 20) && (i + j < n); j++)
991 cptr msg = message_str(i+j);
993 /* Apply horizontal scroll */
994 msg = (strlen(msg) >= q) ? (msg + q) : "";
996 /* Dump the messages, bottom to top */
997 Term_putstr(0, 21-j, -1, (i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
999 /* Hilite "shower" */
1004 /* Display matches */
1005 while ((str = strstr(str, shower)) != NULL)
1007 int len = strlen(shower);
1009 /* Display the match */
1010 Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
1018 /* Display header XXX XXX XXX */
1021 prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)",
1022 i, i+j-1, n, q), 0, 0);
1024 prt(format("Message Recall (%d-%d of %d), Offset %d",
1025 i, i+j-1, n, q), 0, 0);
1029 /* Display prompt (not very informative) */
1031 prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", 23, 0);
1033 prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0);
1040 /* Exit on Escape */
1041 if (k == ESCAPE) break;
1043 /* Hack -- Save the old index */
1046 /* Horizontal scroll */
1050 q = (q >= 40) ? (q - 40) : 0;
1056 /* Horizontal scroll */
1066 /* Hack -- handle show */
1071 prt("¶¯Ä´: ", 23, 0);
1073 prt("Show: ", 23, 0);
1077 /* Get a "shower" string, or continue */
1078 if (!askfor_aux(shower, 80)) continue;
1084 /* Hack -- handle find */
1091 prt("¸¡º÷: ", 23, 0);
1093 prt("Find: ", 23, 0);
1097 /* Get a "finder" string, or continue */
1098 if (!askfor_aux(finder, 80)) continue;
1101 strcpy(shower, finder);
1104 for (z = i + 1; z < n; z++)
1106 cptr msg = message_str(z);
1109 if (strstr(msg, finder))
1120 /* Recall 1 older message */
1121 if ((k == '8') || (k == '\n') || (k == '\r'))
1123 /* Go newer if legal */
1124 if (i + 1 < n) i += 1;
1127 /* Recall 10 older messages */
1130 /* Go older if legal */
1131 if (i + 10 < n) i += 10;
1134 /* Recall 20 older messages */
1135 if ((k == 'p') || (k == KTRL('P')) || (k == ' '))
1137 /* Go older if legal */
1138 if (i + 20 < n) i += 20;
1141 /* Recall 20 newer messages */
1142 if ((k == 'n') || (k == KTRL('N')))
1144 /* Go newer (if able) */
1145 i = (i >= 20) ? (i - 20) : 0;
1148 /* Recall 10 newer messages */
1151 /* Go newer (if able) */
1152 i = (i >= 20) ? (i - 20) : 0;
1155 /* Recall 1 newer messages */
1158 /* Go newer (if able) */
1159 i = (i >= 1) ? (i - 1) : 0;
1162 /* Hack -- Error of some kind */
1166 /* Restore the screen */
1173 * Number of cheating options
1180 static option_type cheat_info[CHEAT_MAX] =
1182 { &cheat_peek, FALSE, 255, 0x01, 0x00,
1184 "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1186 "cheat_peek", "Peek into object creation" },
1190 { &cheat_hear, FALSE, 255, 0x02, 0x00,
1192 "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1194 "cheat_hear", "Peek into monster creation" },
1198 { &cheat_room, FALSE, 255, 0x04, 0x00,
1200 "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" },
1202 "cheat_room", "Peek into dungeon creation" },
1206 { &cheat_xtra, FALSE, 255, 0x08, 0x00,
1208 "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" },
1210 "cheat_xtra", "Peek into something else" },
1214 { &cheat_know, FALSE, 255, 0x10, 0x00,
1216 "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" },
1218 "cheat_know", "Know complete monster info" },
1222 { &cheat_live, FALSE, 255, 0x20, 0x00,
1224 "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" }
1226 "cheat_live", "Allow player to avoid death" }
1232 * Interact with some options for cheating
1234 static void do_cmd_options_cheat(cptr info)
1238 int i, k = 0, n = CHEAT_MAX;
1246 /* Interact with the player */
1249 /* Prompt XXX XXX XXX */
1251 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info);
1253 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1259 /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */
1260 prt(" << Ãí°Õ >>", 11, 0);
1261 prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0);
1262 prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0);
1263 prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0);
1265 /* Display the options */
1266 for (i = 0; i < n; i++)
1268 byte a = TERM_WHITE;
1270 /* Color current option */
1271 if (i == k) a = TERM_L_BLUE;
1273 /* Display the option text */
1274 sprintf(buf, "%-48s: %s (%s)",
1275 cheat_info[i].o_desc,
1277 (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1279 (*cheat_info[i].o_var ? "yes" : "no "),
1282 cheat_info[i].o_text);
1283 c_prt(a, buf, i + 2, 0);
1286 /* Hilite current option */
1287 move_cursor(k + 2, 50);
1303 k = (n + k - 1) % n;
1322 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
1324 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
1326 noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1327 (*cheat_info[k].o_var) = TRUE;
1336 (*cheat_info[k].o_var) = FALSE;
1351 static option_type autosave_info[2] =
1353 { &autosave_l, FALSE, 255, 0x01, 0x00,
1355 "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1357 "autosave_l", "Autosave when entering new levels" },
1361 { &autosave_t, FALSE, 255, 0x02, 0x00,
1363 "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" },
1365 "autosave_t", "Timed autosave" },
1371 static s16b toggle_frequency(s16b current)
1373 if (current == 0) return 50;
1374 if (current == 50) return 100;
1375 if (current == 100) return 250;
1376 if (current == 250) return 500;
1377 if (current == 500) return 1000;
1378 if (current == 1000) return 2500;
1379 if (current == 2500) return 5000;
1380 if (current == 5000) return 10000;
1381 if (current == 10000) return 25000;
1388 * Interact with some options for cheating
1390 static void do_cmd_options_autosave(cptr info)
1394 int i, k = 0, n = 2;
1402 /* Interact with the player */
1405 /* Prompt XXX XXX XXX */
1407 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info);
1409 sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info);
1414 /* Display the options */
1415 for (i = 0; i < n; i++)
1417 byte a = TERM_WHITE;
1419 /* Color current option */
1420 if (i == k) a = TERM_L_BLUE;
1422 /* Display the option text */
1423 sprintf(buf, "%-48s: %s (%s)",
1424 autosave_info[i].o_desc,
1426 (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1428 (*autosave_info[i].o_var ? "yes" : "no "),
1431 autosave_info[i].o_text);
1432 c_prt(a, buf, i + 2, 0);
1436 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0);
1438 prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0);
1443 /* Hilite current option */
1444 move_cursor(k + 2, 50);
1460 k = (n + k - 1) % n;
1478 (*autosave_info[k].o_var) = TRUE;
1487 (*autosave_info[k].o_var) = FALSE;
1495 autosave_freq = toggle_frequency(autosave_freq);
1497 prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè",
1499 prt(format("Timed autosave frequency: every %d turns",
1502 autosave_freq), 5, 0);
1515 #define PAGE_AUTODESTROY 7
1518 * Interact with some options
1520 void do_cmd_options_aux(int page, cptr info)
1523 int i, k = 0, n = 0, l;
1528 /* Lookup the options */
1529 for (i = 0; i < 24; i++) opt[i] = 0;
1531 /* Scan the options */
1532 for (i = 0; option_info[i].o_desc; i++)
1534 /* Notice options on this "page" */
1535 if (option_info[i].o_page == page) opt[n++] = i;
1543 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 7, 6);
1545 if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 7, 3);
1548 /* Interact with the player */
1551 /* Prompt XXX XXX XXX */
1553 sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê ) ", info);
1555 sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info);
1560 /* Display the options */
1561 for (i = 0; i < n; i++)
1563 byte a = TERM_WHITE;
1565 /* Color current option */
1566 if (i == k) a = TERM_L_BLUE;
1568 /* Display the option text */
1569 sprintf(buf, "%-48s: %s (%.19s)",
1570 option_info[opt[i]].o_desc,
1572 (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"),
1574 (*option_info[opt[i]].o_var ? "yes" : "no "),
1577 option_info[opt[i]].o_text);
1578 if ((page == PAGE_AUTODESTROY) && i > 3) c_prt(a, buf, i + 5, 0);
1579 else c_prt(a, buf, i + 2, 0);
1582 if ((page == PAGE_AUTODESTROY) && (k > 3)) l = 3;
1584 /* Hilite current option */
1585 move_cursor(k + 2 + l, 50);
1603 k = (n + k - 1) % n;
1624 (*option_info[opt[k]].o_var) = TRUE;
1635 (*option_info[opt[k]].o_var) = FALSE;
1643 (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1658 * Modify the "window" options
1660 static void do_cmd_options_win(void)
1674 /* Memorize old flags */
1675 for (j = 0; j < 8; j++)
1677 /* Acquire current flags */
1678 old_flag[j] = window_flag[j];
1688 /* Prompt XXX XXX XXX */
1690 prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0);
1692 prt("Window Flags (<dir>, t, y, n, ESC) ", 0, 0);
1696 /* Display the windows */
1697 for (j = 0; j < 8; j++)
1699 byte a = TERM_WHITE;
1701 cptr s = angband_term_name[j];
1704 if (j == x) a = TERM_L_BLUE;
1706 /* Window name, staggered, centered */
1707 Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
1710 /* Display the options */
1711 for (i = 0; i < 16; i++)
1713 byte a = TERM_WHITE;
1715 cptr str = window_flag_desc[i];
1718 if (i == y) a = TERM_L_BLUE;
1722 if (!str) str = "(̤»ÈÍÑ)";
1724 if (!str) str = "(Unused option)";
1729 Term_putstr(0, i + 5, -1, a, str);
1731 /* Display the windows */
1732 for (j = 0; j < 8; j++)
1734 byte a = TERM_WHITE;
1739 if ((i == y) && (j == x)) a = TERM_L_BLUE;
1742 if (window_flag[j] & (1L << i)) c = 'X';
1745 Term_putch(35 + j * 5, i + 5, a, c);
1750 Term_gotoxy(35 + x * 5, y + 5);
1768 for (j = 0; j < 8; j++)
1770 window_flag[j] &= ~(1L << y);
1774 for (i = 0; i < 16; i++)
1776 window_flag[x] &= ~(1L << i);
1789 window_flag[x] |= (1L << y);
1797 window_flag[x] &= ~(1L << y);
1803 d = get_keymap_dir(ch);
1805 x = (x + ddx[d] + 8) % 8;
1806 y = (y + ddy[d] + 16) % 16;
1813 /* Notice changes */
1814 for (j = 0; j < 8; j++)
1819 if (!angband_term[j]) continue;
1821 /* Ignore non-changes */
1822 if (window_flag[j] == old_flag[j]) continue;
1825 Term_activate(angband_term[j]);
1842 * Set or unset various options.
1844 * The user must use the "Ctrl-R" command to "adapt" to changes
1845 * in any options which control "visual" aspects of the game.
1847 void do_cmd_options(void)
1852 /* Save the screen */
1862 /* Why are we here */
1864 prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 2, 0);
1866 prt("Options", 2, 0);
1870 /* Give some choices */
1872 prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 4, 5);
1873 prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 5, 5);
1874 prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
1875 prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
1876 prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
1877 prt("(6) ¥¢¥¤¥Æ¥à¼«Æ°½¦¤¤/Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
1878 prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
1879 /* Special choices */
1880 prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
1881 prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 13, 5);
1882 prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
1884 prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
1886 prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 16, 5);
1888 prt("(1) Input Options", 4, 5);
1889 prt("(2) Output Options", 5, 5);
1890 prt("(3) Game-Play Options", 6, 5);
1891 prt("(4) Disturbance Options", 7, 5);
1892 prt("(5) Efficiency Options", 8, 5);
1893 prt("(6) Object Auto-Pick/Destroy Options", 9, 5);
1894 prt("(R) Play-record Options", 10, 5);
1896 /* Special choices */
1897 prt("(D) Base Delay Factor", 12, 5);
1898 prt("(H) Hitpoint Warning", 13, 5);
1899 prt("(A) Autosave Options", 14, 5);
1903 prt("(W) Window Flags", 15, 5);
1906 prt("(C) Cheating Options", 16, 5);
1912 prt("¥³¥Þ¥ó¥É:", 18, 0);
1914 prt("Command: ", 18, 0);
1922 if (k == ESCAPE) break;
1927 /* General Options */
1930 /* Process the general options */
1932 do_cmd_options_aux(1, "¥¡¼ÆþÎÏ¥ª¥×¥·¥ç¥ó");
1934 do_cmd_options_aux(1, "Input Options");
1940 /* General Options */
1943 /* Process the general options */
1945 do_cmd_options_aux(2, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
1947 do_cmd_options_aux(2, "Output Options");
1953 /* Inventory Options */
1958 do_cmd_options_aux(3, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
1960 do_cmd_options_aux(3, "Game-Play Options");
1966 /* Disturbance Options */
1971 do_cmd_options_aux(4, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
1973 do_cmd_options_aux(4, "Disturbance Options");
1979 /* Efficiency Options */
1984 do_cmd_options_aux(5, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
1986 do_cmd_options_aux(5, "Efficiency Options");
1992 /* Object auto-destruction Options */
1997 do_cmd_options_aux(7, "¥¢¥¤¥Æ¥à¼«Æ°½¦¤¤/Ç˲õ¥ª¥×¥·¥ç¥ó");
1999 do_cmd_options_aux(7, "Object Auto-Pick/Destroy Options");
2004 /* Play-record Options */
2010 do_cmd_options_aux(10, "¥×¥ì¥¤µÏ¿¥ª¥×¥·¥ç¥ó");
2012 do_cmd_options_aux(10, "Play-record Option");
2017 /* Cheating Options */
2022 do_cmd_options_cheat("º¾µ½»Õ¤Ï·è¤·¤Æ¾¡Íø¤Ç¤¤Ê¤¤¡ª");
2024 do_cmd_options_cheat("Cheaters never win");
2034 do_cmd_options_autosave("¼«Æ°¥»¡¼¥Ö");
2036 do_cmd_options_autosave("Autosave");
2047 do_cmd_options_win();
2048 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
2049 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
2050 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
2051 PW_BORG_1 | PW_BORG_2 | PW_DUNGEON);
2055 /* Hack -- Delay Speed */
2061 prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 18, 0);
2063 prt("Command: Base Delay Factor", 18, 0);
2067 /* Get a new value */
2070 int msec = delay_factor * delay_factor * delay_factor;
2072 prt(format("¸½ºß¤Î¥¦¥§¥¤¥È: %d (%d¥ß¥êÉÃ)",
2074 prt(format("Current base delay factor: %d (%d msec)",
2077 delay_factor, msec), 22, 0);
2079 prt("¥¦¥§¥¤¥È (0-9) ESC¤Ç·èÄê: ", 20, 0);
2081 prt("Delay Factor (0-9 or ESC to accept): ", 20, 0);
2085 if (k == ESCAPE) break;
2086 if (isdigit(k)) delay_factor = D2I(k);
2093 /* Hack -- hitpoint warning factor */
2099 prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 18, 0);
2101 prt("Command: Hitpoint Warning", 18, 0);
2105 /* Get a new value */
2109 prt(format("¸½ºß¤ÎÄã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð: %d0%%",
2110 hitpoint_warn), 22, 0);
2112 prt(format("Current hitpoint warning: %d0%%",
2113 hitpoint_warn), 22, 0);
2117 prt("Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð (0-9) ESC¤Ç·èÄê: ", 20, 0);
2119 prt("Hitpoint Warning (0-9 or ESC to accept): ", 20, 0);
2123 if (k == ESCAPE) break;
2124 if (isdigit(k)) hitpoint_warn = D2I(k);
2131 /* Unknown option */
2140 /* Flush messages */
2145 /* Restore the screen */
2148 /* Hack - Redraw equippy chars */
2149 p_ptr->redraw |= (PR_EQUIPPY);
2155 * Ask for a "user pref line" and process it
2157 * XXX XXX XXX Allow absolute file names?
2159 void do_cmd_pref(void)
2166 /* Ask for a "user pref command" */
2168 if (!get_string("ÀßÄêÊѹ¹¥³¥Þ¥ó¥É: ", buf, 80)) return;
2170 if (!get_string("Pref: ", buf, 80)) return;
2174 /* Process that pref command */
2175 (void)process_pref_file_command(buf);
2178 void do_cmd_pickpref(void)
2185 if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
2187 if(!get_check("Reload auto-pick preference file? ")) return;
2189 /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
2190 for( i = 0; i < max_autopick; i++){
2191 free(autopick_name[i]);
2192 free(autopick_insc[i]);
2196 /* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
2198 sprintf(buf, "picktype-%s.prf", player_name);
2200 sprintf(buf, "pickpref-%s.prf", player_name);
2202 if( process_pickpref_file(buf) == 0 ){
2205 msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
2207 msg_format("loaded '%s'.", buf);
2211 /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
2213 if( process_pickpref_file("picktype.prf") == 0 )
2215 if( process_pickpref_file("pickpref.prf") == 0 )
2220 msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
2222 msg_print("loaded 'pickpref.prf'.");
2227 if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
2229 if(err) msg_print("Failed to reload autopick preference.");
2236 * Hack -- append all current macros to the given file
2238 static errr macro_dump(cptr fname)
2247 /* Build the filename */
2248 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2250 /* File type is "TEXT" */
2251 FILE_TYPE(FILE_TYPE_TEXT);
2253 /* Append to the file */
2254 fff = my_fopen(buf, "a");
2259 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
2261 msg_format("Failed to open %s.", buf);
2269 fprintf(fff, "\n\n");
2273 fprintf(fff, "# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
2275 fprintf(fff, "# Automatic macro dump\n\n");
2280 for (i = 0; i < macro__num; i++)
2282 /* Start the macro */
2284 fprintf(fff, "# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2286 fprintf(fff, "# Macro '%d'\n\n", i);
2290 /* Extract the action */
2291 ascii_to_text(buf, macro__act[i]);
2293 /* Dump the macro */
2294 fprintf(fff, "A:%s\n", buf);
2296 /* Extract the action */
2297 ascii_to_text(buf, macro__pat[i]);
2299 /* Dump normal macros */
2300 fprintf(fff, "P:%s\n", buf);
2303 fprintf(fff, "\n\n");
2307 fprintf(fff, "\n\n\n\n");
2319 * Hack -- ask for a "trigger" (see below)
2321 * Note the complex use of the "inkey()" function from "util.c".
2323 * Note that both "flush()" calls are extremely important.
2325 static void do_cmd_macro_aux(char *buf)
2335 /* Do not process macros */
2341 /* Read the pattern */
2347 /* Do not process macros */
2350 /* Do not wait for keys */
2353 /* Attempt to read a key */
2364 /* Convert the trigger */
2365 ascii_to_text(tmp, buf);
2367 /* Hack -- display the trigger */
2368 Term_addstr(-1, TERM_WHITE, tmp);
2375 * Hack -- ask for a keymap "trigger" (see below)
2377 * Note that both "flush()" calls are extremely important. This may
2378 * no longer be true, since "util.c" is much simpler now. XXX XXX XXX
2380 static void do_cmd_macro_aux_keymap(char *buf)
2394 /* Convert to ascii */
2395 ascii_to_text(tmp, buf);
2397 /* Hack -- display the trigger */
2398 Term_addstr(-1, TERM_WHITE, tmp);
2407 * Hack -- append all keymaps to the given file
2409 static errr keymap_dump(cptr fname)
2422 if (rogue_like_commands)
2424 mode = KEYMAP_MODE_ROGUE;
2430 mode = KEYMAP_MODE_ORIG;
2434 /* Build the filename */
2435 path_build(buf, 1024, ANGBAND_DIR_USER, fname);
2437 /* File type is "TEXT" */
2438 FILE_TYPE(FILE_TYPE_TEXT);
2440 /* Append to the file */
2441 fff = my_fopen(buf, "a");
2446 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
2448 msg_format("Failed to open %s.", buf);
2456 fprintf(fff, "\n\n");
2460 fprintf(fff, "# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
2462 fprintf(fff, "# Automatic keymap dump\n\n");
2467 for (i = 0; i < 256; i++)
2471 /* Loop up the keymap */
2472 act = keymap_act[mode][i];
2474 /* Skip empty keymaps */
2477 /* Encode the key */
2480 ascii_to_text(key, buf);
2482 /* Encode the action */
2483 ascii_to_text(buf, act);
2485 /* Dump the macro */
2486 fprintf(fff, "A:%s\n", buf);
2487 fprintf(fff, "C:%d:%s\n", mode, key);
2491 fprintf(fff, "\n\n\n");
2504 * Interact with "macros"
2506 * Note that the macro "action" must be defined before the trigger.
2508 * Could use some helpful instructions on this page. XXX XXX XXX
2510 void do_cmd_macros(void)
2522 if (rogue_like_commands)
2524 mode = KEYMAP_MODE_ROGUE;
2530 mode = KEYMAP_MODE_ORIG;
2533 /* File type is "TEXT" */
2534 FILE_TYPE(FILE_TYPE_TEXT);
2541 /* Process requests until done */
2549 prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0);
2551 prt("Interact with Macros", 2, 0);
2556 /* Describe that action */
2558 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2560 prt("Current action (if any) shown below:", 20, 0);
2564 /* Analyze the current action */
2565 ascii_to_text(buf, macro__buf);
2567 /* Display the current action */
2573 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
2575 prt("(1) Load a user pref file", 4, 5);
2580 prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5);
2581 prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5);
2582 prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5);
2583 prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5);
2584 prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5);
2585 prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5);
2586 prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5);
2587 prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5);
2588 prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5);
2590 prt("(2) Append macros to a file", 5, 5);
2591 prt("(3) Query a macro", 6, 5);
2592 prt("(4) Create a macro", 7, 5);
2593 prt("(5) Remove a macro", 8, 5);
2594 prt("(6) Append keymaps to a file", 9, 5);
2595 prt("(7) Query a keymap", 10, 5);
2596 prt("(8) Create a keymap", 11, 5);
2597 prt("(9) Remove a keymap", 12, 5);
2598 prt("(0) Enter a new action", 13, 5);
2601 #endif /* ALLOW_MACROS */
2605 prt("¥³¥Þ¥ó¥É: ", 16, 0);
2607 prt("Command: ", 16, 0);
2615 if (i == ESCAPE) break;
2617 /* Load a 'macro' file */
2622 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
2624 prt("Command: Load a user pref file", 16, 0);
2630 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2632 prt("File: ", 18, 0);
2636 /* Default filename */
2637 sprintf(tmp, "%s.prf", player_name);
2639 /* Ask for a file */
2640 if (!askfor_aux(tmp, 80)) continue;
2642 /* Process the given filename */
2643 if (0 != process_pref_file(tmp))
2647 msg_print("¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤á¤Þ¤»¤ó¤Ç¤·¤¿¡ª");
2649 msg_print("Could not load file!");
2662 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2664 prt("Command: Append macros to a file", 16, 0);
2670 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2672 prt("File: ", 18, 0);
2676 /* Default filename */
2677 sprintf(tmp, "%s.prf", player_name);
2679 /* Ask for a file */
2680 if (!askfor_aux(tmp, 80)) continue;
2685 /* Dump the macros */
2686 (void)macro_dump(tmp);
2693 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2695 msg_print("Appended macros.");
2707 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0);
2709 prt("Command: Query a macro", 16, 0);
2715 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2717 prt("Trigger: ", 18, 0);
2721 /* Get a macro trigger */
2722 do_cmd_macro_aux(buf);
2724 /* Acquire action */
2725 k = macro_find_exact(buf);
2732 msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2734 msg_print("Found no macro.");
2742 /* Obtain the action */
2743 strcpy(macro__buf, macro__act[k]);
2745 /* Analyze the current action */
2746 ascii_to_text(buf, macro__buf);
2748 /* Display the current action */
2753 msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2755 msg_print("Found a macro.");
2761 /* Create a macro */
2766 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0);
2768 prt("Command: Create a macro", 16, 0);
2774 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2776 prt("Trigger: ", 18, 0);
2780 /* Get a macro trigger */
2781 do_cmd_macro_aux(buf);
2788 prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
2790 prt("Action: ", 20, 0);
2794 /* Convert to text */
2795 ascii_to_text(tmp, macro__buf);
2797 /* Get an encoded action */
2798 if (askfor_aux(tmp, 80))
2800 /* Convert to ascii */
2801 text_to_ascii(macro__buf, tmp);
2803 /* Link the macro */
2804 macro_add(buf, macro__buf);
2808 msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
2810 msg_print("Added a macro.");
2816 /* Remove a macro */
2821 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0);
2823 prt("Command: Remove a macro", 16, 0);
2829 prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0);
2831 prt("Trigger: ", 18, 0);
2835 /* Get a macro trigger */
2836 do_cmd_macro_aux(buf);
2838 /* Link the macro */
2839 macro_add(buf, buf);
2843 msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£");
2845 msg_print("Removed a macro.");
2855 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0);
2857 prt("Command: Append keymaps to a file", 16, 0);
2863 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
2865 prt("File: ", 18, 0);
2869 /* Default filename */
2870 sprintf(tmp, "%s.prf", player_name);
2872 /* Ask for a file */
2873 if (!askfor_aux(tmp, 80)) continue;
2878 /* Dump the macros */
2879 (void)keymap_dump(tmp);
2886 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
2888 msg_print("Appended keymaps.");
2893 /* Query a keymap */
2900 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0);
2902 prt("Command: Query a keymap", 16, 0);
2908 prt("²¡¤¹¥¡¼: ", 18, 0);
2910 prt("Keypress: ", 18, 0);
2914 /* Get a keymap trigger */
2915 do_cmd_macro_aux_keymap(buf);
2917 /* Look up the keymap */
2918 act = keymap_act[mode][(byte)(buf[0])];
2925 msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
2927 msg_print("Found no keymap.");
2935 /* Obtain the action */
2936 strcpy(macro__buf, act);
2938 /* Analyze the current action */
2939 ascii_to_text(buf, macro__buf);
2941 /* Display the current action */
2946 msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£");
2948 msg_print("Found a keymap.");
2954 /* Create a keymap */
2959 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0);
2961 prt("Command: Create a keymap", 16, 0);
2967 prt("²¡¤¹¥¡¼: ", 18, 0);
2969 prt("Keypress: ", 18, 0);
2973 /* Get a keymap trigger */
2974 do_cmd_macro_aux_keymap(buf);
2981 prt("¹ÔÆ°: ", 20, 0);
2983 prt("Action: ", 20, 0);
2987 /* Convert to text */
2988 ascii_to_text(tmp, macro__buf);
2990 /* Get an encoded action */
2991 if (askfor_aux(tmp, 80))
2993 /* Convert to ascii */
2994 text_to_ascii(macro__buf, tmp);
2996 /* Free old keymap */
2997 string_free(keymap_act[mode][(byte)(buf[0])]);
2999 /* Make new keymap */
3000 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
3004 msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
3006 msg_print("Added a keymap.");
3012 /* Remove a keymap */
3017 prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0);
3019 prt("Command: Remove a keymap", 16, 0);
3025 prt("²¡¤¹¥¡¼: ", 18, 0);
3027 prt("Keypress: ", 18, 0);
3031 /* Get a keymap trigger */
3032 do_cmd_macro_aux_keymap(buf);
3034 /* Free old keymap */
3035 string_free(keymap_act[mode][(byte)(buf[0])]);
3037 /* Make new keymap */
3038 keymap_act[mode][(byte)(buf[0])] = NULL;
3042 msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£");
3044 msg_print("Removed a keymap.");
3049 /* Enter a new action */
3054 prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0);
3056 prt("Command: Enter a new action", 16, 0);
3060 /* Go to the correct location */
3063 /* Hack -- limit the value */
3066 /* Get an encoded action */
3067 if (!askfor_aux(buf, 80)) continue;
3069 /* Extract an action */
3070 text_to_ascii(macro__buf, buf);
3073 #endif /* ALLOW_MACROS */
3082 /* Flush messages */
3092 * Interact with "visuals"
3094 void do_cmd_visuals(void)
3105 /* File type is "TEXT" */
3106 FILE_TYPE(FILE_TYPE_TEXT);
3109 /* Save the screen */
3113 /* Interact until done */
3119 /* Ask for a choice */
3121 prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
3123 prt("Interact with Visuals", 2, 0);
3127 /* Give some choices */
3129 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3131 prt("(1) Load a user pref file", 4, 5);
3134 #ifdef ALLOW_VISUALS
3136 prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3137 prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5);
3138 prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5);
3139 prt("(5) (̤»ÈÍÑ)", 8, 5);
3140 prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
3141 prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
3142 prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
3143 prt("(9) (̤»ÈÍÑ)", 12, 5);
3145 prt("(2) Dump monster attr/chars", 5, 5);
3146 prt("(3) Dump object attr/chars", 6, 5);
3147 prt("(4) Dump feature attr/chars", 7, 5);
3148 prt("(5) (unused)", 8, 5);
3149 prt("(6) Change monster attr/chars", 9, 5);
3150 prt("(7) Change object attr/chars", 10, 5);
3151 prt("(8) Change feature attr/chars", 11, 5);
3152 prt("(9) (unused)", 12, 5);
3157 prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
3159 prt("(0) Reset visuals", 13, 5);
3165 prt("¥³¥Þ¥ó¥É:", 18, 0);
3167 prt("Command: ", 15, 0);
3175 if (i == ESCAPE) break;
3177 /* Load a 'pref' file */
3182 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
3184 prt("Command: Load a user pref file", 15, 0);
3190 prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
3192 prt("File: ", 17, 0);
3196 /* Default filename */
3197 sprintf(tmp, "%s.prf", player_name);
3200 if (!askfor_aux(tmp, 70)) continue;
3202 /* Process the given filename */
3203 (void)process_pref_file(tmp);
3206 #ifdef ALLOW_VISUALS
3208 /* Dump monster attr/chars */
3213 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3215 prt("Command: Dump monster attr/chars", 15, 0);
3221 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3223 prt("File: ", 17, 0);
3227 /* Default filename */
3228 sprintf(tmp, "%s.prf", player_name);
3230 /* Get a filename */
3231 if (!askfor_aux(tmp, 70)) continue;
3233 /* Build the filename */
3234 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3239 /* Append to the file */
3240 fff = my_fopen(buf, "a");
3248 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
3250 msg_format("Failed to open %s.", buf);
3257 fprintf(fff, "\n\n");
3259 fprintf(fff, "# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3261 fprintf(fff, "# Monster attr/char definitions\n\n");
3266 for (i = 0; i < max_r_idx; i++)
3268 monster_race *r_ptr = &r_info[i];
3270 /* Skip non-entries */
3271 if (!r_ptr->name) continue;
3273 /* Dump a comment */
3274 fprintf(fff, "# %s\n", (r_name + r_ptr->name));
3277 /* Dump the monster attr/char info */
3278 fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
3279 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
3283 fprintf(fff, "\n\n\n\n");
3290 msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3292 msg_print("Dumped monster attr/chars.");
3297 /* Dump object attr/chars */
3302 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3304 prt("Command: Dump object attr/chars", 15, 0);
3310 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3312 prt("File: ", 17, 0);
3316 /* Default filename */
3317 sprintf(tmp, "%s.prf", player_name);
3319 /* Get a filename */
3320 if (!askfor_aux(tmp, 70)) continue;
3322 /* Build the filename */
3323 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3328 /* Append to the file */
3329 fff = my_fopen(buf, "a");
3337 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
3339 msg_format("Failed to open %s.", buf);
3346 fprintf(fff, "\n\n");
3348 fprintf(fff, "# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3350 fprintf(fff, "# Object attr/char definitions\n\n");
3355 for (i = 0; i < max_k_idx; i++)
3357 object_kind *k_ptr = &k_info[i];
3359 /* Skip non-entries */
3360 if (!k_ptr->name) continue;
3362 /* Dump a comment */
3363 fprintf(fff, "# %s\n", (k_name + k_ptr->name));
3366 /* Dump the object attr/char info */
3367 fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
3368 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
3372 fprintf(fff, "\n\n\n\n");
3379 msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3381 msg_print("Dumped object attr/chars.");
3386 /* Dump feature attr/chars */
3391 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
3393 prt("Command: Dump feature attr/chars", 15, 0);
3399 prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
3401 prt("File: ", 17, 0);
3405 /* Default filename */
3406 sprintf(tmp, "%s.prf", player_name);
3408 /* Get a filename */
3409 if (!askfor_aux(tmp, 70)) continue;
3411 /* Build the filename */
3412 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3417 /* Append to the file */
3418 fff = my_fopen(buf, "a");
3426 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
3428 msg_format("Failed to open %s.", buf);
3435 fprintf(fff, "\n\n");
3437 fprintf(fff, "# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
3439 fprintf(fff, "# Feature attr/char definitions\n\n");
3444 for (i = 0; i < max_f_idx; i++)
3446 feature_type *f_ptr = &f_info[i];
3448 /* Skip non-entries */
3449 if (!f_ptr->name) continue;
3451 /* Dump a comment */
3452 fprintf(fff, "# %s\n", (f_name + f_ptr->name));
3454 /* Dump the feature attr/char info */
3455 fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
3456 (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
3460 fprintf(fff, "\n\n\n\n");
3467 msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3469 msg_print("Dumped feature attr/chars.");
3474 /* Modify monster attr/chars */
3481 prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3483 prt("Command: Change monster attr/chars", 15, 0);
3487 /* Hack -- query until done */
3490 monster_race *r_ptr = &r_info[r];
3492 byte da = (r_ptr->d_attr);
3493 char dc = (r_ptr->d_char);
3494 byte ca = (r_ptr->x_attr);
3495 char cc = (r_ptr->x_char);
3497 /* Label the object */
3499 Term_putstr(5, 17, -1, TERM_WHITE,
3500 format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s",
3501 r, (r_name + r_ptr->name)));
3503 Term_putstr(5, 17, -1, TERM_WHITE,
3504 format("Monster = %d, Name = %-40.40s",
3505 r, (r_name + r_ptr->name)));
3509 /* Label the Default values */
3511 Term_putstr(10, 19, -1, TERM_WHITE,
3512 format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc));
3514 Term_putstr(10, 19, -1, TERM_WHITE,
3515 format("Default attr/char = %3u / %3u", da, dc));
3518 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3519 Term_putch(43, 19, da, dc);
3521 /* Label the Current values */
3523 Term_putstr(10, 20, -1, TERM_WHITE,
3524 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc));
3526 Term_putstr(10, 20, -1, TERM_WHITE,
3527 format("Current attr/char = %3u / %3u", ca, cc));
3530 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3531 Term_putch(43, 20, ca, cc);
3535 Term_putstr(0, 22, -1, TERM_WHITE,
3536 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3538 Term_putstr(0, 22, -1, TERM_WHITE,
3539 "Command (n/N/a/A/c/C): ");
3547 if (i == ESCAPE) break;
3550 if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx;
3551 if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx;
3552 if (i == 'a') r_ptr->x_attr = (byte)(ca + 1);
3553 if (i == 'A') r_ptr->x_attr = (byte)(ca - 1);
3554 if (i == 'c') r_ptr->x_char = (byte)(cc + 1);
3555 if (i == 'C') r_ptr->x_char = (byte)(cc - 1);
3559 /* Modify object attr/chars */
3566 prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3568 prt("Command: Change object attr/chars", 15, 0);
3572 /* Hack -- query until done */
3575 object_kind *k_ptr = &k_info[k];
3577 byte da = (byte)k_ptr->d_attr;
3578 char dc = (byte)k_ptr->d_char;
3579 byte ca = (byte)k_ptr->x_attr;
3580 char cc = (byte)k_ptr->x_char;
3582 /* Label the object */
3584 Term_putstr(5, 17, -1, TERM_WHITE,
3585 format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s",
3586 k, (k_name + k_ptr->name)));
3588 Term_putstr(5, 17, -1, TERM_WHITE,
3589 format("Object = %d, Name = %-40.40s",
3590 k, (k_name + k_ptr->name)));
3594 /* Label the Default values */
3596 Term_putstr(10, 19, -1, TERM_WHITE,
3597 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3599 Term_putstr(10, 19, -1, TERM_WHITE,
3600 format("Default attr/char = %3d / %3d", da, dc));
3603 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3604 Term_putch(43, 19, da, dc);
3606 /* Label the Current values */
3608 Term_putstr(10, 20, -1, TERM_WHITE,
3609 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3611 Term_putstr(10, 20, -1, TERM_WHITE,
3612 format("Current attr/char = %3d / %3d", ca, cc));
3615 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3616 Term_putch(43, 20, ca, cc);
3620 Term_putstr(0, 22, -1, TERM_WHITE,
3621 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3623 Term_putstr(0, 22, -1, TERM_WHITE,
3624 "Command (n/N/a/A/c/C): ");
3632 if (i == ESCAPE) break;
3635 if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx;
3636 if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx;
3637 if (i == 'a') k_info[k].x_attr = (byte)(ca + 1);
3638 if (i == 'A') k_info[k].x_attr = (byte)(ca - 1);
3639 if (i == 'c') k_info[k].x_char = (byte)(cc + 1);
3640 if (i == 'C') k_info[k].x_char = (byte)(cc - 1);
3644 /* Modify feature attr/chars */
3651 prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
3653 prt("Command: Change feature attr/chars", 15, 0);
3657 /* Hack -- query until done */
3660 feature_type *f_ptr = &f_info[f];
3662 byte da = (byte)f_ptr->d_attr;
3663 char dc = (byte)f_ptr->d_char;
3664 byte ca = (byte)f_ptr->x_attr;
3665 char cc = (byte)f_ptr->x_char;
3667 /* Label the object */
3669 Term_putstr(5, 17, -1, TERM_WHITE,
3670 format("ÃÏ·Á = %d, ̾Á° = %-40.40s",
3671 f, (f_name + f_ptr->name)));
3673 Term_putstr(5, 17, -1, TERM_WHITE,
3674 format("Terrain = %d, Name = %-40.40s",
3675 f, (f_name + f_ptr->name)));
3679 /* Label the Default values */
3681 Term_putstr(10, 19, -1, TERM_WHITE,
3682 format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc));
3684 Term_putstr(10, 19, -1, TERM_WHITE,
3685 format("Default attr/char = %3d / %3d", da, dc));
3688 Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
3689 Term_putch(43, 19, da, dc);
3691 /* Label the Current values */
3693 Term_putstr(10, 20, -1, TERM_WHITE,
3694 format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc));
3696 Term_putstr(10, 20, -1, TERM_WHITE,
3697 format("Current attr/char = %3d / %3d", ca, cc));
3700 Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
3701 Term_putch(43, 20, ca, cc);
3705 Term_putstr(0, 22, -1, TERM_WHITE,
3706 "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
3708 Term_putstr(0, 22, -1, TERM_WHITE,
3709 "Command (n/N/a/A/c/C): ");
3717 if (i == ESCAPE) break;
3720 if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx;
3721 if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx;
3722 if (i == 'a') f_info[f].x_attr = (byte)(ca + 1);
3723 if (i == 'A') f_info[f].x_attr = (byte)(ca - 1);
3724 if (i == 'c') f_info[f].x_char = (byte)(cc + 1);
3725 if (i == 'C') f_info[f].x_char = (byte)(cc - 1);
3739 msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£");
3741 msg_print("Visual attr/char tables reset.");
3746 /* Unknown option */
3752 /* Flush messages */
3757 /* Restore the screen */
3763 * Interact with "colors"
3765 void do_cmd_colors(void)
3776 /* File type is "TEXT" */
3777 FILE_TYPE(FILE_TYPE_TEXT);
3780 /* Save the screen */
3784 /* Interact until done */
3790 /* Ask for a choice */
3792 prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0);
3794 prt("Interact with Colors", 2, 0);
3798 /* Give some choices */
3800 prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
3802 prt("(1) Load a user pref file", 4, 5);
3807 prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5);
3808 prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5);
3810 prt("(2) Dump colors", 5, 5);
3811 prt("(3) Modify colors", 6, 5);
3818 prt("¥³¥Þ¥ó¥É: ", 8, 0);
3820 prt("Command: ", 8, 0);
3828 if (i == ESCAPE) break;
3830 /* Load a 'pref' file */
3835 prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0);
3837 prt("Command: Load a user pref file", 8, 0);
3843 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
3845 prt("File: ", 10, 0);
3850 sprintf(tmp, "%s.prf", player_name);
3853 if (!askfor_aux(tmp, 70)) continue;
3855 /* Process the given filename */
3856 (void)process_pref_file(tmp);
3858 /* Mega-Hack -- react to changes */
3859 Term_xtra(TERM_XTRA_REACT, 0);
3861 /* Mega-Hack -- redraw */
3872 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
3874 prt("Command: Dump colors", 8, 0);
3880 prt("¥Õ¥¡¥¤¥ë: ", 10, 0);
3882 prt("File: ", 10, 0);
3886 /* Default filename */
3887 sprintf(tmp, "%s.prf", player_name);
3889 /* Get a filename */
3890 if (!askfor_aux(tmp, 70)) continue;
3892 /* Build the filename */
3893 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
3898 /* Append to the file */
3899 fff = my_fopen(buf, "a");
3907 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
3909 msg_format("Failed to open %s.", buf);
3916 fprintf(fff, "\n\n");
3918 fprintf(fff, "# ¥«¥é¡¼¤ÎÀßÄê\n\n");
3920 fprintf(fff, "# Color redefinitions\n\n");
3925 for (i = 0; i < 256; i++)
3927 int kv = angband_color_table[i][0];
3928 int rv = angband_color_table[i][1];
3929 int gv = angband_color_table[i][2];
3930 int bv = angband_color_table[i][3];
3935 cptr name = "unknown";
3939 /* Skip non-entries */
3940 if (!kv && !rv && !gv && !bv) continue;
3942 /* Extract the color name */
3943 if (i < 16) name = color_names[i];
3945 /* Dump a comment */
3947 fprintf(fff, "# ¥«¥é¡¼ '%s'\n", name);
3949 fprintf(fff, "# Color '%s'\n", name);
3953 /* Dump the monster attr/char info */
3954 fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
3959 fprintf(fff, "\n\n\n\n");
3966 msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
3968 msg_print("Dumped color redefinitions.");
3980 prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0);
3982 prt("Command: Modify colors", 8, 0);
3986 /* Hack -- query until done */
3995 /* Exhibit the normal colors */
3996 for (j = 0; j < 16; j++)
3998 /* Exhibit this color */
3999 Term_putstr(j*4, 20, -1, a, "###");
4001 /* Exhibit all colors */
4002 Term_putstr(j*4, 22, -1, j, format("%3d", j));
4005 /* Describe the color */
4007 name = ((a < 16) ? color_names[a] : "̤ÄêµÁ");
4009 name = ((a < 16) ? color_names[a] : "undefined");
4013 /* Describe the color */
4015 Term_putstr(5, 10, -1, TERM_WHITE,
4016 format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name));
4018 Term_putstr(5, 10, -1, TERM_WHITE,
4019 format("Color = %d, Name = %s", a, name));
4023 /* Label the Current values */
4024 Term_putstr(5, 12, -1, TERM_WHITE,
4025 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
4026 angband_color_table[a][0],
4027 angband_color_table[a][1],
4028 angband_color_table[a][2],
4029 angband_color_table[a][3]));
4033 Term_putstr(0, 14, -1, TERM_WHITE,
4034 "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): ");
4036 Term_putstr(0, 14, -1, TERM_WHITE,
4037 "Command (n/N/k/K/r/R/g/G/b/B): ");
4045 if (i == ESCAPE) break;
4048 if (i == 'n') a = (byte)(a + 1);
4049 if (i == 'N') a = (byte)(a - 1);
4050 if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1);
4051 if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1);
4052 if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1);
4053 if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1);
4054 if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1);
4055 if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1);
4056 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
4057 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
4059 /* Hack -- react to changes */
4060 Term_xtra(TERM_XTRA_REACT, 0);
4062 /* Hack -- redraw */
4069 /* Unknown option */
4075 /* Flush messages */
4080 /* Restore the screen */
4086 * Note something in the message recall
4088 void do_cmd_note(void)
4097 if (!get_string("¥á¥â: ", buf, 60)) return;
4099 if (!get_string("Note: ", buf, 60)) return;
4103 /* Ignore empty notes */
4104 if (!buf[0] || (buf[0] == ' ')) return;
4106 /* Add the note to the message recall */
4108 msg_format("¥á¥â: %s", buf);
4110 msg_format("Note: %s", buf);
4117 * Mention the current version
4119 void do_cmd_version(void)
4123 #ifndef FAKE_VERSION
4124 msg_format("You are playing Angband %d.%d.%d.",
4125 VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
4128 msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d",
4129 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4131 msg_format("You are playing Hengband %d.%d.%d.",
4132 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
4142 * Array of feeling strings
4144 static cptr do_cmd_feeling_text[11] =
4147 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4149 "Looks like any other level.",
4153 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4155 "You feel there is something special about this level.",
4159 "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª",
4161 "You nearly faint as horrible visions of death fill your mind!",
4165 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4167 "This level looks very dangerous.",
4171 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4173 "You have a very bad feeling...",
4177 "°¤¤Í½´¶¤¬¤¹¤ë...",
4179 "You have a bad feeling...",
4185 "You feel nervous.",
4189 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4191 "You feel your luck is turning...",
4195 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4197 "You don't like the look of this place.",
4201 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4203 "This level looks reasonably safe.",
4207 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4209 "What a boring place..."
4214 static cptr do_cmd_feeling_text_combat[11] =
4217 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4219 "Looks like any other level.",
4223 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4225 "You feel there is something special about this level.",
4229 "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...",
4231 "You nearly faint as horrible visions of death fill your mind!",
4235 "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£",
4237 "This level looks very dangerous.",
4241 "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...",
4243 "You have a very bad feeling...",
4247 "°¤¤Í½´¶¤¬¤¹¤ë...",
4249 "You have a bad feeling...",
4255 "You feel nervous.",
4259 "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...",
4261 "You feel your luck is turning...",
4265 "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£",
4267 "You don't like the look of this place.",
4271 "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£",
4273 "This level looks reasonably safe.",
4277 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4279 "What a boring place..."
4284 static cptr do_cmd_feeling_text_lucky[11] =
4287 "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...",
4288 "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£",
4289 "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£",
4290 "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...",
4291 "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...",
4292 "Îɤ¤´¶¤¸¤¬¤¹¤ë...",
4293 "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...",
4294 "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...",
4295 "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...",
4296 "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...",
4297 "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..."
4299 "Looks like any other level.",
4300 "You feel there is something special about this level.",
4301 "You have a superb feeling about this level.",
4302 "You have an excellent feeling...",
4303 "You have a very good feeling...",
4304 "You have a good feeling...",
4305 "You feel strangely lucky...",
4306 "You feel your luck is turning...",
4307 "You like the look of this place...",
4308 "This level can't be all bad...",
4309 "What a boring place..."
4315 * Note that "feeling" is set to zero unless some time has passed.
4316 * Note that this is done when the level is GENERATED, not entered.
4318 void do_cmd_feeling(void)
4320 /* Verify the feeling */
4321 if (feeling > 10) feeling = 10;
4324 if (cmd_feeling_callback(feeling)) return;
4325 #endif /* USE_SCRIPT */
4327 /* No useful feeling in quests */
4328 if (p_ptr->inside_quest && !random_quest_number(dun_level))
4331 msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£");
4333 msg_print("Looks like a typical quest level.");
4339 /* No useful feeling in town */
4340 else if (p_ptr->town_num && !dun_level)
4343 if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî"))
4345 if (!strcmp(town[p_ptr->town_num].name, "wilderness"))
4349 msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4351 msg_print("Looks like a strange wilderness.");
4359 msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£");
4361 msg_print("Looks like a typical town.");
4368 /* No useful feeling in the wilderness */
4369 else if (!dun_level)
4372 msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£");
4374 msg_print("Looks like a typical wilderness.");
4380 /* Display the feeling */
4381 if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
4383 if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
4385 if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
4386 msg_print(do_cmd_feeling_text_combat[feeling]);
4388 msg_print(do_cmd_feeling_text[feeling]);
4393 msg_print(do_cmd_feeling_text[0]);
4402 * Encode the screen colors
4404 static char hack[17] = "dwsorgbuDWvyRGBU";
4407 static errr photo_fgets(FILE *fff, char *buf, huge n)
4416 if (fgets(tmp, 1024, fff))
4418 /* Convert weirdness */
4419 for (s = tmp; *s; s++)
4421 /* Handle newline */
4432 else if (*s == '\t')
4434 /* Hack -- require room */
4435 if (i + 8 >= n) break;
4437 /* Append a space */
4440 /* Append some more spaces */
4441 while (!(i % 8)) buf[i++] = ' ';
4445 else if (iskanji(*s))
4452 /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */
4453 else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf))
4460 /* Handle printables */
4481 * Hack -- load a screen dump from a file
4483 void do_cmd_load_screen(void)
4497 /* Build the filename */
4498 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
4500 /* Append to the file */
4501 fff = my_fopen(buf, "r");
4506 msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
4508 msg_format("Failed to open %s.", buf);
4515 /* Save the screen */
4518 /* Clear the screen */
4522 /* Load the screen */
4523 for (y = 0; okay && (y < 24); y++)
4525 /* Get a line of data */
4526 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4529 for (x = 0; x < 79; x++)
4531 /* Put the attr/char */
4532 Term_draw(x, y, TERM_WHITE, buf[x]);
4536 /* Get the blank line */
4537 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4540 /* Dump the screen */
4541 for (y = 0; okay && (y < 24); y++)
4543 /* Get a line of data */
4544 if (photo_fgets(fff, buf, 1024)) okay = FALSE;
4547 for (x = 0; x < 79; x++)
4549 /* Get the attr/char */
4550 (void)(Term_what(x, y, &a, &c));
4552 /* Look up the attr */
4553 for (i = 0; i < 16; i++)
4555 /* Use attr matches */
4556 if (hack[i] == buf[x]) a = i;
4559 /* Put the attr/char */
4560 Term_draw(x, y, a, c);
4565 /* Get the blank line */
4566 if (my_fgets(fff, buf, 1024)) okay = FALSE;
4575 prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0);
4577 msg_print("Screen dump loaded.");
4584 /* Restore the screen */
4591 cptr inven_res_label =
4593 " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ";
4595 " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv";
4598 /* XTRA HACK RESLIST */
4599 static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr,
4600 int *j, byte tval, char *where)
4602 char o_name[MAX_NLEN];
4605 if (!o_ptr->k_idx)return;
4606 if (o_ptr->tval != tval)return;
4609 * HACK:Ring of Lordly protection and Dragon shield/helm
4610 * have random resistances.
4612 if ( ((o_ptr->tval >= TV_BOW && o_ptr->tval<= TV_DRAG_ARMOR && o_ptr->name2)
4613 || (o_ptr->tval == TV_RING && o_ptr->sval == SV_RING_LORDLY)
4614 || (o_ptr->tval == TV_SHIELD && o_ptr->sval == SV_DRAGON_SHIELD)
4615 || (o_ptr->tval == TV_HELM && o_ptr->sval == SV_DRAGON_HELM)
4616 || (o_ptr->tval == TV_GLOVES && o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
4617 || (o_ptr->tval == TV_BOOTS && o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
4618 || o_ptr->art_name || o_ptr->name1) && object_known_p(o_ptr))
4621 object_desc(o_name, o_ptr, TRUE, 0);
4623 while ( o_name[i] && i < 26 ){
4625 if (iskanji(o_name[i])) i++;
4629 if(i<28) while(i<28){o_name[i]=' ';i++;}
4632 fprintf(fff,"%s %s", where, o_name);
4634 if (!(o_ptr->ident & (IDENT_MENTAL)))
4637 fprintf(fff, "-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n");
4639 fprintf(fff, "-------unknown------------ -------unknown------\n");
4643 object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
4646 if (f[1] & TR2_IM_ACID) fprintf(fff,"¡ö");
4647 else if (f[1] & TR2_RES_ACID) fprintf(fff,"¡Ü");
4648 else fprintf(fff,"¡¦");
4650 if (f[1] & TR2_IM_ELEC) fprintf(fff,"¡ö");
4651 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"¡Ü");
4652 else fprintf(fff,"¡¦");
4654 if (f[1] & TR2_IM_FIRE) fprintf(fff,"¡ö");
4655 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"¡Ü");
4656 else fprintf(fff,"¡¦");
4658 if (f[1] & TR2_IM_COLD) fprintf(fff,"¡ö");
4659 else if (f[1] & TR2_RES_COLD) fprintf(fff,"¡Ü");
4660 else fprintf(fff,"¡¦");
4662 if (f[1] & TR2_RES_POIS) fprintf(fff,"¡Ü");
4663 else fprintf(fff,"¡¦");
4665 if (f[1] & TR2_RES_LITE) fprintf(fff,"¡Ü");
4666 else fprintf(fff,"¡¦");
4668 if (f[1] & TR2_RES_DARK) fprintf(fff,"¡Ü");
4669 else fprintf(fff,"¡¦");
4671 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"¡Ü");
4672 else fprintf(fff,"¡¦");
4674 if (f[1] & TR2_RES_SOUND) fprintf(fff,"¡Ü");
4675 else fprintf(fff,"¡¦");
4677 if (f[1] & TR2_RES_NETHER) fprintf(fff,"¡Ü");
4678 else fprintf(fff,"¡¦");
4680 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"¡Ü");
4681 else fprintf(fff,"¡¦");
4683 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"¡Ü");
4684 else fprintf(fff,"¡¦");
4686 if (f[1] & TR2_RES_DISEN) fprintf(fff,"¡Ü");
4687 else fprintf(fff,"¡¦");
4691 if (f[1] & TR2_RES_BLIND) fprintf(fff,"¡Ü");
4692 else fprintf(fff,"¡¦");
4694 if (f[1] & TR2_RES_FEAR) fprintf(fff,"¡Ü");
4695 else fprintf(fff,"¡¦");
4697 if (f[1] & TR2_RES_CONF) fprintf(fff,"¡Ü");
4698 else fprintf(fff,"¡¦");
4700 if (f[1] & TR2_FREE_ACT) fprintf(fff,"¡Ü");
4701 else fprintf(fff,"¡¦");
4703 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"¡Ü");
4704 else fprintf(fff,"¡¦");
4706 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"¡Ü");
4707 else fprintf(fff,"¡¦");
4709 if (f[2] & TR3_TELEPATHY) fprintf(fff,"¡Ü");
4710 else fprintf(fff,"¡¦");
4712 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"¡Ü");
4713 else fprintf(fff,"¡¦");
4716 if (f[2] & TR3_REGEN) fprintf(fff,"¡Ü");
4717 else fprintf(fff,"¡¦");
4719 if (f[2] & TR3_FEATHER) fprintf(fff,"¡Ü");
4720 else fprintf(fff,"¡¦");
4722 if (f[1] & TR2_IM_ACID) fprintf(fff,"* ");
4723 else if (f[1] & TR2_RES_ACID) fprintf(fff,"+ ");
4724 else fprintf(fff,". ");
4726 if (f[1] & TR2_IM_ELEC) fprintf(fff,"* ");
4727 else if (f[1] & TR2_RES_ELEC) fprintf(fff,"+ ");
4728 else fprintf(fff,". ");
4730 if (f[1] & TR2_IM_FIRE) fprintf(fff,"* ");
4731 else if (f[1] & TR2_RES_FIRE) fprintf(fff,"+ ");
4732 else fprintf(fff,". ");
4734 if (f[1] & TR2_IM_COLD) fprintf(fff,"* ");
4735 else if (f[1] & TR2_RES_COLD) fprintf(fff,"+ ");
4736 else fprintf(fff,". ");
4738 if (f[1] & TR2_RES_POIS) fprintf(fff,"+ ");
4739 else fprintf(fff,". ");
4741 if (f[1] & TR2_RES_LITE) fprintf(fff,"+ ");
4742 else fprintf(fff,". ");
4744 if (f[1] & TR2_RES_DARK) fprintf(fff,"+ ");
4745 else fprintf(fff,". ");
4747 if (f[1] & TR2_RES_SHARDS) fprintf(fff,"+ ");
4748 else fprintf(fff,". ");
4750 if (f[1] & TR2_RES_SOUND) fprintf(fff,"+ ");
4751 else fprintf(fff,". ");
4753 if (f[1] & TR2_RES_NETHER) fprintf(fff,"+ ");
4754 else fprintf(fff,". ");
4756 if (f[1] & TR2_RES_NEXUS) fprintf(fff,"+ ");
4757 else fprintf(fff,". ");
4759 if (f[1] & TR2_RES_CHAOS) fprintf(fff,"+ ");
4760 else fprintf(fff,". ");
4762 if (f[1] & TR2_RES_DISEN) fprintf(fff,"+ ");
4763 else fprintf(fff,". ");
4767 if (f[1] & TR2_RES_BLIND) fprintf(fff,"+ ");
4768 else fprintf(fff,". ");
4770 if (f[1] & TR2_RES_FEAR) fprintf(fff,"+ ");
4771 else fprintf(fff,". ");
4773 if (f[1] & TR2_RES_CONF) fprintf(fff,"+ ");
4774 else fprintf(fff,". ");
4776 if (f[1] & TR2_FREE_ACT) fprintf(fff,"+ ");
4777 else fprintf(fff,". ");
4779 if (f[2] & TR3_SEE_INVIS) fprintf(fff,"+ ");
4780 else fprintf(fff,". ");
4782 if (f[1] & TR2_HOLD_LIFE) fprintf(fff,"+ ");
4783 else fprintf(fff,". ");
4785 if (f[2] & TR3_TELEPATHY) fprintf(fff,"+ ");
4786 else fprintf(fff,". ");
4788 if (f[2] & TR3_SLOW_DIGEST) fprintf(fff,"+ ");
4789 else fprintf(fff,". ");
4792 if (f[2] & TR3_REGEN) fprintf(fff,"+ ");
4793 else fprintf(fff,". ");
4795 if (f[2] & TR3_FEATHER) fprintf(fff,"+ ");
4796 else fprintf(fff,". ");
4804 fprintf(fff,"%s\n", inven_res_label);
4810 * Display *ID* ed weapons/armors's resistances
4812 static void do_cmd_knowledge_inven(void)
4817 char file_name[1024];
4828 /* Open a new file */
4829 fff = my_fopen_temp(file_name, 1024);
4832 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
4834 msg_format("Failed to create temporally file %s.", file_name);
4839 fprintf(fff,"%s\n",inven_res_label);
4841 for (tval=TV_BOW; tval <= TV_RING; tval++){
4844 for (;j<9;j++) fprintf(fff, "\n");
4846 fprintf(fff,"%s\n",inven_res_label);
4850 strcpy(where, "Áõ");
4852 strcpy(where, "E ");
4854 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4856 o_ptr = &inventory[i];
4857 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4861 strcpy(where, "»ý");
4863 strcpy(where, "I ");
4865 for (i = 0; i < INVEN_PACK; i++)
4867 o_ptr = &inventory[i];
4868 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4872 /* Print all homes in the different towns */
4873 st_ptr = &town[1].store[STORE_HOME];
4875 strcpy(where, "²È");
4877 strcpy(where, "H ");/*nanka*/
4880 /* Dump all available items */
4881 for (i = 0; i < st_ptr->stock_num; i++)
4883 o_ptr = &st_ptr->stock[i];
4884 do_cmd_knowledge_inven_aux(fff, o_ptr, &j, tval, where);
4888 /* Close the file */
4891 /* Display the file contents */
4893 show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
4895 show_file(TRUE, file_name, "Resistances of *identifyed* equipment", 0, 0);
4898 /* Remove the file */
4903 void do_cmd_save_screen_html_aux(char *filename, int message)
4907 byte a = 0, old_a = 0;
4921 char *html_head[] = {
4922 "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
4926 char *html_foot[] = {
4928 "</body>\n</html>\n",
4932 /* File type is "TEXT" */
4933 FILE_TYPE(FILE_TYPE_TEXT);
4935 /* Hack -- drop permissions */
4938 /* Append to the file */
4939 fff = my_fopen(filename, "w");
4941 /* Hack -- grab permissions */
4948 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename);
4950 msg_format("Failed to open file %s.", filename);
4957 /* Save the screen */
4961 /* Build the filename */
4962 path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
4963 tmpfff = my_fopen(buf, "r");
4965 for (i = 0; html_head[i]; i++)
4966 fprintf(fff, html_head[i]);
4970 while (!my_fgets(tmpfff, buf, 1024)) {
4972 if (strncmp(buf, tags[0], strlen(tags[0])) == 0)
4976 if (strncmp(buf, tags[1], strlen(tags[1])) == 0)
4978 fprintf(fff, "%s\n", buf);
4983 /* Dump the screen */
4984 for (y = 0; y < 24; y++)
4991 for (x = 0; x < 79; x++)
4995 /* Get the attr/char */
4996 (void)(Term_what(x, y, &a, &c));
5000 case '&': cc = "&"; break;
5001 case '<': cc = "<"; break;
5002 case '>': cc = ">"; break;
5004 case 0x1f: c = '.'; break;
5005 case 0x7f: c = (a == 0x09) ? '%' : '#'; break;
5010 if ((y == 0 && x == 0) || a != old_a) {
5011 rv = angband_color_table[a][1];
5012 gv = angband_color_table[a][2];
5013 bv = angband_color_table[a][3];
5014 fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
5015 ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
5019 fprintf(fff, "%s", cc);
5021 fprintf(fff, "%c", c);
5024 fprintf(fff, "</font>");
5027 for (i = 0; html_foot[i]; i++)
5028 fprintf(fff, html_foot[i]);
5033 while (!my_fgets(tmpfff, buf, 1024)) {
5035 if (strncmp(buf, tags[2], strlen(tags[2])) == 0)
5039 if (strncmp(buf, tags[3], strlen(tags[3])) == 0)
5041 fprintf(fff, "%s\n", buf);
5056 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5058 msg_print("Screen dump saved.");
5063 /* Restore the screen */
5069 * Hack -- save a screen dump to a file
5071 void do_cmd_save_screen_html(void)
5073 char buf[1024], tmp[256] = "screen.html";
5075 if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
5078 /* Build the filename */
5079 path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
5083 do_cmd_save_screen_html_aux(buf, 1);
5088 * Redefinable "save_screen" action
5090 void (*screendump_aux)(void) = NULL;
5094 * Hack -- save a screen dump to a file
5096 void do_cmd_save_screen(void)
5099 if (get_check("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©"))
5101 if (get_check("Save screen dump as HTML? "))
5104 do_cmd_save_screen_html();
5108 /* Do we use a special screendump function ? */
5111 /* Dump the screen to a graphics file */
5112 (*screendump_aux)();
5114 else /* Dump the screen as text */
5126 /* Build the filename */
5127 path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
5129 /* File type is "TEXT" */
5130 FILE_TYPE(FILE_TYPE_TEXT);
5132 /* Hack -- drop permissions */
5135 /* Append to the file */
5136 fff = my_fopen(buf, "w");
5138 /* Hack -- grab permissions */
5144 msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
5146 msg_format("Failed to open file %s.", buf);
5153 /* Save the screen */
5157 /* Dump the screen */
5158 for (y = 0; y < 24; y++)
5161 for (x = 0; x < 79; x++)
5163 /* Get the attr/char */
5164 (void)(Term_what(x, y, &a, &c));
5174 fprintf(fff, "%s\n", buf);
5181 /* Dump the screen */
5182 for (y = 0; y < 24; y++)
5185 for (x = 0; x < 79; x++)
5187 /* Get the attr/char */
5188 (void)(Term_what(x, y, &a, &c));
5191 buf[x] = hack[a&0x0F];
5198 fprintf(fff, "%s\n", buf);
5211 msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£");
5213 msg_print("Screen dump saved.");
5219 /* Restore the screen */
5226 * Sorting hook -- Comp function -- see below
5228 * We use "u" to point to array of monster indexes,
5229 * and "v" to select the type of sorting to perform on "u".
5231 static bool ang_sort_art_comp(vptr u, vptr v, int a, int b)
5233 u16b *who = (u16b*)(u);
5235 u16b *why = (u16b*)(v);
5243 /* Sort by total kills */
5246 /* Extract total kills */
5247 z1 = a_info[w1].tval;
5248 z2 = a_info[w2].tval;
5250 /* Compare total kills */
5251 if (z1 < z2) return (TRUE);
5252 if (z1 > z2) return (FALSE);
5256 /* Sort by monster level */
5259 /* Extract levels */
5260 z1 = a_info[w1].sval;
5261 z2 = a_info[w2].sval;
5263 /* Compare levels */
5264 if (z1 < z2) return (TRUE);
5265 if (z1 > z2) return (FALSE);
5269 /* Sort by monster experience */
5272 /* Extract experience */
5273 z1 = a_info[w1].level;
5274 z2 = a_info[w2].level;
5276 /* Compare experience */
5277 if (z1 < z2) return (TRUE);
5278 if (z1 > z2) return (FALSE);
5282 /* Compare indexes */
5288 * Sorting hook -- Swap function -- see below
5290 * We use "u" to point to array of monster indexes,
5291 * and "v" to select the type of sorting to perform.
5293 static void ang_sort_art_swap(vptr u, vptr v, int a, int b)
5295 u16b *who = (u16b*)(u);
5307 * Check the status of "artifacts"
5309 void do_cmd_knowledge_artifacts(void)
5311 int i, k, z, x, y, n = 0;
5317 char file_name[1024];
5319 char base_name[MAX_NLEN];
5323 /* Allocate the "who" array */
5324 C_MAKE(who, max_r_idx, s16b);
5326 /* Allocate the "okay" array */
5327 C_MAKE(okay, max_a_idx, bool);
5329 /* Open a new file */
5330 fff = my_fopen_temp(file_name, 1024);
5333 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5335 msg_format("Failed to create temporary file %s.", file_name);
5341 /* Scan the artifacts */
5342 for (k = 0; k < max_a_idx; k++)
5344 artifact_type *a_ptr = &a_info[k];
5349 /* Skip "empty" artifacts */
5350 if (!a_ptr->name) continue;
5352 /* Skip "uncreated" artifacts */
5353 if (!a_ptr->cur_num) continue;
5359 /* Check the dungeon */
5360 for (y = 0; y < cur_hgt; y++)
5362 for (x = 0; x < cur_wid; x++)
5364 cave_type *c_ptr = &cave[y][x];
5366 s16b this_o_idx, next_o_idx = 0;
5368 /* Scan all objects in the grid */
5369 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5373 /* Acquire object */
5374 o_ptr = &o_list[this_o_idx];
5376 /* Acquire next object */
5377 next_o_idx = o_ptr->next_o_idx;
5379 /* Ignore non-artifacts */
5380 if (!artifact_p(o_ptr)) continue;
5382 /* Ignore known items */
5383 if (object_known_p(o_ptr)) continue;
5385 /* Note the artifact */
5386 okay[o_ptr->name1] = FALSE;
5391 /* Check the inventory and equipment */
5392 for (i = 0; i < INVEN_TOTAL; i++)
5394 object_type *o_ptr = &inventory[i];
5396 /* Ignore non-objects */
5397 if (!o_ptr->k_idx) continue;
5399 /* Ignore non-artifacts */
5400 if (!artifact_p(o_ptr)) continue;
5402 /* Ignore known items */
5403 if (object_known_p(o_ptr)) continue;
5405 /* Note the artifact */
5406 okay[o_ptr->name1] = FALSE;
5409 for (k = 0; k < max_a_idx; k++)
5411 if (okay[k]) who[n++] = k;
5414 /* Select the sort method */
5415 ang_sort_comp = ang_sort_art_comp;
5416 ang_sort_swap = ang_sort_art_swap;
5418 /* Sort the array by dungeon depth of monsters */
5419 ang_sort(who, &why, n);
5421 /* Scan the artifacts */
5422 for (k = 0; k < n; k++)
5424 artifact_type *a_ptr = &a_info[who[k]];
5428 strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à");
5430 strcpy(base_name, "Unknown Artifact");
5434 /* Obtain the base object type */
5435 z = lookup_kind(a_ptr->tval, a_ptr->sval);
5443 /* Get local object */
5446 /* Create fake object */
5447 object_prep(q_ptr, z);
5449 /* Make it an artifact */
5450 q_ptr->name1 = who[k];
5452 /* Describe the artifact */
5453 object_desc_store(base_name, q_ptr, FALSE, 0);
5456 /* Hack -- Build the artifact name */
5458 fprintf(fff, " %s\n", base_name);
5460 fprintf(fff, " The %s\n", base_name);
5465 /* Close the file */
5468 /* Display the file contents */
5470 show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0);
5472 show_file(TRUE, file_name, "Artifacts Seen", 0, 0);
5476 /* Remove the file */
5482 * Display known uniques
5484 static void do_cmd_knowledge_uniques(void)
5492 char file_name[1024];
5494 /* Allocate the "who" array */
5495 C_MAKE(who, max_r_idx, s16b);
5497 /* Open a new file */
5498 fff = my_fopen_temp(file_name, 1024);
5501 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5503 msg_format("Failed to create temporary file %s.", file_name);
5509 /* Scan the monsters */
5510 for (i = 1; i < max_r_idx; i++)
5512 monster_race *r_ptr = &r_info[i];
5514 /* Use that monster */
5515 if (r_ptr->name) who[n++] = i;
5518 /* Select the sort method */
5519 ang_sort_comp = ang_sort_comp_hook;
5520 ang_sort_swap = ang_sort_swap_hook;
5522 /* Sort the array by dungeon depth of monsters */
5523 ang_sort(who, &why, n);
5525 /* Scan the monster races */
5526 for (k = 0; k < n; k++)
5528 monster_race *r_ptr = &r_info[who[k]];
5530 /* Only print Uniques */
5531 if (r_ptr->flags1 & (RF1_UNIQUE))
5533 bool dead = (r_ptr->max_num == 0);
5537 /* Only display "known" uniques */
5538 if (dead || cheat_know || r_ptr->r_sights)
5540 /* Print a message */
5542 fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n",
5543 (r_name + r_ptr->name));
5545 fprintf(fff, " %s is alive\n",
5546 (r_name + r_ptr->name));
5553 /* Close the file */
5556 /* Display the file contents */
5558 show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5560 show_file(TRUE, file_name, "Alive Uniques", 0, 0);
5564 /* Remove the file */
5570 * Display dead uniques
5572 static void do_cmd_knowledge_uniques_dead(void)
5580 char file_name[1024];
5582 /* Allocate the "who" array */
5583 C_MAKE(who, max_r_idx, s16b);
5585 /* Open a new file */
5586 fff = my_fopen_temp(file_name, 1024);
5589 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5591 msg_format("Failed to create temporary file %s.", file_name);
5597 /* Scan the monsters */
5598 for (i = 1; i < max_r_idx; i++)
5600 monster_race *r_ptr = &r_info[i];
5602 /* Use that monster */
5603 if (r_ptr->name) who[n++] = i;
5606 /* Select the sort method */
5607 ang_sort_comp = ang_sort_comp_hook;
5608 ang_sort_swap = ang_sort_swap_hook;
5610 /* Sort the array by dungeon depth of monsters */
5611 ang_sort(who, &why, n);
5613 /* Scan the monster races */
5614 for (k = 0; k < n; k++)
5616 monster_race *r_ptr = &r_info[who[k]];
5618 /* Only print Uniques */
5619 if (r_ptr->flags1 & (RF1_UNIQUE))
5621 bool dead = (r_ptr->max_num == 0);
5623 if (!dead) continue;
5625 /* Only display "known" uniques */
5626 if (dead || cheat_know || r_ptr->r_sights)
5628 /* Print a message */
5630 fprintf(fff, " %s¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡£\n",
5631 (r_name + r_ptr->name));
5633 fprintf(fff, " %s is dead\n",
5634 (r_name + r_ptr->name));
5641 /* Close the file */
5644 /* Display the file contents */
5646 show_file(TRUE, file_name, "Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0);
5648 show_file(TRUE, file_name, "Dead Uniques", 0, 0);
5652 /* Remove the file */
5658 * Display weapon-exp
5660 static void do_cmd_knowledge_weapon_exp(void)
5662 int i,j, num, shougou;
5666 char file_name[1024];
5669 /* Open a new file */
5670 fff = my_fopen_temp(file_name, 1024);
5673 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5675 msg_format("Failed to create temporary file %s.", file_name);
5681 for(i = 0; i < 5; i++)
5683 for (num = 0; num < 64; num++)
5685 for (j = 0; j < max_k_idx; j++)
5687 object_kind *k_ptr = &k_info[j];
5689 if ((k_ptr->tval == TV_SWORD-i) && (k_ptr->sval == num))
5691 if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
5693 if(weapon_exp[4-i][num]<4000) shougou=0;
5694 else if(weapon_exp[4-i][num]<6000) shougou=1;
5695 else if(weapon_exp[4-i][num]<7000) shougou=2;
5696 else if(weapon_exp[4-i][num]<8000) shougou=3;
5699 fprintf(fff,"%-25s ",tmp);
5700 if (weapon_exp[4-i][num] >= weapon_exp_settei[p_ptr->pclass][4-i][num][1]) fprintf(fff,"!");
5701 else fprintf(fff," ");
5702 fprintf(fff,"%s",shougou_moji[shougou]);
5703 if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
5711 /* Close the file */
5714 /* Display the file contents */
5716 show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0);
5718 show_file(TRUE, file_name, "Weapon Proficiency", 0, 0);
5722 /* Remove the file */
5730 static void do_cmd_knowledge_spell_exp(void)
5737 char file_name[1024];
5739 /* Open a new file */
5740 fff = my_fopen_temp(file_name, 1024);
5743 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5745 msg_format("Failed to create temporary file %s.", file_name);
5751 if(p_ptr->realm1 != REALM_NONE)
5753 fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
5754 for (i = 0; i < 32; i++)
5756 if (!is_magic(p_ptr->realm1))
5758 s_ptr = &technic_info[p_ptr->realm1 - MIN_TECHNIC - 1][i];
5762 s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
5764 if(s_ptr->slevel == 99) continue;
5765 if(spell_exp[i]<900) shougou=0;
5766 else if(spell_exp[i]<1200) shougou=1;
5767 else if(spell_exp[i]<1400) shougou=2;
5768 else if(spell_exp[i]<1600) shougou=3;
5770 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
5771 if (p_ptr->realm1 == REALM_HISSATSU)
5772 fprintf(fff,"[--]");
5775 if (shougou == 4) fprintf(fff,"!");
5776 else fprintf(fff," ");
5777 fprintf(fff,"%s",shougou_moji[shougou]);
5779 if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
5784 if(p_ptr->realm2 != REALM_NONE)
5786 fprintf(fff,"\n%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm2]);
5787 for (i = 0; i < 32; i++)
5789 if (!is_magic(p_ptr->realm1))
5791 s_ptr = &technic_info[p_ptr->realm2 - MIN_TECHNIC - 1][i];
5795 s_ptr = &mp_ptr->info[p_ptr->realm2 - 1][i];
5797 if(s_ptr->slevel == 99) continue;
5799 if(spell_exp[i+32]<900) shougou=0;
5800 else if(spell_exp[i+32]<1200) shougou=1;
5801 else if(spell_exp[i+32]<1400) shougou=2;
5803 fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
5804 if (shougou == 3) fprintf(fff,"!");
5805 else fprintf(fff," ");
5806 fprintf(fff,"%s",shougou_moji[shougou]);
5807 if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
5812 /* Close the file */
5815 /* Display the file contents */
5817 show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0);
5819 show_file(TRUE, file_name, "Spell Proficiency", 0, 0);
5823 /* Remove the file */
5831 static void do_cmd_knowledge_skill_exp(void)
5837 char file_name[1024];
5839 char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "};
5841 char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "};
5844 /* Open a new file */
5845 fff = my_fopen_temp(file_name, 1024);
5848 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
5850 msg_format("Failed to create temporary file %s.", file_name);
5856 for (i = 0; i < 3; i++)
5858 if(i == GINOU_RIDING)
5860 if(skill_exp[i]<500) shougou=0;
5861 else if(skill_exp[i]<2000) shougou=1;
5862 else if(skill_exp[i]<5000) shougou=2;
5863 else if(skill_exp[i]<8000) shougou=3;
5868 if(skill_exp[i]<4000) shougou=0;
5869 else if(skill_exp[i]<6000) shougou=1;
5870 else if(skill_exp[i]<7000) shougou=2;
5871 else if(skill_exp[i]<8000) shougou=3;
5874 fprintf(fff,"%-20s ",skill_name[i]);
5875 if (skill_exp[i] == skill_exp_settei[p_ptr->pclass][i][1]) fprintf(fff,"!");
5876 else fprintf(fff," ");
5877 fprintf(fff,"%s",shougou_moji[shougou]);
5878 if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
5882 /* Close the file */
5885 /* Display the file contents */
5887 show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0);
5889 show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0);
5893 /* Remove the file */
5899 * Pluralize a monster name
5901 void plural_aux(char *Name)
5903 int NameLen = strlen(Name);
5905 if (strstr(Name, "Disembodied hand"))
5907 strcpy(Name, "Disembodied hands that strangled people");
5909 else if (strstr(Name, "Colour out of space"))
5911 strcpy(Name, "Colours out of space");
5913 else if (strstr(Name, "stairway to hell"))
5915 strcpy(Name, "stairways to hell");
5917 else if (strstr(Name, "Dweller on the threshold"))
5919 strcpy(Name, "Dwellers on the threshold");
5921 else if (strstr(Name, " of "))
5923 cptr aider = strstr(Name, " of ");
5934 if (dummy[i-1] == 's')
5936 strcpy(&(dummy[i]), "es");
5941 strcpy(&(dummy[i]), "s");
5944 strcpy(&(dummy[i+1]), aider);
5945 strcpy(Name, dummy);
5947 else if (strstr(Name, "coins"))
5950 strcpy(dummy, "piles of ");
5951 strcat(dummy, Name);
5952 strcpy(Name, dummy);
5955 else if (strstr(Name, "Manes"))
5959 else if (streq(&(Name[NameLen - 2]), "ey"))
5961 strcpy(&(Name[NameLen - 2]), "eys");
5963 else if (Name[NameLen - 1] == 'y')
5965 strcpy(&(Name[NameLen - 1]), "ies");
5967 else if (streq(&(Name[NameLen - 4]), "ouse"))
5969 strcpy(&(Name[NameLen - 4]), "ice");
5971 else if (streq(&(Name[NameLen - 2]), "us"))
5973 strcpy(&(Name[NameLen - 2]), "i");
5975 else if (streq(&(Name[NameLen - 6]), "kelman"))
5977 strcpy(&(Name[NameLen - 6]), "kelmen");
5979 else if (streq(&(Name[NameLen - 8]), "wordsman"))
5981 strcpy(&(Name[NameLen - 8]), "wordsmen");
5983 else if (streq(&(Name[NameLen - 7]), "oodsman"))
5985 strcpy(&(Name[NameLen - 7]), "oodsmen");
5987 else if (streq(&(Name[NameLen - 7]), "eastman"))
5989 strcpy(&(Name[NameLen - 7]), "eastmen");
5991 else if (streq(&(Name[NameLen - 8]), "izardman"))
5993 strcpy(&(Name[NameLen - 8]), "izardmen");
5995 else if (streq(&(Name[NameLen - 5]), "geist"))
5997 strcpy(&(Name[NameLen - 5]), "geister");
5999 else if (streq(&(Name[NameLen - 2]), "ex"))
6001 strcpy(&(Name[NameLen - 2]), "ices");
6003 else if (streq(&(Name[NameLen - 2]), "lf"))
6005 strcpy(&(Name[NameLen - 2]), "lves");
6007 else if (suffix(Name, "ch") ||
6008 suffix(Name, "sh") ||
6009 suffix(Name, "nx") ||
6010 suffix(Name, "s") ||
6013 strcpy(&(Name[NameLen]), "es");
6017 strcpy(&(Name[NameLen]), "s");
6022 * Display current pets
6024 static void do_cmd_knowledge_pets(void)
6028 monster_type *m_ptr;
6030 int show_upkeep = 0;
6031 char file_name[1024];
6034 /* Open a new file */
6035 fff = my_fopen_temp(file_name, 1024);
6038 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6040 msg_format("Failed to create temporary file %s.", file_name);
6046 /* Process the monsters (backwards) */
6047 for (i = m_max - 1; i >= 1; i--)
6049 monster_race *r_ptr;
6050 /* Access the monster */
6053 /* Ignore "dead" monsters */
6054 if (!m_ptr->r_idx) continue;
6055 r_ptr = &r_info[m_ptr->r_idx];
6057 /* Calculate "upkeep" for pets */
6062 monster_desc(pet_name, m_ptr, 0x88);
6063 fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i));
6064 if (p_ptr->riding == i)
6066 fprintf(fff, " ¾èÇÏÃæ");
6068 fprintf(fff, " Riding");
6074 show_upkeep = calculate_upkeep();
6076 fprintf(fff, "----------------------------------------------\n");
6078 fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends);
6079 fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep);
6081 fprintf(fff, " Total: %d pet%s.\n",
6082 t_friends, (t_friends == 1 ? "" : "s"));
6083 fprintf(fff, " Upkeep: %d%% mana.\n", show_upkeep);
6088 /* Close the file */
6091 /* Display the file contents */
6093 show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0);
6095 show_file(TRUE, file_name, "Current Pets", 0, 0);
6099 /* Remove the file */
6107 * Note that the player ghosts are ignored. XXX XXX XXX
6109 static void do_cmd_knowledge_kill_count(void)
6117 char file_name[1024];
6122 /* Allocate the "who" array */
6123 C_MAKE(who, max_r_idx, s16b);
6125 /* Open a new file */
6126 fff = my_fopen_temp(file_name, 1024);
6129 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6131 msg_format("Failed to create temporary file %s.", file_name);
6138 /* Monsters slain */
6141 for (kk = 1; kk < max_r_idx; kk++)
6143 monster_race *r_ptr = &r_info[kk];
6145 if (r_ptr->flags1 & (RF1_UNIQUE))
6147 bool dead = (r_ptr->max_num == 0);
6156 s16b This = r_ptr->r_pkills;
6167 fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n");
6169 fprintf(fff,"You have defeated no enemies yet.\n\n");
6172 else if (Total == 1)
6174 fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n");
6176 fprintf(fff,"You have defeated one enemy.\n\n");
6181 fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total);
6183 fprintf(fff,"You have defeated %lu enemies.\n\n", Total);
6190 /* Scan the monsters */
6191 for (i = 1; i < max_r_idx; i++)
6193 monster_race *r_ptr = &r_info[i];
6195 /* Use that monster */
6196 if (r_ptr->name) who[n++] = i;
6199 /* Select the sort method */
6200 ang_sort_comp = ang_sort_comp_hook;
6201 ang_sort_swap = ang_sort_swap_hook;
6203 /* Sort the array by dungeon depth of monsters */
6204 ang_sort(who, &why, n);
6206 /* Scan the monster races */
6207 for (k = 0; k < n; k++)
6209 monster_race *r_ptr = &r_info[who[k]];
6211 if (r_ptr->flags1 & (RF1_UNIQUE))
6213 bool dead = (r_ptr->max_num == 0);
6217 /* Print a message */
6218 fprintf(fff, " %s\n",
6219 (r_name + r_ptr->name));
6225 s16b This = r_ptr->r_pkills;
6230 /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
6231 if(strchr("pt",r_ptr->d_char))
6232 fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
6234 fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name);
6238 if (strstr(r_name + r_ptr->name, "coins"))
6240 fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name));
6244 fprintf(fff, " 1 %s\n", (r_name + r_ptr->name));
6250 strcpy(ToPlural, (r_name + r_ptr->name));
6251 plural_aux(ToPlural);
6252 fprintf(fff, " %d %s\n", This, ToPlural);
6262 fprintf(fff,"----------------------------------------------\n");
6264 fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total);
6266 fprintf(fff," Total: %lu creature%s killed.\n",
6267 Total, (Total == 1 ? "" : "s"));
6271 /* Close the file */
6274 /* Display the file contents */
6276 show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0);
6278 show_file(TRUE, file_name, "Kill Count", 0, 0);
6282 /* Remove the file */
6288 * Display known objects
6290 static void do_cmd_knowledge_objects(void)
6296 char o_name[MAX_NLEN];
6298 char file_name[1024];
6301 /* Open a new file */
6302 fff = my_fopen_temp(file_name, 1024);
6305 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6307 msg_format("Failed to create temporary file %s.", file_name);
6313 /* Scan the object kinds */
6314 for (k = 1; k < max_k_idx; k++)
6316 object_kind *k_ptr = &k_info[k];
6318 /* Hack -- skip artifacts */
6319 if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
6321 /* List known flavored objects */
6322 if (k_ptr->flavor && k_ptr->aware)
6325 object_type object_type_body;
6327 /* Get local object */
6328 i_ptr = &object_type_body;
6330 /* Create fake object */
6331 object_prep(i_ptr, k);
6333 /* Describe the object */
6334 object_desc_store(o_name, i_ptr, FALSE, 0);
6336 /* Print a message */
6337 fprintf(fff, " %s\n", o_name);
6341 /* Close the file */
6344 /* Display the file contents */
6346 show_file(TRUE, file_name, "´ûÃΤΥ¢¥¤¥Æ¥à", 0, 0);
6348 show_file(TRUE, file_name, "Known Objects", 0, 0);
6352 /* Remove the file */
6358 * List virtues & status
6361 void do_cmd_knowledge_kubi(void)
6366 char file_name[1024];
6369 /* Open a new file */
6370 fff = my_fopen_temp(file_name, 1024);
6373 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6375 msg_format("Failed to create temporary file %s.", file_name);
6384 fprintf(fff, "º£Æü¤Î¥¿¡¼¥²¥Ã¥È : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "ÉÔÌÀ"));
6386 fprintf(fff, "¾Þ¶â¼ó¥ê¥¹¥È\n");
6388 fprintf(fff, "Today target : %s\n", (p_ptr->today_mon ? r_name + r_info[p_ptr->today_mon].name : "unknown"));
6390 fprintf(fff, "List of wanted monsters\n");
6392 for (i = 0; i < MAX_KUBI; i++)
6394 fprintf(fff,"%-40s ---- ",r_name + r_info[(kubi_r_idx[i] > 10000 ? kubi_r_idx[i] - 10000 : kubi_r_idx[i])].name);
6395 if (kubi_r_idx[i] > 10000)
6397 fprintf(fff, "ºÑ\n");
6399 fprintf(fff, "done\n");
6402 fprintf(fff, "$%d\n", 300 * (r_info[kubi_r_idx[i]].level + 1));
6406 /* Close the file */
6409 /* Display the file contents */
6411 show_file(TRUE, file_name, "¾Þ¶â¼ó¤Î°ìÍ÷", 0, 0);
6413 show_file(TRUE, file_name, "Wanted monsters", 0, 0);
6417 /* Remove the file */
6422 * List virtues & status
6425 void do_cmd_knowledge_virtues(void)
6429 char file_name[1024];
6433 /* Open a new file */
6434 fff = my_fopen_temp(file_name, 1024);
6437 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6439 msg_format("Failed to create temporary file %s.", file_name);
6448 if (p_ptr->align > 150) disp_align = "ÂçÁ±";
6449 else if (p_ptr->align > 50) disp_align = "ÃæÁ±";
6450 else if (p_ptr->align > 10) disp_align = "¾®Á±";
6451 else if (p_ptr->align > -11) disp_align = "ÃæΩ";
6452 else if (p_ptr->align > -51) disp_align = "¾®°";
6453 else if (p_ptr->align > -151) disp_align = "Ãæ°";
6454 else disp_align = "Âç°";
6455 fprintf(fff, "¸½ºß¤Î°À : %s\n", disp_align);
6458 if (p_ptr->align > 150) disp_align = "lawful";
6459 else if (p_ptr->align > 50) disp_align = "good";
6460 else if (p_ptr->align > 10) disp_align = "neutral good";
6461 else if (p_ptr->align > -11) disp_align = "neutral";
6462 else if (p_ptr->align > -51) disp_align = "neutral evil";
6463 else if (p_ptr->align > -151) disp_align = "evil";
6464 else disp_align = "chaotic";
6465 fprintf(fff, "Your alighnment : %s\n", disp_align);
6471 /* Close the file */
6474 /* Display the file contents */
6476 show_file(TRUE, file_name, "Ȭ¤Ä¤ÎÆÁ", 0, 0);
6478 show_file(TRUE, file_name, "Virtues", 0, 0);
6482 /* Remove the file */
6490 void do_cmd_knowledge_dungeon(void)
6494 char file_name[1024];
6498 /* Open a new file */
6499 fff = my_fopen_temp(file_name, 1024);
6502 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6504 msg_format("Failed to create temporary file %s.", file_name);
6512 for (i = 1; i < max_d_idx; i++)
6516 if (!d_info[i].maxdepth) continue;
6517 if (!max_dlv[i]) continue;
6518 if (d_info[i].final_guardian)
6520 if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
6522 else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
6523 fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
6527 /* Close the file */
6530 /* Display the file contents */
6532 show_file(TRUE, file_name, "º£¤Þ¤Ç¤ËÆþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó", 0, 0);
6534 show_file(TRUE, file_name, "Dungeon", 0, 0);
6538 /* Remove the file */
6543 * List virtues & status
6546 static void do_cmd_knowledge_stat(void)
6550 char file_name[1024];
6553 /* Open a new file */
6554 fff = my_fopen_temp(file_name, 1024);
6557 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6559 msg_format("Failed to create temporary file %s.", file_name);
6567 percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
6568 (2 * p_ptr->hitdie +
6569 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
6572 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : %d/100\n\n", percent);
6573 else fprintf(fff, "¸½ºß¤ÎÂÎÎÏ¥é¥ó¥¯ : ???\n\n");
6574 fprintf(fff, "ǽÎϤκÇÂçÃÍ\n\n");
6576 if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
6577 else fprintf(fff, "Your current Life Rating is ???.\n\n");
6578 fprintf(fff, "Limits of maximum stats\n\n");
6580 for (v_nr = 0; v_nr < 6; v_nr++)
6582 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);
6583 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
6589 /* Close the file */
6592 /* Display the file contents */
6594 show_file(TRUE, file_name, "¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó", 0, 0);
6596 show_file(TRUE, file_name, "HP-rate & Max stat", 0, 0);
6600 /* Remove the file */
6605 * Print quest status of all active quests
6607 static void do_cmd_knowledge_quests(void)
6610 char file_name[1024];
6612 char rand_tmp_str[120] = "\0";
6614 monster_race *r_ptr;
6616 int rand_level = 100;
6619 /* Open a new file */
6620 fff = my_fopen_temp(file_name, 1024);
6623 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
6625 msg_format("Failed to create temporary file %s.", file_name);
6632 fprintf(fff, "¡Ô¿ë¹ÔÃæ¤Î¥¯¥¨¥¹¥È¡Õ\n");
6634 fprintf(fff, "< Current Quest >\n");
6637 for (i = 1; i < max_quests; i++)
6639 /* No info from "silent" quests */
6640 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6642 if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED)
6647 /* Clear the text */
6648 for (j = 0; j < 10; j++)
6650 quest_text[j][0] = '\0';
6653 quest_text_line = 0;
6657 /* Set the quest number temporary */
6658 old_quest = p_ptr->inside_quest;
6659 p_ptr->inside_quest = i;
6661 /* Get the quest text */
6662 init_flags = INIT_SHOW_TEXT;
6664 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6666 /* Reset the old quest number */
6667 p_ptr->inside_quest = old_quest;
6669 if (quest[i].type != QUEST_TYPE_RANDOM)
6671 char note[80] = "\0";
6673 if (quest[i].status == QUEST_STATUS_TAKEN)
6675 if (quest[i].type == QUEST_TYPE_KILL_LEVEL || quest[i].type == QUEST_TYPE_KILL_ANY_LEVEL)
6677 r_ptr = &r_info[quest[i].r_idx];
6678 strcpy(name, r_name + r_ptr->name);
6679 if (quest[i].max_num > 1)
6682 sprintf(note," - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6685 sprintf(note," - kill %d %s, have killed %d.",quest[i].max_num, name, quest[i].cur_num);
6690 sprintf(note," - %s¤òÅݤ¹¡£",name);
6692 sprintf(note," - kill %s.",name);
6695 else if (quest[i].type == QUEST_TYPE_KILL_NUMBER)
6698 sprintf(note," - %d ÂΤΥâ¥ó¥¹¥¿¡¼¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)",quest[i].max_num, quest[i].max_num-quest[i].cur_num);
6700 sprintf(note," - Kill %d monsters, have killed %d.",quest[i].max_num, quest[i].cur_num);
6703 else if (quest[i].type == QUEST_TYPE_FIND_ARTIFACT)
6705 strcpy(name, a_name + a_info[quest[i].k_idx].name);
6707 sprintf(note," - %s¤ò¸«¤Ä¤±½Ð¤¹¡£", name);
6709 sprintf(note," - Find out %s.", name);
6712 else if (quest[i].type == QUEST_TYPE_FIND_EXIT)
6714 sprintf(note," - õº÷¤¹¤ë¡£");
6716 sprintf(note," - Search.");
6718 else if (quest[i].type == QUEST_TYPE_KILL_ALL)
6720 sprintf(note," - Á´¤Æ¤Î¥â¥ó¥¹¥¿¡¼¤òÅݤ¹¡£");
6722 sprintf(note," - Kill all monsters.");
6726 /* Print the quest info */
6728 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö)%s\n",
6730 sprintf(tmp_str, "%s (Danger level: %d)%s\n",
6733 quest[i].name, quest[i].level, note);
6735 fprintf(fff, tmp_str);
6737 if (quest[i].status == QUEST_STATUS_COMPLETED)
6740 sprintf(tmp_str, " ¥¯¥¨¥¹¥ÈãÀ® - ¤Þ¤ÀÊó½·¤ò¼õ¤±¤È¤Ã¤Æ¤Ê¤¤¡£\n");
6742 sprintf(tmp_str, " Quest Completed - Unrewarded\n");
6746 fprintf(fff, tmp_str);
6752 while (quest_text[j][0] && j < 10)
6754 fprintf(fff, " %s\n", quest_text[j]);
6759 else if ((quest[i].type == QUEST_TYPE_RANDOM) &&
6760 (quest[i].level < rand_level))
6763 rand_level = quest[i].level;
6765 if (max_dlv[DUNGEON_ANGBAND] >= rand_level)
6767 /* Print the quest info */
6768 r_ptr = &r_info[quest[i].r_idx];
6769 strcpy(name, r_name + r_ptr->name);
6771 if (quest[i].max_num > 1)
6774 sprintf(rand_tmp_str,"%s (%d ³¬) - %d ÂΤÎ%s¤òÅݤ¹¡£(¤¢¤È %d ÂÎ)\n",
6775 quest[i].name, quest[i].level,
6776 quest[i].max_num, name, quest[i].max_num-quest[i].cur_num);
6780 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %d %s, have killed %d.\n",
6781 quest[i].name, quest[i].level,
6782 quest[i].max_num, name, quest[i].cur_num);
6789 sprintf(rand_tmp_str,"%s (%d ³¬) - %s¤òÅݤ¹¡£\n",
6791 sprintf(rand_tmp_str,"%s (Dungeon level: %d)\n Kill %s.\n",
6794 quest[i].name, quest[i].level, name);
6801 /* Print the current random quest */
6802 if (rand_tmp_str[0]) fprintf(fff, rand_tmp_str);
6805 if (!total) fprintf(fff, "¤Ê¤·\n");
6807 if (!total) fprintf(fff, "Nothing.\n");
6811 fprintf(fff, "\n¡ÔãÀ®¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
6813 fprintf(fff, "\n< Completed Quest >\n");
6816 for (i = 1; i < max_quests; i++)
6818 /* No info from "silent" quests */
6819 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6821 if (quest[i].status == QUEST_STATUS_FINISHED)
6827 if (i < MIN_RANDOM_QUEST)
6829 /* Set the quest number temporary */
6830 old_quest = p_ptr->inside_quest;
6831 p_ptr->inside_quest = i;
6834 init_flags = INIT_ASSIGN;
6836 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6838 /* Reset the old quest number */
6839 p_ptr->inside_quest = old_quest;
6842 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
6844 /* Print the quest info */
6846 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
6848 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
6851 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
6855 /* Print the quest info */
6857 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
6859 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
6862 quest[i].name, quest[i].level, quest[i].complev);
6865 fprintf(fff, tmp_str);
6869 if (!total) fprintf(fff, "¤Ê¤·\n");
6871 if (!total) fprintf(fff, "Nothing.\n");
6875 fprintf(fff, "\n¡Ô¼ºÇÔ¤·¤¿¥¯¥¨¥¹¥È¡Õ\n");
6877 fprintf(fff, "\n< Failed Quest >\n");
6880 for (i = 1; i < max_quests; i++)
6882 /* No info from "silent" quests */
6883 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6885 if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
6891 if (i < MIN_RANDOM_QUEST)
6893 /* Set the quest number temporary */
6894 old_quest = p_ptr->inside_quest;
6895 p_ptr->inside_quest = i;
6897 /* Get the quest text */
6898 init_flags = INIT_ASSIGN;
6900 process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
6902 /* Reset the old quest number */
6903 p_ptr->inside_quest = old_quest;
6906 if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
6908 /* Print the quest info */
6910 sprintf(tmp_str, "%s (%d³¬) - ¥ì¥Ù¥ë%d\n",
6912 sprintf(tmp_str, "%s (Dungeon level: %d) - level %d\n",
6915 r_name+r_info[quest[i].r_idx].name, quest[i].level, quest[i].complev);
6919 /* Print the quest info */
6921 sprintf(tmp_str, "%s (´í¸±ÅÙ:%d³¬ÁêÅö) - ¥ì¥Ù¥ë%d\n",
6923 sprintf(tmp_str, "%s (Danger level: %d) - level %d\n",
6926 quest[i].name, quest[i].level, quest[i].complev);
6928 fprintf(fff, tmp_str);
6932 if (!total) fprintf(fff, "¤Ê¤·\n");
6934 if (!total) fprintf(fff, "Nothing.\n");
6939 fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
6941 fprintf(fff, "\n< Remaining Random Quest >\n");
6944 for (i = 1; i < max_quests; i++)
6946 /* No info from "silent" quests */
6947 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
6949 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
6953 /* Print the quest info */
6955 sprintf(tmp_str, "%s (%d³¬, %s)\n",
6957 sprintf(tmp_str, "%s (%d, %s)\n",
6960 quest[i].name, quest[i].level, r_name+r_info[quest[i].r_idx].name);
6961 fprintf(fff, tmp_str);
6964 if (!total) fprintf(fff, "¤Ê¤·\n");
6967 /* Close the file */
6970 /* Display the file contents */
6972 show_file(TRUE, file_name, "¥¯¥¨¥¹¥ÈãÀ®¾õ¶·", 0, 0);
6974 show_file(TRUE, file_name, "Quest status", 0, 0);
6978 /* Remove the file */
6988 void do_cmd_knowledge_home(void)
6993 char file_name[1024];
6995 char o_name[MAX_NLEN];
6998 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
7000 /* Open a new file */
7001 fff = my_fopen_temp(file_name, 1024);
7004 msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
7006 msg_format("Failed to create temporary file %s.", file_name);
7014 /* Print all homes in the different towns */
7015 st_ptr = &town[1].store[STORE_HOME];
7017 /* Home -- if anything there */
7018 if (st_ptr->stock_num)
7020 /* Header with name of the town */
7022 fprintf(fff, " [ ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ]\n");
7024 fprintf(fff, " [Home Inventory]\n");
7028 /* Dump all available items */
7029 for (i = 0; i < st_ptr->stock_num; i++)
7032 if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
7033 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7034 if (strlen(o_name) <= 80-3)
7036 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7042 for (n = 0, t = o_name; n < 80-3; n++, t++)
7043 if(iskanji(*t)) {t++; n++;}
7044 if (n == 81-3) n = 79-3; /* ºÇ¸å¤¬´Á»úȾʬ */
7046 fprintf(fff, "%c%s %.*s\n", I2A(i%12), paren, n, o_name);
7047 fprintf(fff, " %.77s\n", o_name+n);
7050 object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
7051 fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
7056 /* Add an empty line */
7057 fprintf(fff, "\n\n");
7061 /* Close the file */
7064 /* Display the file contents */
7066 show_file(TRUE, file_name, "²æ¤¬²È¤Î¥¢¥¤¥Æ¥à", 0, 0);
7068 show_file(TRUE, file_name, "Home Inventory", 0, 0);
7072 /* Remove the file */
7077 * Interact with "knowledge"
7079 void do_cmd_knowledge(void)
7083 /* File type is "TEXT" */
7084 FILE_TYPE(FILE_TYPE_TEXT);
7086 /* Save the screen */
7089 /* Interact until done */
7095 /* Ask for a choice */
7097 prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 2, 0);
7099 prt("Display current knowledge", 2, 0);
7103 /* Give some choices */
7105 prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 4, 5);
7106 prt("(2) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 5, 5);
7107 prt("(3) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 6, 5);
7108 prt("(4) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
7109 prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 8, 5);
7110 prt("(6) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 9, 5);
7111 prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 10, 5);
7112 prt("(8) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 11, 5);
7113 prt("(9) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 12, 5);
7114 prt("(a) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 13, 5);
7115 prt("(b) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 14, 5);
7116 prt("(c) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 15, 5);
7117 prt("(d) ¾Þ¶â¼ó ¤Î°ìÍ÷", 16, 5);
7118 prt("(e) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 17, 5);
7119 prt("(f) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 18, 5);
7120 prt("(g) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 19, 5);
7121 prt("(h) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 20, 5);
7123 prt("(1) Display known artifacts", 4, 5);
7124 prt("(2) Display known uniques", 5, 5);
7125 prt("(3) Display dead uniques", 6, 5);
7126 prt("(4) Display known objects", 7, 5);
7127 prt("(5) Display kill count", 8, 5);
7128 prt("(6) Display mutations", 9, 5);
7129 prt("(7) Display current pets", 10, 5);
7130 prt("(8) Display current quests", 11, 5);
7131 prt("(9) Display virtues", 12, 5);
7132 prt("(a) Display weapon proficiency", 13, 5);
7133 prt("(b) Display spell proficiency", 14, 5);
7134 prt("(c) Display misc. proficiency", 15, 5);
7135 prt("(d) Display wanted monsters", 16, 5);
7136 prt("(e) Display home inventory", 17, 5);
7137 prt("(f) Display *identifyed* equip.", 18, 5);
7138 prt("(g) Display about yourself", 19, 5);
7139 prt("(h) Display dungeons", 20, 5);
7144 prt("¥³¥Þ¥ó¥É:", 22, 0);
7146 prt("Command: ", 22, 0);
7154 if (i == ESCAPE) break;
7158 case '1': /* Artifacts */
7159 do_cmd_knowledge_artifacts();
7161 case '2': /* Uniques */
7162 do_cmd_knowledge_uniques();
7164 case '3': /* Uniques */
7165 do_cmd_knowledge_uniques_dead();
7167 case '4': /* Objects */
7168 do_cmd_knowledge_objects();
7170 case '5': /* Kill count */
7171 do_cmd_knowledge_kill_count();
7173 case '6': /* Mutations */
7174 do_cmd_knowledge_mutations();
7176 case '7': /* Pets */
7177 do_cmd_knowledge_pets();
7179 case '8': /* Quests */
7180 do_cmd_knowledge_quests();
7182 case '9': /* Virtues */
7183 do_cmd_knowledge_virtues();
7185 case 'a': /* weapon-exp */
7186 do_cmd_knowledge_weapon_exp();
7188 case 'b': /* spell-exp */
7189 do_cmd_knowledge_spell_exp();
7191 case 'c': /* skill-exp */
7192 do_cmd_knowledge_skill_exp();
7194 case 'd': /* skill-exp */
7195 do_cmd_knowledge_kubi();
7197 case 'e': /* skill-exp */
7198 do_cmd_knowledge_home();
7200 case 'f': /* Resist list */
7201 do_cmd_knowledge_inven();
7203 case 'g': /* Max stat */
7204 do_cmd_knowledge_stat();
7206 case 'h': /* Dungeon */
7207 do_cmd_knowledge_dungeon();
7209 default: /* Unknown option */
7213 /* Flush messages */
7217 /* Restore the screen */
7223 * Check on the status of an active quest
7225 void do_cmd_checkquest(void)
7227 /* File type is "TEXT" */
7228 FILE_TYPE(FILE_TYPE_TEXT);
7230 /* Save the screen */
7234 do_cmd_knowledge_quests();
7236 /* Restore the screen */
7242 * Display the time and date
7244 void do_cmd_time(void)
7246 int day, hour, min, full, start, end, num;
7253 s32b len = 20L * TOWN_DAWN;
7254 s32b tick = turn % len + len / 4;
7256 if ((p_ptr->prace == RACE_VAMPIRE) ||
7257 (p_ptr->prace == RACE_SKELETON) ||
7258 (p_ptr->prace == RACE_ZOMBIE) ||
7259 (p_ptr->prace == RACE_SPECTRE))
7260 day = (turn - (15L * TOWN_DAWN))/ len + 1;
7262 day = (turn + (5L * TOWN_DAWN))/ len + 1;
7263 hour = (24 * tick / len) % 24;
7264 min = (1440 * tick / len) % 60;
7265 full = hour * 100 + min;
7273 strcpy(desc, "ÊѤʻþ¹ï¤À¡£");
7275 strcpy(desc, "It is a strange time.");
7281 msg_format("%d ÆüÌÜ,»þ¹ï¤Ï%d:%02d %s¤Ç¤¹¡£",
7283 msg_format("This is day %d. The time is %d:%02d %s.",
7286 day, (hour % 12 == 0) ? 12 : (hour % 12),
7287 min, (hour < 12) ? "AM" : "PM");
7290 if (!rand_int(10) || p_ptr->image)
7293 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
7295 path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun.txt");
7302 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm_j.txt");
7304 path_build(buf, 1024, ANGBAND_DIR_FILE, "timenorm.txt");
7309 /* Open this file */
7310 fff = my_fopen(buf, "rt");
7315 /* Find this time */
7316 while (!my_fgets(fff, buf, 1024))
7318 /* Ignore comments */
7319 if (!buf[0] || (buf[0] == '#')) continue;
7321 /* Ignore invalid lines */
7322 if (buf[1] != ':') continue;
7324 /* Process 'Start' */
7327 /* Extract the starting time */
7328 start = atoi(buf + 2);
7330 /* Assume valid for an hour */
7340 /* Extract the ending time */
7341 end = atoi(buf + 2);
7347 /* Ignore incorrect range */
7348 if ((start > full) || (full > end)) continue;
7350 /* Process 'Description' */
7355 /* Apply the randomizer */
7356 if (!rand_int(num)) strcpy(desc, buf + 2);
7366 /* Close the file */