#include "angband.h"
+
+/*
+ * mark strings for auto dump
+ */
+static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
+static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
+
+/*
+ * Remove old lines automatically generated before.
+ */
+static void remove_auto_dump(cptr orig_file, cptr mark)
+{
+ FILE *tmp_fff, *orig_fff;
+
+ char tmp_file[1024];
+ char buf[1024];
+ bool between_mark = FALSE;
+ bool success = FALSE;
+ int line_num = 0;
+ long header_location = 0;
+ char header_mark_str[80];
+ char footer_mark_str[80];
+ size_t mark_len;
+
+ sprintf(header_mark_str, auto_dump_header, mark);
+ sprintf(footer_mark_str, auto_dump_footer, mark);
+
+ mark_len = strlen(footer_mark_str);
+
+ /* If original file is not exist, nothing to do */
+ orig_fff = my_fopen(orig_file, "r");
+ if (!orig_fff)
+ {
+ return;
+ }
+
+ /* Open a new file */
+ tmp_fff = my_fopen_temp(tmp_file, 1024);
+ if (!tmp_fff) {
+#ifdef JP
+ msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
+#else
+ msg_format("Failed to create temporary file %s.", tmp_file);
+#endif
+ msg_print(NULL);
+ return;
+ }
+
+ while (1)
+ {
+ if (my_fgets(orig_fff, buf, 1024))
+ {
+ if (between_mark)
+ {
+ fseek(orig_fff, header_location, SEEK_SET);
+ between_mark = FALSE;
+ continue;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if (!between_mark)
+ {
+ if (!strcmp(buf, header_mark_str))
+ {
+ header_location = ftell(orig_fff);
+ line_num = 0;
+ between_mark = TRUE;
+ success = TRUE;
+ }
+ else
+ {
+ fprintf(tmp_fff, "%s\n", buf);
+ }
+ }
+ else
+ {
+ if (!strncmp(buf, footer_mark_str, mark_len))
+ {
+ int tmp;
+
+ if (!sscanf(buf + mark_len, " (%d)", &tmp)
+ || tmp != line_num)
+ {
+ fseek(orig_fff, header_location, SEEK_SET);
+ }
+
+ between_mark = FALSE;
+ }
+ else
+ {
+ line_num++;
+ }
+ }
+ }
+ my_fclose(orig_fff);
+ my_fclose(tmp_fff);
+
+ if (success)
+ {
+ /* copy contents of temporally file */
+
+ tmp_fff = my_fopen(tmp_file, "r");
+ orig_fff = my_fopen(orig_file, "w");
+
+ while (!my_fgets(tmp_fff, buf, 1024))
+ fprintf(orig_fff, "%s\n", buf);
+
+ my_fclose(orig_fff);
+ my_fclose(tmp_fff);
+ }
+ fd_kill(tmp_file);
+
+ return;
+}
+
+/*
+ * Open file to append auto dump.
+ */
+static FILE *open_auto_dump(cptr buf, cptr mark, int *line)
+{
+ FILE *fff;
+
+ char header_mark_str[80];
+
+ /* Drop priv's */
+ safe_setuid_drop();
+
+ sprintf(header_mark_str, auto_dump_header, mark);
+
+ /* Remove old macro dumps */
+ remove_auto_dump(buf, mark);
+
+ /* Append to the file */
+ fff = my_fopen(buf, "a");
+
+ /* Failure */
+ if (!fff) {
+#ifdef JP
+ msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
+#else
+ msg_format("Failed to open %s.", buf);
+#endif
+ msg_print(NULL);
+
+ /* Grab priv's */
+ safe_setuid_grab();
+
+ return NULL;
+ }
+
+ /* Start dumping */
+ fprintf(fff, "%s\n", header_mark_str);
+
+#ifdef JP
+ fprintf(fff, "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
+ fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
+#else
+ fprintf(fff, "# *Warning!!* The lines below are automatic dump.\n");
+ fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
+#endif
+ *line = 2;
+
+ return fff;
+}
+
+/*
+ * Append foot part and close auto dump.
+ */
+static void close_auto_dump(FILE *fff, cptr mark, int line_num)
+{
+ char footer_mark_str[80];
+
+ sprintf(footer_mark_str, auto_dump_footer, mark);
+
+ /* End of dumping */
+#ifdef JP
+ fprintf(fff, "# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n");
+ fprintf(fff, "# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n");
+#else
+ fprintf(fff, "# *Warning!!* The lines above are automatic dump.\n");
+ fprintf(fff, "# *Warning!!* Don't edit these! These lines will be deleted automaticaly.\n");
+#endif
+ line_num += 2;
+
+ fprintf(fff, "%s (%d)\n", footer_mark_str, line_num);
+
+ my_fclose(fff);
+
+ /* Grab priv's */
+ safe_setuid_grab();
+
+ return;
+}
+
+
+/*
+ * Take note to the dialy.
+ */
+
errr do_cmd_write_nikki(int type, int num, cptr note)
{
int day, hour, min;
cptr note_level = "";
bool do_level = TRUE;
- s32b len = 20L * TOWN_DAWN;
- s32b tick = turn % len + len / 4;
-
static bool disable_nikki = FALSE;
- if (disable_nikki) return(-1);
+ extract_day_hour_min(&day, &hour, &min);
- if ((p_ptr->prace == RACE_VAMPIRE) ||
- (p_ptr->prace == RACE_SKELETON) ||
- (p_ptr->prace == RACE_ZOMBIE) ||
- (p_ptr->prace == RACE_SPECTRE))
- day = (turn - (15L * TOWN_DAWN))/ len + 1;
- else
- day = (turn + (5L * TOWN_DAWN))/ len + 1;
-
- hour = (24 * tick / len) % 24;
- min = (1440 * tick / len) % 60;
+ if (disable_nikki) return(-1);
if (type == NIKKI_FIX_QUEST_C ||
type == NIKKI_FIX_QUEST_F ||
sprintf(file_name,"playrec-%s.txt",savefile_base);
#endif
+ /* Hack -- drop permissions */
+ safe_setuid_drop();
+
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
fff = my_fopen(buf, "a");
/* Failure */
- if (!fff) {
+ if (!fff)
+ {
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
#ifdef JP
msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf);
#else
}
case NIKKI_ARENA:
{
+ if (num == 99)
+ {
+
+#ifdef JP
+ fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, p_ptr->arena_number + 1, note);
+#else
+ int n = p_ptr->arena_number + 1;
+ fprintf(fff, " %2d:%02d %20s beaten by %s in the %d%s fight.\n", hour, min, note_level, note, n, (n%10==1?"st":n%10==2?"nd":n%10==3?"rd":"th"));
+#endif
+ break;
+ }
#ifdef JP
fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note);
#else
my_fclose(fff);
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
+
if (do_level) write_level = FALSE;
return (0);
sprintf(file_name,"playrec-%s.txt",savefile_base);
#endif
+ /* Hack -- drop permissions */
+ safe_setuid_drop();
+
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_MONK || p_ptr->pclass == CLASS_SAMURAI || p_ptr->pclass == CLASS_BERSERKER)
- strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)]);
+ strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
else if (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
- strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-1)+1]);
- else strcpy(tmp,subtitle[rand_int(MAX_SUBTITLE-2)+1]);
+ strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
+ else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
#ifdef JP
sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×",
/* Display the file contents */
show_file(FALSE, buf, nikki_title, -1, 0);
+
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
}
static void do_cmd_bunshou(void)
sprintf(file_name,"playrec-%s.txt",savefile_base);
#endif
+ /* Hack -- drop permissions */
+ safe_setuid_drop();
+
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, file_name);
#endif
}
msg_print(NULL);
+
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
}
#if 0
char shower[80];
char finder[80];
+ int wid, hgt;
+ /* Get size */
+ Term_get_size(&wid, &hgt);
+
/* Wipe finder */
strcpy(finder, "");
Term_clear();
/* Dump up to 20 lines of messages */
- for (j = 0; (j < 20) && (i + j < n); j++)
+ for (j = 0; (j < hgt - 4) && (i + j < n); j++)
{
cptr msg = message_str(i+j);
msg = (strlen(msg) >= q) ? (msg + q) : "";
/* Dump the messages, bottom to top */
- Term_putstr(0, 21-j, -1, (i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
+ Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg);
/* Hilite "shower" */
if (shower[0])
int len = strlen(shower);
/* Display the match */
- Term_putstr(str-msg, 21-j, len, TERM_YELLOW, shower);
+ Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower);
/* Advance */
str += len;
/* Display prompt (not very informative) */
#ifdef JP
- prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", 23, 0);
+ prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0);
#else
- prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", 23, 0);
+ prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0);
#endif
{
/* Prompt */
#ifdef JP
- prt("¶¯Ä´: ", 23, 0);
+ prt("¶¯Ä´: ", hgt - 1, 0);
#else
- prt("Show: ", 23, 0);
+ prt("Show: ", hgt - 1, 0);
#endif
/* Prompt */
#ifdef JP
- prt("¸¡º÷: ", 23, 0);
+ prt("¸¡º÷: ", hgt - 1, 0);
#else
- prt("Find: ", 23, 0);
+ prt("Find: ", hgt - 1, 0);
#endif
case 'Y':
case '6':
{
- if(!noscore)
+ if(!p_ptr->noscore)
#ifdef JP
do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
#else
do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options.");
#endif
- noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
+ p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
(*cheat_info[k].o_var) = TRUE;
k = (k + 1) % n;
break;
Term_clear();
#ifdef JP
- if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 7, 6);
+ if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 4, 6);
#else
- if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 7, 3);
+ if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 4, 3);
#endif
/* Interact with the player */
#endif
option_info[opt[i]].o_text);
- if ((page == PAGE_AUTODESTROY) && i > 3) c_prt(a, buf, i + 5, 0);
+ if ((page == PAGE_AUTODESTROY) && i > 0) c_prt(a, buf, i + 5, 0);
else c_prt(a, buf, i + 2, 0);
}
- if ((page == PAGE_AUTODESTROY) && (k > 3)) l = 3;
+ if ((page == PAGE_AUTODESTROY) && (k > 0)) l = 3;
else l = 0;
/* Hilite current option */
move_cursor(k + 2 + l, 50);
prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6, 5);
prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7, 5);
prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 8, 5);
- prt("(6) ¥¢¥¤¥Æ¥à¼«Æ°½¦¤¤/Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
+ prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 9, 5);
prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 10, 5);
/* Special choices */
prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 12, 5);
prt("(3) Game-Play Options", 6, 5);
prt("(4) Disturbance Options", 7, 5);
prt("(5) Efficiency Options", 8, 5);
- prt("(6) Object Auto-Pick/Destroy Options", 9, 5);
+ prt("(6) Easy Auto-Destroyer Options", 9, 5);
prt("(R) Play-record Options", 10, 5);
/* Special choices */
{
/* Spawn */
#ifdef JP
- do_cmd_options_aux(7, "¥¢¥¤¥Æ¥à¼«Æ°½¦¤¤/Ç˲õ¥ª¥×¥·¥ç¥ó");
+ do_cmd_options_aux(7, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
#else
- do_cmd_options_aux(7, "Object Auto-Pick/Destroy Options");
+ do_cmd_options_aux(7, "Easy Auto-Destroyer Options");
#endif
break;
}
void do_cmd_pickpref(void)
{
char buf[80];
- errr err = -1;
- int i;
+ errr err;
#ifdef JP
if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
#else
if(!get_check("Reload auto-pick preference file? ")) return;
#endif
- /* ¤¤¤Þ¤Þ¤Ç»È¤Ã¤Æ¤¤¤¿¥á¥â¥ê²òÊü */
- for( i = 0; i < max_autopick; i++){
- free(autopick_name[i]);
- free(autopick_insc[i]);
- }
- max_autopick = 0;
+
+ /* Free old entries */
+ init_autopicker();
/* ¥¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
#ifdef JP
#else
sprintf(buf, "pickpref-%s.prf", player_name);
#endif
- if( process_pickpref_file(buf) == 0 ){
- err = 0;
+ err = process_pickpref_file(buf);
+
+ if(err == 0)
+ {
#ifdef JP
msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
#else
}
/* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
+
+ /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
+ if (0 > err)
+ {
#ifdef JP
- if( process_pickpref_file("picktype.prf") == 0 )
+ err = process_pickpref_file("picktype.prf");
#else
- if( process_pickpref_file("pickpref.prf") == 0 )
+ err = process_pickpref_file("pickpref.prf");
#endif
- {
- err = 0;
+
+ if(err == 0)
+ {
#ifdef JP
- msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
+ msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
#else
- msg_print("loaded 'pickpref.prf'.");
+ msg_print("loaded 'pickpref.prf'.");
#endif
+ }
}
+
#ifdef JP
if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
#else
*/
static errr macro_dump(cptr fname)
{
- int i;
+ static cptr mark = "Macro Dump";
+
+ int i, line_num;
FILE *fff;
char buf[1024];
-
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, fname);
FILE_TYPE(FILE_TYPE_TEXT);
/* Append to the file */
- fff = my_fopen(buf, "a");
-
- /* Failure */
- if (!fff) {
-#ifdef JP
- msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
-#else
- msg_format("Failed to open %s.", buf);
-#endif
- msg_print(NULL);
- return (-1);
- }
-
-
- /* Skip space */
- fprintf(fff, "\n\n");
+ fff = open_auto_dump(buf, mark, &line_num);
+ if (!fff) return (-1);
/* Start dumping */
#ifdef JP
- fprintf(fff, "# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
+ fprintf(fff, "\n# ¼«Æ°¥Þ¥¯¥í¥»¡¼¥Ö\n\n");
#else
- fprintf(fff, "# Automatic macro dump\n\n");
+ fprintf(fff, "\n# Automatic macro dump\n\n");
#endif
-
+ line_num += 3;
/* Dump them */
for (i = 0; i < macro__num; i++)
{
- /* Start the macro */
-#ifdef JP
- fprintf(fff, "# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
-#else
- fprintf(fff, "# Macro '%d'\n\n", i);
-#endif
-
-
/* Extract the action */
ascii_to_text(buf, macro__act[i]);
fprintf(fff, "P:%s\n", buf);
/* End the macro */
- fprintf(fff, "\n\n");
- }
-
- /* Start dumping */
- fprintf(fff, "\n\n\n\n");
+ fprintf(fff, "\n");
+ /* count number of lines */
+ line_num += 3;
+ }
/* Close */
- my_fclose(fff);
+ close_auto_dump(fff, mark, line_num);
/* Success */
return (0);
*/
static errr keymap_dump(cptr fname)
{
+ static cptr mark = "Keymap Dump";
+ int line_num;
int i;
FILE *fff;
int mode;
-
/* Roguelike */
if (rogue_like_commands)
{
FILE_TYPE(FILE_TYPE_TEXT);
/* Append to the file */
- fff = my_fopen(buf, "a");
-
- /* Failure */
- if (!fff) {
-#ifdef JP
- msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
-#else
- msg_format("Failed to open %s.", buf);
-#endif
- msg_print(NULL);
- return (-1);
- }
-
-
- /* Skip space */
- fprintf(fff, "\n\n");
+ fff = open_auto_dump(buf, mark, &line_num);
+ if (!fff) return -1;
/* Start dumping */
#ifdef JP
- fprintf(fff, "# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
+ fprintf(fff, "\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n");
#else
- fprintf(fff, "# Automatic keymap dump\n\n");
+ fprintf(fff, "\n# Automatic keymap dump\n\n");
#endif
-
+ line_num += 3;
/* Dump them */
for (i = 0; i < 256; i++)
/* Dump the macro */
fprintf(fff, "A:%s\n", buf);
fprintf(fff, "C:%d:%s\n", mode, key);
+ line_num += 2;
}
- /* Start dumping */
- fprintf(fff, "\n\n\n");
-
-
/* Close */
- my_fclose(fff);
+ close_auto_dump(fff, mark, line_num);
/* Success */
return (0);
/* Load a 'macro' file */
else if (i == '1')
{
+ errr err;
+
/* Prompt */
#ifdef JP
prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
if (!askfor_aux(tmp, 80)) continue;
/* Process the given filename */
- if (0 != process_pref_file(tmp))
+ err = process_pref_file(tmp);
+ if (-2 == err)
+ {
+#ifdef JP
+ msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
+#else
+ msg_format("Loaded default '%s'.", tmp);
+#endif
+ }
+ else if (err)
{
/* Prompt */
#ifdef JP
- msg_print("¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤á¤Þ¤»¤ó¤Ç¤·¤¿¡ª");
+ msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
#else
- msg_print("Could not load file!");
+ msg_format("Failed to load '%s'!");
+#endif
+ }
+ else
+ {
+#ifdef JP
+ msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
+#else
+ msg_format("Loaded '%s'.", tmp);
#endif
-
}
}
/* Ask for a file */
if (!askfor_aux(tmp, 80)) continue;
- /* Drop priv's */
- safe_setuid_drop();
-
/* Dump the macros */
(void)macro_dump(tmp);
- /* Grab priv's */
- safe_setuid_grab();
-
/* Prompt */
#ifdef JP
msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£");
/* Ask for a file */
if (!askfor_aux(tmp, 80)) continue;
- /* Drop priv's */
- safe_setuid_drop();
-
/* Dump the macros */
(void)keymap_dump(tmp);
- /* Grab priv's */
- safe_setuid_grab();
-
/* Prompt */
#ifdef JP
msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£");
}
+static void cmd_visuals_aux(int i, int *num, int max)
+{
+ if (iscntrl(i))
+ {
+ char str[10] = "";
+ int tmp;
+
+ sprintf(str, "%d", *num);
+
+ if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
+ return;
+
+ tmp = strtol(str, NULL, 0);
+ if (tmp >= 0 && tmp < max)
+ *num = tmp;
+ return;
+ }
+ else if (isupper(i))
+ *num = (*num + max - 1) % max;
+ else
+ *num = (*num + 1) % max;
+
+ return;
+}
+
/*
* Interact with "visuals"
*/
/* Dump monster attr/chars */
else if (i == '2')
{
+ static cptr mark = "Monster attr/chars";
+ int line_num;
+
/* Prompt */
#ifdef JP
prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
- /* Drop priv's */
- safe_setuid_drop();
-
/* Append to the file */
- fff = my_fopen(buf, "a");
-
- /* Grab priv's */
- safe_setuid_grab();
-
- /* Failure */
- if (!fff) {
-#ifdef JP
- msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
-#else
- msg_format("Failed to open %s.", buf);
-#endif
- msg_print(NULL);
- continue;
- }
+ fff = open_auto_dump(buf, mark, &line_num);
+ if (!fff) continue;
/* Start dumping */
- fprintf(fff, "\n\n");
#ifdef JP
- fprintf(fff, "# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
+ fprintf(fff, "\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
#else
- fprintf(fff, "# Monster attr/char definitions\n\n");
+ fprintf(fff, "\n# Monster attr/char definitions\n\n");
#endif
-
+ line_num += 3;
/* Dump monsters */
for (i = 0; i < max_r_idx; i++)
/* Dump a comment */
fprintf(fff, "# %s\n", (r_name + r_ptr->name));
-
+ line_num++;
/* Dump the monster attr/char info */
fprintf(fff, "R:%d:0x%02X:0x%02X\n\n", i,
(byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
+ line_num += 2;
}
- /* All done */
- fprintf(fff, "\n\n\n\n");
-
/* Close */
- my_fclose(fff);
+ close_auto_dump(fff, mark, line_num);
/* Message */
#ifdef JP
/* Dump object attr/chars */
else if (i == '3')
{
+ static cptr mark = "Object attr/chars";
+ int line_num;
+
/* Prompt */
#ifdef JP
prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
- /* Drop priv's */
- safe_setuid_drop();
-
/* Append to the file */
- fff = my_fopen(buf, "a");
-
- /* Grab priv's */
- safe_setuid_grab();
-
- /* Failure */
- if (!fff) {
-#ifdef JP
- msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
-#else
- msg_format("Failed to open %s.", buf);
-#endif
- msg_print(NULL);
- continue;
- }
+ fff = open_auto_dump(buf, mark, &line_num);
+ if (!fff) continue;
/* Start dumping */
- fprintf(fff, "\n\n");
#ifdef JP
- fprintf(fff, "# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
+ fprintf(fff, "\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
#else
- fprintf(fff, "# Object attr/char definitions\n\n");
+ fprintf(fff, "\n# Object attr/char definitions\n\n");
#endif
-
+ line_num += 3;
/* Dump objects */
for (i = 0; i < max_k_idx; i++)
/* Dump a comment */
fprintf(fff, "# %s\n", (k_name + k_ptr->name));
-
+ line_num++;
/* Dump the object attr/char info */
fprintf(fff, "K:%d:0x%02X:0x%02X\n\n", i,
(byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
+ line_num += 2;
}
- /* All done */
- fprintf(fff, "\n\n\n\n");
-
/* Close */
- my_fclose(fff);
+ close_auto_dump(fff, mark, line_num);
/* Message */
#ifdef JP
/* Dump feature attr/chars */
else if (i == '4')
{
+ static cptr mark = "Feature attr/chars";
+ int line_num;
+
/* Prompt */
#ifdef JP
prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0);
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
- /* Drop priv's */
- safe_setuid_drop();
-
/* Append to the file */
- fff = my_fopen(buf, "a");
-
- /* Grab priv's */
- safe_setuid_grab();
-
- /* Failure */
- if (!fff) {
-#ifdef JP
- msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
-#else
- msg_format("Failed to open %s.", buf);
-#endif
- msg_print(NULL);
- continue;
- }
+ fff = open_auto_dump(buf, mark, &line_num);
+ if (!fff) continue;
/* Start dumping */
- fprintf(fff, "\n\n");
#ifdef JP
- fprintf(fff, "# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
+ fprintf(fff, "\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n");
#else
- fprintf(fff, "# Feature attr/char definitions\n\n");
+ fprintf(fff, "\n# Feature attr/char definitions\n\n");
#endif
-
+ line_num += 3;
/* Dump features */
for (i = 0; i < max_f_idx; i++)
/* Dump a comment */
fprintf(fff, "# %s\n", (f_name + f_ptr->name));
+ line_num++;
/* Dump the feature attr/char info */
fprintf(fff, "F:%d:0x%02X:0x%02X\n\n", i,
(byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
+ line_num += 2;
}
- /* All done */
- fprintf(fff, "\n\n\n\n");
-
/* Close */
- my_fclose(fff);
+ close_auto_dump(fff, mark, line_num);
/* Message */
#ifdef JP
while (1)
{
monster_race *r_ptr = &r_info[r];
+ char c;
+ int t;
byte da = (r_ptr->d_attr);
- char dc = (r_ptr->d_char);
+ byte dc = (r_ptr->d_char);
byte ca = (r_ptr->x_attr);
- char cc = (r_ptr->x_char);
+ byte cc = (r_ptr->x_char);
/* Label the object */
#ifdef JP
Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
Term_putch(43, 19, da, dc);
+ if (use_bigtile)
+ {
+ if (da & 0x80)
+ Term_putch(44, 19, 255, -1);
+ else
+ Term_putch(44, 19, 0, ' ');
+ }
/* Label the Current values */
#ifdef JP
Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
Term_putch(43, 20, ca, cc);
+ if (use_bigtile)
+ {
+ if (ca & 0x80)
+ Term_putch(44, 20, 255, -1);
+ else
+ Term_putch(44, 20, 0, ' ');
+ }
/* Prompt */
#ifdef JP
Term_putstr(0, 22, -1, TERM_WHITE,
- "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
+ "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
#else
Term_putstr(0, 22, -1, TERM_WHITE,
- "Command (n/N/a/A/c/C): ");
+ "Command (n/N/^N/a/A/^A/c/C/^C): ");
#endif
-
/* Get a command */
i = inkey();
/* All done */
if (i == ESCAPE) break;
- /* Analyze */
- if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx;
- if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx;
- if (i == 'a') r_ptr->x_attr = (byte)(ca + 1);
- if (i == 'A') r_ptr->x_attr = (byte)(ca - 1);
- if (i == 'c') r_ptr->x_char = (byte)(cc + 1);
- if (i == 'C') r_ptr->x_char = (byte)(cc - 1);
+ if (iscntrl(i)) c = 'a' + i - KTRL('A');
+ else if (isupper(i)) c = 'a' + i - 'A';
+ else c = i;
+
+ switch (c)
+ {
+ case 'n':
+ cmd_visuals_aux(i, &r, max_r_idx);
+ break;
+ case 'a':
+ t = (int)r_ptr->x_attr;
+ cmd_visuals_aux(i, &t, 256);
+ r_ptr->x_attr = (byte)t;
+ break;
+ case 'c':
+ t = (int)r_ptr->x_char;
+ cmd_visuals_aux(i, &t, 256);
+ r_ptr->x_char = (byte)t;
+ break;
+ }
}
}
while (1)
{
object_kind *k_ptr = &k_info[k];
+ char c;
+ int t;
byte da = (byte)k_ptr->d_attr;
- char dc = (byte)k_ptr->d_char;
+ byte dc = (byte)k_ptr->d_char;
byte ca = (byte)k_ptr->x_attr;
- char cc = (byte)k_ptr->x_char;
+ byte cc = (byte)k_ptr->x_char;
/* Label the object */
#ifdef JP
Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
Term_putch(43, 19, da, dc);
+ if (use_bigtile)
+ {
+ if (da & 0x80)
+ Term_putch(44, 19, 255, -1);
+ else
+ Term_putch(44, 19, 0, ' ');
+ }
/* Label the Current values */
#ifdef JP
Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
Term_putch(43, 20, ca, cc);
+ if (use_bigtile)
+ {
+ if (ca & 0x80)
+ Term_putch(44, 20, 255, -1);
+ else
+ Term_putch(44, 20, 0, ' ');
+ }
/* Prompt */
#ifdef JP
Term_putstr(0, 22, -1, TERM_WHITE,
- "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
+ "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
#else
Term_putstr(0, 22, -1, TERM_WHITE,
- "Command (n/N/a/A/c/C): ");
+ "Command (n/N/^N/a/A/^A/c/C/^C): ");
#endif
-
/* Get a command */
i = inkey();
/* All done */
if (i == ESCAPE) break;
- /* Analyze */
- if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx;
- if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx;
- if (i == 'a') k_info[k].x_attr = (byte)(ca + 1);
- if (i == 'A') k_info[k].x_attr = (byte)(ca - 1);
- if (i == 'c') k_info[k].x_char = (byte)(cc + 1);
- if (i == 'C') k_info[k].x_char = (byte)(cc - 1);
+ if (iscntrl(i)) c = 'a' + i - KTRL('A');
+ else if (isupper(i)) c = 'a' + i - 'A';
+ else c = i;
+
+ switch (c)
+ {
+ case 'n':
+ cmd_visuals_aux(i, &k, max_k_idx);
+ break;
+ case 'a':
+ t = (int)k_info[k].x_attr;
+ cmd_visuals_aux(i, &t, 256);
+ k_info[k].x_attr = (byte)t;
+ break;
+ case 'c':
+ t = (int)k_info[k].x_char;
+ cmd_visuals_aux(i, &t, 256);
+ k_info[k].x_char = (byte)t;
+ break;
+ }
}
}
while (1)
{
feature_type *f_ptr = &f_info[f];
+ char c;
+ int t;
byte da = (byte)f_ptr->d_attr;
- char dc = (byte)f_ptr->d_char;
+ byte dc = (byte)f_ptr->d_char;
byte ca = (byte)f_ptr->x_attr;
- char cc = (byte)f_ptr->x_char;
+ byte cc = (byte)f_ptr->x_char;
/* Label the object */
#ifdef JP
Term_putstr(40, 19, -1, TERM_WHITE, "<< ? >>");
Term_putch(43, 19, da, dc);
+ if (use_bigtile)
+ {
+ if (da & 0x80)
+ Term_putch(44, 19, 255, -1);
+ else
+ Term_putch(44, 19, 0, ' ');
+ }
/* Label the Current values */
#ifdef JP
Term_putstr(40, 20, -1, TERM_WHITE, "<< ? >>");
Term_putch(43, 20, ca, cc);
+ if (use_bigtile)
+ {
+ if (ca & 0x80)
+ Term_putch(44, 20, 255, -1);
+ else
+ Term_putch(44, 20, 0, ' ');
+ }
/* Prompt */
#ifdef JP
Term_putstr(0, 22, -1, TERM_WHITE,
- "¥³¥Þ¥ó¥É (n/N/a/A/c/C): ");
+ "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
#else
Term_putstr(0, 22, -1, TERM_WHITE,
- "Command (n/N/a/A/c/C): ");
+ "Command (n/N/^N/a/A/^A/c/C/^C): ");
#endif
-
/* Get a command */
i = inkey();
/* All done */
if (i == ESCAPE) break;
- /* Analyze */
- if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx;
- if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx;
- if (i == 'a') f_info[f].x_attr = (byte)(ca + 1);
- if (i == 'A') f_info[f].x_attr = (byte)(ca - 1);
- if (i == 'c') f_info[f].x_char = (byte)(cc + 1);
- if (i == 'C') f_info[f].x_char = (byte)(cc - 1);
+ if (iscntrl(i)) c = 'a' + i - KTRL('A');
+ else if (isupper(i)) c = 'a' + i - 'A';
+ else c = i;
+
+ switch (c)
+ {
+ case 'n':
+ cmd_visuals_aux(i, &f, max_f_idx);
+ break;
+ case 'a':
+ t = (int)f_info[f].x_attr;
+ cmd_visuals_aux(i, &t, 256);
+ f_info[f].x_attr = (byte)t;
+ break;
+ case 'c':
+ t = (int)f_info[f].x_char;
+ cmd_visuals_aux(i, &t, 256);
+ f_info[f].x_char = (byte)t;
+ break;
+ }
}
}
/* Dump colors */
else if (i == '2')
{
+ static cptr mark = "Colors";
+ int line_num;
+
/* Prompt */
#ifdef JP
prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0);
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, tmp);
- /* Drop priv's */
- safe_setuid_drop();
-
/* Append to the file */
- fff = my_fopen(buf, "a");
-
- /* Grab priv's */
- safe_setuid_grab();
-
- /* Failure */
- if (!fff) {
-#ifdef JP
- msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
-#else
- msg_format("Failed to open %s.", buf);
-#endif
- msg_print(NULL);
- continue;
- }
+ fff = open_auto_dump(buf, mark, &line_num);
+ if (!fff) continue;
/* Start dumping */
- fprintf(fff, "\n\n");
#ifdef JP
- fprintf(fff, "# ¥«¥é¡¼¤ÎÀßÄê\n\n");
+ fprintf(fff, "\n# ¥«¥é¡¼¤ÎÀßÄê\n\n");
#else
- fprintf(fff, "# Color redefinitions\n\n");
+ fprintf(fff, "\n# Color redefinitions\n\n");
#endif
-
+ line_num += 3;
/* Dump colors */
for (i = 0; i < 256; i++)
#else
fprintf(fff, "# Color '%s'\n", name);
#endif
-
+ line_num++;
/* Dump the monster attr/char info */
fprintf(fff, "V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
i, kv, rv, gv, bv);
+ line_num += 2;
}
- /* All done */
- fprintf(fff, "\n\n\n\n");
-
/* Close */
- my_fclose(fff);
+ close_auto_dump(fff, mark, line_num);
/* Message */
#ifdef JP
/* Verify the feeling */
if (feeling > 10) feeling = 10;
-#ifdef USE_SCRIPT
- if (cmd_feeling_callback(feeling)) return;
-#endif /* USE_SCRIPT */
-
/* No useful feeling in quests */
if (p_ptr->inside_quest && !random_quest_number(dun_level))
{
}
/* Display the feeling */
- if (turn - old_turn >= (3000 - dun_level*20) || cheat_xtra)
+ if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
{
if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
else {
char buf[1024];
+ int wid, hgt;
+
+ Term_get_size(&wid, &hgt);
+
+ /* Hack -- drop permissions */
+ safe_setuid_drop();
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
/* Load the screen */
- for (y = 0; okay && (y < 24); y++)
+ for (y = 0; okay && (y < hgt); y++)
{
/* Get a line of data */
if (photo_fgets(fff, buf, 1024)) okay = FALSE;
/* Show each row */
- for (x = 0; x < 79; x++)
+ for (x = 0; x < wid - 1; x++)
{
/* Put the attr/char */
Term_draw(x, y, TERM_WHITE, buf[x]);
/* Dump the screen */
- for (y = 0; okay && (y < 24); y++)
+ for (y = 0; okay && (y < hgt); y++)
{
/* Get a line of data */
if (photo_fgets(fff, buf, 1024)) okay = FALSE;
/* Dump each row */
- for (x = 0; x < 79; x++)
+ for (x = 0; x < wid - 1; x++)
{
/* Get the attr/char */
(void)(Term_what(x, y, &a, &c));
/* Close it */
my_fclose(fff);
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
+
/* Message */
#ifdef JP
store_type *st_ptr;
object_type *o_ptr;
- int tval;
+ byte tval;
int i=0;
int j=0;
#ifdef JP
strcpy(where, "²È");
#else
- strcpy(where, "H ");/*nanka*/
+ strcpy(where, "H ");
#endif
/* Dump all available items */
#ifdef JP
show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0);
#else
- show_file(TRUE, file_name, "Resistances of *identifyed* equipment", 0, 0);
+ show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0);
#endif
/* Remove the file */
char buf[2048];
int yomikomu = 0;
- char *tags[4] = {
+ cptr tags[4] = {
"HEADER_START:",
"HEADER_END:",
"FOOTER_START:",
"FOOTER_END:",
};
- char *html_head[] = {
+ cptr html_head[] = {
"<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
"<pre>",
0,
};
- char *html_foot[] = {
+ cptr html_foot[] = {
"</pre>\n",
"</body>\n</html>\n",
0,
};
+ int wid, hgt;
+
+ Term_get_size(&wid, &hgt);
+
/* File type is "TEXT" */
FILE_TYPE(FILE_TYPE_TEXT);
- /* Hack -- drop permissions */
- safe_setuid_drop();
-
/* Append to the file */
fff = my_fopen(filename, "w");
- /* Hack -- grab permissions */
- safe_setuid_grab();
-
/* Oops */
if (!fff) {
if (message) {
#endif
msg_print(NULL);
}
- return;
+
+ return;
}
/* Save the screen */
if (message)
- screen_save();
+ screen_save();
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, "htmldump.prf");
}
/* Dump the screen */
- for (y = 0; y < 24; y++)
+ for (y = 0; y < hgt; y++)
{
/* Start the row */
if (y != 0)
fprintf(fff, "\n");
/* Dump each row */
- for (x = 0; x < 79; x++)
+ for (x = 0; x < wid - 1; x++)
{
int rv, gv, bv;
- char *cc = NULL;
+ cptr cc = NULL;
/* Get the attr/char */
(void)(Term_what(x, y, &a, &c));
if (!tmpfff) {
for (i = 0; html_foot[i]; i++)
fprintf(fff, html_foot[i]);
- }
+ }
else {
rewind(tmpfff);
yomikomu = 0;
/* Restore the screen */
if (message)
- screen_load();
+ screen_load();
}
/*
* Hack -- save a screen dump to a file
*/
-void do_cmd_save_screen_html(void)
+static void do_cmd_save_screen_html(void)
{
char buf[1024], tmp[256] = "screen.html";
+#ifdef JP
if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80))
+#else
+ if (!get_string("File name: ", tmp, 80))
+#endif
return;
/* Build the filename */
msg_print(NULL);
+ /* Hack -- drop permissions */
+ safe_setuid_drop();
+
do_cmd_save_screen_html_aux(buf, 1);
+
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
}
*/
void do_cmd_save_screen(void)
{
+ bool old_use_graphics = use_graphics;
+
+ int wid, hgt;
+
+ Term_get_size(&wid, &hgt);
+
+ if (old_use_graphics)
+ {
+ use_graphics = FALSE;
+ reset_visuals();
+
+ /* Redraw everything */
+ p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
+
+ /* Hack -- update */
+ handle_stuff();
+ }
+
#ifdef JP
- if (get_check("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©"))
+ if (get_check_strict("HTML¤Ç½ÐÎϤ·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
#else
- if (get_check("Save screen dump as HTML? "))
+ if (get_check_strict("Save screen dump as HTML? ", CHECK_NO_HISTORY))
#endif
{
do_cmd_save_screen_html();
- return;
+ do_cmd_redraw();
}
/* Do we use a special screendump function ? */
- if (screendump_aux)
+ else if (screendump_aux)
{
/* Dump the screen to a graphics file */
(*screendump_aux)();
char buf[1024];
+ /* Hack -- drop permissions */
+ safe_setuid_drop();
+
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, "dump.txt");
/* File type is "TEXT" */
FILE_TYPE(FILE_TYPE_TEXT);
- /* Hack -- drop permissions */
- safe_setuid_drop();
-
/* Append to the file */
fff = my_fopen(buf, "w");
- /* Hack -- grab permissions */
- safe_setuid_grab();
-
/* Oops */
- if (!fff) {
+ if (!fff)
+ {
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
#ifdef JP
- msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
+ msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf);
#else
- msg_format("Failed to open file %s.", buf);
+ msg_format("Failed to open file %s.", buf);
#endif
- msg_print(NULL);
- return;
+ msg_print(NULL);
+ return;
}
/* Dump the screen */
- for (y = 0; y < 24; y++)
+ for (y = 0; y < hgt; y++)
{
/* Dump each row */
- for (x = 0; x < 79; x++)
+ for (x = 0; x < wid - 1; x++)
{
/* Get the attr/char */
(void)(Term_what(x, y, &a, &c));
/* Dump the screen */
- for (y = 0; y < 24; y++)
+ for (y = 0; y < hgt; y++)
{
/* Dump each row */
- for (x = 0; x < 79; x++)
+ for (x = 0; x < wid - 1; x++)
{
/* Get the attr/char */
(void)(Term_what(x, y, &a, &c));
/* Close it */
my_fclose(fff);
+ /* Hack -- grab permissions */
+ safe_setuid_grab();
/* Message */
#ifdef JP
/* Restore the screen */
screen_load();
}
+
+ if (old_use_graphics)
+ {
+ use_graphics = TRUE;
+ reset_visuals();
+
+ /* Redraw everything */
+ p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
+
+ /* Hack -- update */
+ handle_stuff();
+ }
}
/*
* Check the status of "artifacts"
*/
-void do_cmd_knowledge_artifacts(void)
+static void do_cmd_knowledge_artifacts(void)
{
int i, k, z, x, y, n = 0;
u16b why = 3;
bool *okay;
- /* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
-
- /* Allocate the "okay" array */
- C_MAKE(okay, max_a_idx, bool);
-
/* Open a new file */
fff = my_fopen_temp(file_name, 1024);
+
if (!fff) {
#ifdef JP
msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
return;
}
+ /* Allocate the "who" array */
+ C_MAKE(who, max_r_idx, s16b);
+
+ /* Allocate the "okay" array */
+ C_MAKE(okay, max_a_idx, bool);
+
/* Scan the artifacts */
for (k = 0; k < max_a_idx; k++)
{
object_prep(q_ptr, z);
/* Make it an artifact */
- q_ptr->name1 = who[k];
+ q_ptr->name1 = (byte)who[k];
/* Describe the artifact */
object_desc_store(base_name, q_ptr, FALSE, 0);
}
+ /* Free the "who" array */
+ C_KILL(who, max_r_idx, s16b);
+
+ /* Free the "okay" array */
+ C_KILL(okay, max_a_idx, bool);
+
/* Close the file */
my_fclose(fff);
char file_name[1024];
- /* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
-
/* Open a new file */
fff = my_fopen_temp(file_name, 1024);
+
if (!fff) {
#ifdef JP
msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
return;
}
+ /* Allocate the "who" array */
+ C_MAKE(who, max_r_idx, s16b);
+
/* Scan the monsters */
for (i = 1; i < max_r_idx; i++)
{
}
}
+ /* Free the "who" array */
+ C_KILL(who, max_r_idx, s16b);
+
/* Close the file */
my_fclose(fff);
char file_name[1024];
- /* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
-
/* Open a new file */
fff = my_fopen_temp(file_name, 1024);
+
if (!fff) {
#ifdef JP
msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
return;
}
+ /* Allocate the "who" array */
+ C_MAKE(who, max_r_idx, s16b);
+
/* Scan the monsters */
for (i = 1; i < max_r_idx; i++)
{
}
}
+ /* Free the "who" array */
+ C_KILL(who, max_r_idx, s16b);
+
/* Close the file */
my_fclose(fff);
{
if((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue;
- if(weapon_exp[4-i][num]<4000) shougou=0;
- else if(weapon_exp[4-i][num]<6000) shougou=1;
- else if(weapon_exp[4-i][num]<7000) shougou=2;
- else if(weapon_exp[4-i][num]<8000) shougou=3;
+ if(p_ptr->weapon_exp[4-i][num]<4000) shougou=0;
+ else if(p_ptr->weapon_exp[4-i][num]<6000) shougou=1;
+ else if(p_ptr->weapon_exp[4-i][num]<7000) shougou=2;
+ else if(p_ptr->weapon_exp[4-i][num]<8000) shougou=3;
else shougou=4;
strip_name(tmp, j);
fprintf(fff,"%-25s ",tmp);
- if (weapon_exp[4-i][num] >= weapon_exp_settei[p_ptr->pclass][4-i][num][1]) fprintf(fff,"!");
+ if (p_ptr->weapon_exp[4-i][num] >= s_info[p_ptr->pclass].w_max[4-i][num]) fprintf(fff,"!");
else fprintf(fff," ");
fprintf(fff,"%s",shougou_moji[shougou]);
- if (cheat_xtra) fprintf(fff," %d",weapon_exp[4-i][num]);
+ if (cheat_xtra) fprintf(fff," %d",p_ptr->weapon_exp[4-i][num]);
fprintf(fff,"\n");
break;
}
if(p_ptr->realm1 != REALM_NONE)
{
+#ifdef JP
fprintf(fff,"%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm1]);
+#else
+ fprintf(fff,"%s Spellbook\n",realm_names[p_ptr->realm1]);
+#endif
for (i = 0; i < 32; i++)
{
if (!is_magic(p_ptr->realm1))
s_ptr = &mp_ptr->info[p_ptr->realm1 - 1][i];
}
if(s_ptr->slevel == 99) continue;
- if(spell_exp[i]<900) shougou=0;
- else if(spell_exp[i]<1200) shougou=1;
- else if(spell_exp[i]<1400) shougou=2;
- else if(spell_exp[i]<1600) shougou=3;
+ if(p_ptr->spell_exp[i]<900) shougou=0;
+ else if(p_ptr->spell_exp[i]<1200) shougou=1;
+ else if(p_ptr->spell_exp[i]<1400) shougou=2;
+ else if(p_ptr->spell_exp[i]<1600) shougou=3;
else shougou=4;
fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm1)-1][i]);
if (p_ptr->realm1 == REALM_HISSATSU)
else fprintf(fff," ");
fprintf(fff,"%s",shougou_moji[shougou]);
}
- if (cheat_xtra) fprintf(fff," %d",spell_exp[i]);
+ if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i]);
fprintf(fff,"\n");
}
}
if(p_ptr->realm2 != REALM_NONE)
{
- fprintf(fff,"\n%s¤ÎËâË¡½ñ\n",realm_names[p_ptr->realm2]);
+ fprintf(fff,"\n%s Spellbook\n",realm_names[p_ptr->realm2]);
for (i = 0; i < 32; i++)
{
if (!is_magic(p_ptr->realm1))
}
if(s_ptr->slevel == 99) continue;
- if(spell_exp[i+32]<900) shougou=0;
- else if(spell_exp[i+32]<1200) shougou=1;
- else if(spell_exp[i+32]<1400) shougou=2;
+ if(p_ptr->spell_exp[i+32]<900) shougou=0;
+ else if(p_ptr->spell_exp[i+32]<1200) shougou=1;
+ else if(p_ptr->spell_exp[i+32]<1400) shougou=2;
else shougou=3;
fprintf(fff,"%-25s ",spell_names[technic2magic(p_ptr->realm2)-1][i]);
if (shougou == 3) fprintf(fff,"!");
else fprintf(fff," ");
fprintf(fff,"%s",shougou_moji[shougou]);
- if (cheat_xtra) fprintf(fff," %d",spell_exp[i+32]);
+ if (cheat_xtra) fprintf(fff," %d",p_ptr->spell_exp[i+32]);
fprintf(fff,"\n");
}
}
{
if(i == GINOU_RIDING)
{
- if(skill_exp[i]<500) shougou=0;
- else if(skill_exp[i]<2000) shougou=1;
- else if(skill_exp[i]<5000) shougou=2;
- else if(skill_exp[i]<8000) shougou=3;
+ if(p_ptr->skill_exp[i]<500) shougou=0;
+ else if(p_ptr->skill_exp[i]<2000) shougou=1;
+ else if(p_ptr->skill_exp[i]<5000) shougou=2;
+ else if(p_ptr->skill_exp[i]<8000) shougou=3;
else shougou=4;
}
else
{
- if(skill_exp[i]<4000) shougou=0;
- else if(skill_exp[i]<6000) shougou=1;
- else if(skill_exp[i]<7000) shougou=2;
- else if(skill_exp[i]<8000) shougou=3;
+ if(p_ptr->skill_exp[i]<4000) shougou=0;
+ else if(p_ptr->skill_exp[i]<6000) shougou=1;
+ else if(p_ptr->skill_exp[i]<7000) shougou=2;
+ else if(p_ptr->skill_exp[i]<8000) shougou=3;
else shougou=4;
}
fprintf(fff,"%-20s ",skill_name[i]);
- if (skill_exp[i] == skill_exp_settei[p_ptr->pclass][i][1]) fprintf(fff,"!");
+ if (p_ptr->skill_exp[i] == s_info[p_ptr->pclass].s_max[i]) fprintf(fff,"!");
else fprintf(fff," ");
fprintf(fff,"%s",shougou_moji[shougou]);
- if (cheat_xtra) fprintf(fff," %d",skill_exp[i]);
+ if (cheat_xtra) fprintf(fff," %d",p_ptr->skill_exp[i]);
fprintf(fff,"\n");
}
s32b Total = 0;
- /* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
-
/* Open a new file */
fff = my_fopen_temp(file_name, 1024);
+
if (!fff) {
#ifdef JP
msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
return;
}
+ /* Allocate the "who" array */
+ C_MAKE(who, max_r_idx, s16b);
+
{
/* Monsters slain */
int kk;
#endif
+ /* Free the "who" array */
+ C_KILL(who, max_r_idx, s16b);
+
/* Close the file */
my_fclose(fff);
object_kind *k_ptr = &k_info[k];
/* Hack -- skip artifacts */
- if (k_ptr->flags3 & (TR3_INSTA_ART)) continue;
+ if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
/* List known flavored objects */
if (k_ptr->flavor && k_ptr->aware)
* List virtues & status
*
*/
-void do_cmd_knowledge_kubi(void)
+static void do_cmd_knowledge_kubi(void)
{
int i;
FILE *fff;
* List virtues & status
*
*/
-void do_cmd_knowledge_virtues(void)
+static void do_cmd_knowledge_virtues(void)
{
FILE *fff;
char file_name[1024];
- cptr disp_align;
/* Open a new file */
if (fff)
{
#ifdef JP
- if (p_ptr->align > 150) disp_align = "ÂçÁ±";
- else if (p_ptr->align > 50) disp_align = "ÃæÁ±";
- else if (p_ptr->align > 10) disp_align = "¾®Á±";
- else if (p_ptr->align > -11) disp_align = "ÃæΩ";
- else if (p_ptr->align > -51) disp_align = "¾®°";
- else if (p_ptr->align > -151) disp_align = "Ãæ°";
- else disp_align = "Âç°";
- fprintf(fff, "¸½ºß¤Î°À : %s\n", disp_align);
- fprintf(fff, "\n");
+ fprintf(fff, "¸½ºß¤Î°À : %s\n\n", your_alignment());
#else
- if (p_ptr->align > 150) disp_align = "lawful";
- else if (p_ptr->align > 50) disp_align = "good";
- else if (p_ptr->align > 10) disp_align = "neutral good";
- else if (p_ptr->align > -11) disp_align = "neutral";
- else if (p_ptr->align > -51) disp_align = "neutral evil";
- else if (p_ptr->align > -151) disp_align = "evil";
- else disp_align = "chaotic";
- fprintf(fff, "Your alighnment : %s\n", disp_align);
- fprintf(fff, "\n");
+ fprintf(fff, "Your alighnment : %s\n\n", your_alignment());
#endif
dump_virtues(fff);
}
* Dungeon
*
*/
-void do_cmd_knowledge_dungeon(void)
+static void do_cmd_knowledge_dungeon(void)
{
FILE *fff;
if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
}
else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
+#ifdef JP
fprintf(fff,"%c%-12s : %3d ³¬\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
+#else
+ fprintf(fff,"%c%-16s : level %3d\n", seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
+#endif
}
}
if (fff)
{
- percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
+ percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
(2 * p_ptr->hitdie +
((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
if (!total) fprintf(fff, "Nothing.\n");
#endif
- if (wizard) {
+ if (p_ptr->wizard) {
#ifdef JP
fprintf(fff, "\n¡Ô»Ä¤ê¤Î¥é¥ó¥À¥à¥¯¥¨¥¹¥È¡Õ\n");
#else
fprintf(fff, tmp_str);
}
}
+#ifdef JP
if (!total) fprintf(fff, "¤Ê¤·\n");
+#else
+ if (!total) fprintf(fff, "Nothing.\n");
+#endif
}
/* Close the file */
* List my home
*
*/
-void do_cmd_knowledge_home(void)
+static void do_cmd_knowledge_home(void)
{
FILE *fff;
fd_kill(file_name);
}
+
+/*
+ * Check the status of "autopick"
+ */
+static void do_cmd_knowledge_autopick(void)
+{
+ int k;
+ FILE *fff;
+ char file_name[1024];
+
+ /* Open a new file */
+ fff = my_fopen_temp(file_name, 1024);
+
+ if (!fff)
+ {
+#ifdef JP
+ msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name);
+#else
+ msg_format("Failed to create temporary file %s.", file_name);
+#endif
+ msg_print(NULL);
+ return;
+ }
+
+ if (!max_autopick)
+ {
+#ifdef JP
+ fprintf(fff, "¼«Æ°Ç˲õ/½¦¤¤¤Ë¤Ï²¿¤âÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£");
+#else
+ fprintf(fff, "No preference for auto picker/destroyer.");
+#endif
+ }
+ else
+ {
+#ifdef JP
+ fprintf(fff, " ¼«Æ°½¦¤¤/Ç˲õ¤Ë¤Ï¸½ºß %d¹ÔÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£\n\n", max_autopick);
+#else
+ fprintf(fff, " There are %d registered lines for auto picker/destroyer.\n\n", max_autopick);
+#endif
+ }
+
+ for (k = 0; k < max_autopick; k++)
+ {
+ cptr tmp;
+ byte act = autopick_list[k].action;
+ if (act & DONT_AUTOPICK)
+ {
+#ifdef JP
+ tmp = "ÊüÃÖ";
+#else
+ tmp = "Leave";
+#endif
+ }
+ else if (act & DO_AUTODESTROY)
+ {
+#ifdef JP
+ tmp = "Ç˲õ";
+#else
+ tmp = "Destroy";
+#endif
+ }
+ else
+ {
+#ifdef JP
+ tmp = "½¦¤¦";
+#else
+ tmp = "Pickup";
+#endif
+ }
+
+ if (act & DO_DISPLAY)
+ fprintf(fff, "%11s", format("[%s]", tmp));
+ else
+ fprintf(fff, "%11s", format("(%s)", tmp));
+
+ tmp = autopick_line_from_entry(&autopick_list[k]);
+ fprintf(fff, " %s", tmp);
+ string_free(tmp);
+ fprintf(fff, "\n");
+ }
+ /* Close the file */
+ my_fclose(fff);
+ /* Display the file contents */
+#ifdef JP
+ show_file(TRUE, file_name, "¼«Æ°½¦¤¤/Ç˲õ ÀßÄê¥ê¥¹¥È", 0, 0);
+#else
+ show_file(TRUE, file_name, "Auto-picker/Destroyer", 0, 0);
+#endif
+
+ /* Remove the file */
+ fd_kill(file_name);
+}
+
+
/*
* Interact with "knowledge"
*/
void do_cmd_knowledge(void)
{
- int i;
-
+ int i,p=0;
/* File type is "TEXT" */
FILE_TYPE(FILE_TYPE_TEXT);
-
/* Save the screen */
screen_save();
-
/* Interact until done */
while (1)
{
/* Clear screen */
Term_clear();
-
/* Ask for a choice */
#ifdef JP
- prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 2, 0);
+ prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
+ prt("¸½ºß¤ÎÃ챤ò³Îǧ¤¹¤ë", 3, 0);
#else
- prt("Display current knowledge", 2, 0);
+ prt(format("page %d/2", (p+1)), 2, 65);
+ prt("Display current knowledge", 3, 0);
#endif
-
/* Give some choices */
#ifdef JP
- prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 4, 5);
- prt("(2) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 5, 5);
- prt("(3) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 6, 5);
- prt("(4) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
- prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 8, 5);
- prt("(6) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 9, 5);
- prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 10, 5);
- prt("(8) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 11, 5);
- prt("(9) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 12, 5);
- prt("(a) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 13, 5);
- prt("(b) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 14, 5);
- prt("(c) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 15, 5);
- prt("(d) ¾Þ¶â¼ó ¤Î°ìÍ÷", 16, 5);
- prt("(e) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 17, 5);
- prt("(f) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 18, 5);
- prt("(g) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 19, 5);
- prt("(h) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 20, 5);
-#else
- prt("(1) Display known artifacts", 4, 5);
- prt("(2) Display known uniques", 5, 5);
- prt("(3) Display dead uniques", 6, 5);
- prt("(4) Display known objects", 7, 5);
- prt("(5) Display kill count", 8, 5);
- prt("(6) Display mutations", 9, 5);
- prt("(7) Display current pets", 10, 5);
- prt("(8) Display current quests", 11, 5);
- prt("(9) Display virtues", 12, 5);
- prt("(a) Display weapon proficiency", 13, 5);
- prt("(b) Display spell proficiency", 14, 5);
- prt("(c) Display misc. proficiency", 15, 5);
- prt("(d) Display wanted monsters", 16, 5);
- prt("(e) Display home inventory", 17, 5);
- prt("(f) Display *identifyed* equip.", 18, 5);
- prt("(g) Display about yourself", 19, 5);
- prt("(h) Display dungeons", 20, 5);
+ if (p == 0) {
+ prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 6, 5);
+ prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à ¤Î°ìÍ÷", 7, 5);
+ prt("(3) ´ûÃΤÎÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
+ prt("(4) Åݤ·¤¿¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 9, 5);
+ prt("(5) Åݤ·¤¿Å¨¤Î¿ô ¤Î°ìÍ÷", 10, 5);
+ prt("(6) ¾Þ¶â¼ó ¤Î°ìÍ÷", 11, 5);
+ prt("(7) ¸½ºß¤Î¥Ú¥Ã¥È ¤Î°ìÍ÷", 12, 5);
+ prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à ¤Î°ìÍ÷", 13, 5);
+ prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ ¤Î°ìÍ÷", 14, 5);
+ } else {
+ prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó ¤Î°ìÍ÷", 6, 5);
+ prt("(b) ÆÍÁ³ÊÑ°Û ¤Î°ìÍ÷", 7, 5);
+ prt("(c) Éð´ï¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 8, 5);
+ prt("(d) ËâË¡¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 9, 5);
+ prt("(e) µ»Ç½¤Î·Ð¸³ÃÍ ¤Î°ìÍ÷", 10, 5);
+ prt("(f) ¥×¥ì¥¤¥ä¡¼¤ÎÆÁ ¤Î°ìÍ÷", 11, 5);
+ prt("(g) Æþ¤Ã¤¿¥À¥ó¥¸¥ç¥ó ¤Î°ìÍ÷", 12, 5);
+ prt("(h) ¼Â¹ÔÃæ¤Î¥¯¥¨¥¹¥È ¤Î°ìÍ÷", 13, 5);
+ prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê ¤Î°ìÍ÷", 14, 5);
+ }
+#else
+ if (p == 0) {
+ prt("(1) Display known artifacts", 6, 5);
+ prt("(2) Display known objects", 7, 5);
+ prt("(3) Display remaining uniques", 8, 5);
+ prt("(4) Display dead uniques", 9, 5);
+ prt("(5) Display kill count", 10, 5);
+ prt("(6) Display wanted monsters", 11, 5);
+ prt("(7) Display current pets", 12, 5);
+ prt("(8) Display home inventory", 13, 5);
+ prt("(9) Display *identified* equip.", 14, 5);
+ } else {
+ prt("(a) Display about yourself", 6, 5);
+ prt("(b) Display mutations", 7, 5);
+ prt("(c) Display weapon proficiency", 8, 5);
+ prt("(d) Display spell proficiency", 9, 5);
+ prt("(e) Display misc. proficiency", 10, 5);
+ prt("(f) Display virtues", 11, 5);
+ prt("(g) Display dungeons", 12, 5);
+ prt("(h) Display current quests", 13, 5);
+ prt("(i) Display auto pick/destroy", 14, 5);
+ }
#endif
-
/* Prompt */
#ifdef JP
- prt("¥³¥Þ¥ó¥É:", 22, 0);
+ prt("-³¤¯-", 16, 8);
+ prt("ESC) È´¤±¤ë", 21, 1);
+ prt("SPACE) ¼¡¥Ú¡¼¥¸", 21, 30);
+ /*prt("-) Á°¥Ú¡¼¥¸", 21, 60);*/
+ prt("¥³¥Þ¥ó¥É:", 20, 0);
#else
- prt("Command: ", 22, 0);
+ prt("-more-", 16, 8);
+ prt("ESC) Exit menu", 21, 1);
+ prt("SPACE) Next page", 21, 30);
+ /*prt("-) Previous page", 21, 60);*/
+ prt("Command: ", 20, 0);
#endif
-
/* Prompt */
i = inkey();
-
/* Done */
if (i == ESCAPE) break;
-
switch (i)
{
+ case ' ': /* Page change */
+ case '-':
+ p = 1 - p;
+ break;
case '1': /* Artifacts */
do_cmd_knowledge_artifacts();
break;
- case '2': /* Uniques */
- do_cmd_knowledge_uniques();
+ case '2': /* Objects */
+ do_cmd_knowledge_objects();
break;
case '3': /* Uniques */
- do_cmd_knowledge_uniques_dead();
+ do_cmd_knowledge_uniques();
break;
- case '4': /* Objects */
- do_cmd_knowledge_objects();
+ case '4': /* Uniques */
+ do_cmd_knowledge_uniques_dead();
break;
case '5': /* Kill count */
do_cmd_knowledge_kill_count();
break;
- case '6': /* Mutations */
- do_cmd_knowledge_mutations();
+ case '6': /* wanted */
+ do_cmd_knowledge_kubi();
break;
case '7': /* Pets */
do_cmd_knowledge_pets();
break;
- case '8': /* Quests */
- do_cmd_knowledge_quests();
+ case '8': /* Home */
+ do_cmd_knowledge_home();
break;
- case '9': /* Virtues */
- do_cmd_knowledge_virtues();
+ case '9': /* Resist list */
+ do_cmd_knowledge_inven();
+ break;
+ /* Next page */
+ case 'a': /* Max stat */
+ do_cmd_knowledge_stat();
break;
- case 'a': /* weapon-exp */
+ case 'b': /* Mutations */
+ do_cmd_knowledge_mutations();
+ break;
+ case 'c': /* weapon-exp */
do_cmd_knowledge_weapon_exp();
break;
- case 'b': /* spell-exp */
+ case 'd': /* spell-exp */
do_cmd_knowledge_spell_exp();
break;
- case 'c': /* skill-exp */
+ case 'e': /* skill-exp */
do_cmd_knowledge_skill_exp();
break;
- case 'd': /* skill-exp */
- do_cmd_knowledge_kubi();
- break;
- case 'e': /* skill-exp */
- do_cmd_knowledge_home();
+ case 'f': /* Virtues */
+ do_cmd_knowledge_virtues();
break;
- case 'f': /* Resist list */
- do_cmd_knowledge_inven();
+ case 'g': /* Dungeon */
+ do_cmd_knowledge_dungeon();
break;
- case 'g': /* Max stat */
- do_cmd_knowledge_stat();
+ case 'h': /* Quests */
+ do_cmd_knowledge_quests();
break;
- case 'h': /* Dungeon */
- do_cmd_knowledge_dungeon();
+ case 'i': /* Autopick */
+ do_cmd_knowledge_autopick();
break;
default: /* Unknown option */
bell();
}
-
/* Flush messages */
msg_print(NULL);
}
-
/* Restore the screen */
screen_load();
}
FILE *fff;
- s32b len = 20L * TOWN_DAWN;
- s32b tick = turn % len + len / 4;
+ extract_day_hour_min(&day, &hour, &min);
- if ((p_ptr->prace == RACE_VAMPIRE) ||
- (p_ptr->prace == RACE_SKELETON) ||
- (p_ptr->prace == RACE_ZOMBIE) ||
- (p_ptr->prace == RACE_SPECTRE))
- day = (turn - (15L * TOWN_DAWN))/ len + 1;
- else
- day = (turn + (5L * TOWN_DAWN))/ len + 1;
- hour = (24 * tick / len) % 24;
- min = (1440 * tick / len) % 60;
full = hour * 100 + min;
start = 9999;
min, (hour < 12) ? "AM" : "PM");
/* Find the path */
- if (!rand_int(10) || p_ptr->image)
+ if (!randint0(10) || p_ptr->image)
{
#ifdef JP
path_build(buf, 1024, ANGBAND_DIR_FILE, "timefun_j.txt");
num++;
/* Apply the randomizer */
- if (!rand_int(num)) strcpy(desc, buf + 2);
+ if (!randint0(num)) strcpy(desc, buf + 2);
/* Next... */
continue;