{"GF_SEEKER", GF_SEEKER },
{"GF_SUPER_RAY", GF_SUPER_RAY },
{"GF_STAR_HEAL", GF_STAR_HEAL },
+ {"GF_WATER_FLOW", GF_WATER_FLOW },
+ {"GF_CRUSADE", GF_CRUSADE },
+ {"GF_STASIS_EVIL", GF_STASIS_EVIL },
+ {"GF_WOUNDS", GF_WOUNDS },
{NULL, 0 }
};
int ob = option_info[i].o_bit;
if (option_info[i].o_var &&
- option_info[i].o_text &&
- streq(option_info[i].o_text, buf + 2) &&
- (!alive || option_info[i].o_page !=6))
+ option_info[i].o_text &&
+ streq(option_info[i].o_text, buf + 2))
{
+ if (alive && 6 == option_info[i].o_page && !wizard)
+ {
+#ifdef JP
+ msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤¤Þ¤»¤ó! '%s'", buf);
+#else
+ msg_format("Startup options can not changed! '%s'", buf);
+#endif
+ msg_print(NULL);
+ return 0;
+ }
+
/* Clear */
option_flag[os] &= ~(1L << ob);
(*option_info[i].o_var) = FALSE;
}
/* don't know that option. ignore it.*/
- msg_format("Ignored wrong option %s.", buf+2);
+#ifdef JP
+ msg_format("¥ª¥×¥·¥ç¥ó¤Î̾Á°¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡§ %s", buf);
+#else
+ msg_format("Ignored invalid option: %s", buf);
+#endif
msg_print(NULL);
return 0;
}
int ob = option_info[i].o_bit;
if (option_info[i].o_var &&
- option_info[i].o_text &&
- streq(option_info[i].o_text, buf + 2) &&
- (!alive || option_info[i].o_page !=6))
+ option_info[i].o_text &&
+ streq(option_info[i].o_text, buf + 2))
{
+ if (alive && 6 == option_info[i].o_page && !wizard)
+ {
+#ifdef JP
+ msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤¤Þ¤»¤ó! '%s'", buf);
+#else
+ msg_format("Startup options can not changed! '%s'", buf);
+#endif
+ msg_print(NULL);
+ return 0;
+ }
+
/* Set */
option_flag[os] |= (1L << ob);
(*option_info[i].o_var) = TRUE;
}
/* don't know that option. ignore it.*/
- msg_format("Ignored wrong option %s.", buf+2);
+#ifdef JP
+ msg_format("¥ª¥×¥·¥ç¥ó¤Î̾Á°¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡§ %s", buf);
+#else
+ msg_format("Ignored invalid option: %s", buf);
+#endif
msg_print(NULL);
return 0;
}
*/
static errr process_pickpref_file_line(char *buf)
{
- char *s, *s2;
+ autopick_type entry;
int i;
- byte act = 0;
+ if (max_autopick == MAX_AUTOPICK)
+ return 1;
+
/* Nuke illegal char */
for(i = 0; buf[i]; i++)
{
}
buf[i] = 0;
- s = buf;
+ if (!autopick_new_entry(&entry, buf)) return 0;
- act = DO_AUTOPICK | DO_DISPLAY;
- while (1)
- {
- if (*s == '!')
- {
- act &= ~DO_AUTOPICK;
- act |= DO_AUTODESTROY;
- s++;
- }
- else if (*s == '~')
- {
- act &= ~DO_AUTOPICK;
- act |= DONT_AUTOPICK;
- s++;
- }
- else if (*s == '(')
- {
- act &= ~DO_DISPLAY;
- s++;
- }
- else
- break;
- }
-
- /* don't mind upper or lower case */
- s2 = NULL;
- for (i = 0; s[i]; i++)
- {
-#ifdef JP
- if (iskanji(s[i]))
- {
- i++;
- continue;
- }
-#endif
- if (isupper(s[i]))
- s[i] = tolower(s[i]);
-
- /* Auto-inscription? */
- if (s[i] == '#')
- {
- s[i] = '\0';
- s2 = s + i + 1;
- break;
- }
- }
-
- /* Skip empty line */
- if (*s == 0)
- return 0;
- if (max_autopick == MAX_AUTOPICK)
- return 1;
-
/* Already has the same entry? */
for(i = 0; i < max_autopick; i++)
- if(!strcmp(s, autopick_name[i]))
- return 0;
-
- autopick_name[max_autopick] = string_make(s);
- autopick_action[max_autopick] = act;
+ if(!strcmp(entry.name, autopick_list[i].name)
+ && entry.flag[0] == autopick_list[i].flag[0]
+ && entry.flag[1] == autopick_list[i].flag[1]) return 0;
- autopick_insc[max_autopick] = string_make(s2);
- max_autopick++;
+ autopick_list[max_autopick++] = entry;
return 0;
}
{
char buf[1024];
- errr err = 0;
+ errr err1, err2;
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_PREF, name);
- /* Process the pref file */
- err = process_pref_file_aux(buf, FALSE);
+ /* Process the system pref file */
+ err1 = process_pref_file_aux(buf, FALSE);
/* Stop at parser errors, but not at non-existing file */
- if (err < 1)
- {
- /* Build the filename */
- path_build(buf, 1024, ANGBAND_DIR_USER, name);
+ if (err1 > 0) return err1;
- /* Process the pref file */
- err = process_pref_file_aux(buf, FALSE);
- }
- /* Result */
- return (err);
+ /* Drop priv's */
+ safe_setuid_drop();
+
+ /* Build the filename */
+ path_build(buf, 1024, ANGBAND_DIR_USER, name);
+
+ /* Process the user pref file */
+ err2 = process_pref_file_aux(buf, FALSE);
+
+ /* Grab priv's */
+ safe_setuid_grab();
+
+
+ /* User file does not exist, but read system pref file */
+ if (err2 < 0 && !err1)
+ return -2;
+
+ /* Result of user file processing */
+ return err2;
}
}
-/*
- * Print long number with header at given row, column
- * Use the color for the number, not the header
- */
-static void prt_lnum(cptr header, s32b num, int row, int col, byte color)
-{
- int len = strlen(header);
- char out_val[32];
- put_str(header, row, col);
- (void)sprintf(out_val, "%9ld", (long)num);
- c_put_str(color, out_val, row, col + len);
-}
-
-
-/*
- * Print number with header at given row, column
- */
-static void prt_num(cptr header, int num, int row, int col, byte color)
-{
- int len = strlen(header);
- char out_val[32];
- put_str(header, row, col);
- put_str(" ", row, col + len);
- (void)sprintf(out_val, "%6ld", (long)num);
- c_put_str(color, out_val, row, col + len + 3);
-}
-
-
-#ifdef JP
-/* ÆüËܸìÈdzÈÄ¥
- * £È£Ð / ºÇÂç ¤Î¤è¤¦¤Êɽ¼¨
- * xxxxx / yyyyy
- */
-static void prt_num_max( int num, int max , int row, int col, byte color1, byte color2 )
-{
- char out_val[32];
- (void)sprintf(out_val, "%5ld", (long)num);
- c_put_str(color1, out_val, row, col );
- put_str("/",row, col+6);
- (void)sprintf(out_val, "%5ld", (long)max);
- c_put_str(color2, out_val, row, col+8 );
-}
-
-/* ÆüËܸìÈdzÈÄ¥
- * xx ºÐ ¤È¤« xx kg ¤Ê¤É¤Îɽ¼¨ÍÑ cptr tailer ¤Ëñ°Ì¤¬Æþ¤ë¡£
- */
-static void prt_num2(cptr header, cptr tailer, int num, int row, int col, byte color)
-{
- int len = strlen(header);
- char out_val[32];
- put_str(header, row, col);
- put_str(" ", row, col + len);
- (void)sprintf(out_val, "%6ld", (long)num);
- c_put_str(color, out_val, row, col + len + 3);
- put_str(tailer, row, col + len + 3+6);
-}
-#endif
-
#define ENTRY_BARE_HAND 0
#define ENTRY_TWO_HANDS 1
#define ENTRY_RIGHT_HAND1 2
/*
* Prints the following information on the screen.
- *
- * For this to look right, the following should be spaced the
- * same as in the prt_lnum code... -CFT
*/
static void display_player_middle(void)
{
if (object_known_p(o_ptr)) show_tohit += o_ptr->to_h;
if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
- show_tohit += (weapon_exp[0][o_ptr->sval]-4000)/200;
+ if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW))
+ show_tohit += (weapon_exp[0][o_ptr->sval])/400;
+ else
+ show_tohit += (weapon_exp[0][o_ptr->sval]-4000)/200;
/* Range attacks */
display_player_one_line(ENTRY_SHOOT_HIT_DAM, format("(%+d,%+d)", show_tohit, show_todam), TERM_L_BLUE);
if (p_ptr->action == ACTION_SEARCH) i += 10;
if (i > 0)
- attr = TERM_L_GREEN;
+ {
+ if (!p_ptr->riding)
+ attr = TERM_L_GREEN;
+ else
+ attr = TERM_GREEN;
+ }
else if (i == 0)
- attr = TERM_L_BLUE;
+ {
+ if (!p_ptr->riding)
+ attr = TERM_L_BLUE;
+ else
+ attr = TERM_GREEN;
+ }
else
- attr = TERM_L_UMBER;
+ {
+ if (!p_ptr->riding)
+ attr = TERM_L_UMBER;
+ else
+ attr = TERM_RED;
+ }
- if (is_fast) tmp_speed += 10;
- if (p_ptr->slow) tmp_speed -= 10;
- if (p_ptr->lightspeed) tmp_speed = 99;
+ if (!p_ptr->riding)
+ {
+ if (is_fast) tmp_speed += 10;
+ if (p_ptr->slow) tmp_speed -= 10;
+ if (p_ptr->lightspeed) tmp_speed = 99;
+ }
+ else
+ {
+ if (m_list[p_ptr->riding].fast) tmp_speed += 10;
+ if (m_list[p_ptr->riding].slow) tmp_speed -= 10;
+ }
if (tmp_speed)
{
- sprintf(buf, "(%+d%+d)", i-tmp_speed, tmp_speed);
+ if (!p_ptr->riding)
+ sprintf(buf, "(%+d%+d)", i-tmp_speed, tmp_speed);
+ else
+#ifdef JP
+ sprintf(buf, "¾èÇÏÃæ (%+d%+d)", i-tmp_speed, tmp_speed);
+#else
+ sprintf(buf, "Riding (%+d%+d)", i-tmp_speed, tmp_speed);
+#endif
+
if (tmp_speed > 0)
attr = TERM_YELLOW;
else
}
else
{
- sprintf(buf, "(%+d)", i);
+ if (!p_ptr->riding)
+ sprintf(buf, "(%+d)", i);
+ else
+#ifdef JP
+ sprintf(buf, "¾èÇÏÃæ (%+d)", i);
+#else
+ sprintf(buf, "Riding (%+d)", i);
+#endif
}
display_player_one_line(ENTRY_SPEED, buf, attr);
/* Dump Day */
{
- s32b len = 20L * TOWN_DAWN;
- s32b tick = turn % len + len / 4;
+ int day, hour, min;
+ extract_day_hour_min(&day, &hour, &min);
sprintf(buf,
#ifdef JP
- "%2ldÆüÌÜ %ld:%02ld",
+ "%dÆüÌÜ %2d:%02d",
#else
- "Day %ld %ld:%02ld",
+ "Day %d %2d:%02d",
#endif
- ((p_ptr->prace == RACE_VAMPIRE) ||
- (p_ptr->prace == RACE_SKELETON) ||
- (p_ptr->prace == RACE_ZOMBIE) ||
- (p_ptr->prace == RACE_SPECTRE))
- ? (turn - (15L * TOWN_DAWN)) / len + 1
- : (turn + (5L * TOWN_DAWN))/ len + 1,
- (24 * tick / len) % 24,
- (1440 * tick / len) % 60);
+ day, hour, min);
}
display_player_one_line(ENTRY_DAY, buf, TERM_L_GREEN);
if (object_known_p(o_ptr)) damage[i] += o_ptr->to_d*100;
basedam = (o_ptr->dd * (o_ptr->ds + 1))*50;
object_flags(o_ptr, &f1, &f2, &f3);
- if ((o_ptr->ident & IDENT_MENTAL) && (o_ptr->name1 == ART_VORPAL_BLADE))
+ if ((o_ptr->ident & IDENT_MENTAL) && ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)))
{
/* vorpal blade */
basedam *= 5;
basedam *= 11;
basedam /= 9;
}
- if (object_known_p(o_ptr) && (p_ptr->pclass != CLASS_SAMURAI) && (f1 & TR1_FORCE_WEPON) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
+ if (object_known_p(o_ptr) && (p_ptr->pclass != CLASS_SAMURAI) && (f1 & TR1_FORCE_WEAPON) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
basedam = basedam * 7 / 2;
if (p_ptr->riding && (o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
basedam = basedam*(o_ptr->dd+2)/o_ptr->dd;
/*
* Helper function, see below
*/
-static void display_player_flag_aux(int row, int col, char *header,
+static void display_player_flag_aux(int row, int col, cptr header,
int n, u32b flag1, u32b flag2,
u32b im_f[], u32b vul_f)
{
int i;
- u32b f[3];
+ u32b f[4];
bool vuln = FALSE;
if ((vul_f & flag1) && !((im_f[0] | im_f[1] | im_f[2]) & flag1))
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
object_type *o_ptr;
- f[0] = f[1] = f[2] = 0L;
+ f[0] = f[1] = f[2] = f[3] = 0L;
/* Object */
o_ptr = &inventory[i];
/* Known flags */
object_flags_known(o_ptr, &f[0], &f[1], &f[2]);
+ f[3] = o_ptr->curse_flags;
/* Default */
c_put_str((byte)(vuln ? TERM_RED : TERM_SLATE), ".", row, col);
/* Player flags */
player_flags(&f[0], &f[1], &f[2]);
+ f[3] = 0L;
/* Default */
c_put_str((byte)(vuln ? TERM_RED : TERM_SLATE), ".", row, col);
/* Timed player flags */
tim_player_flags(&f[0], &f[1], &f[2], TRUE);
+ f[3] = 0L;
/* Check flags */
if (f[n-1] & flag1) c_put_str((byte)(vuln ? TERM_ORANGE : TERM_YELLOW), "#", row, col);
display_player_flag_aux(row+6, col, "µÞ²óÉü :", 3, TR3_REGEN, 0, im_f[2], vul_f[2]);
display_player_flag_aux(row+7, col, "ÉâÍ· :", 3, TR3_FEATHER, 0, im_f[2], vul_f[2]);
display_player_flag_aux(row+8, col, "±Ê±ó¸÷¸» :", 3, TR3_LITE, 0, im_f[2], vul_f[2]);
-display_player_flag_aux(row+9, col, "¼ö¤¤ :", 3, (TR3_CURSED | TR3_HEAVY_CURSE), TR3_PERMA_CURSE, im_f[2], vul_f[2]);
+display_player_flag_aux(row+9, col, "¼ö¤¤ :", 4, (TRC_CURSED | TRC_HEAVY_CURSE), TRC_PERMA_CURSE, im_f[2], vul_f[2]);
#else
display_player_flag_aux(row+0, col, "Speed :", 1, TR1_SPEED, 0, im_f[0], vul_f[0]);
display_player_flag_aux(row+1, col, "FreeAction:", 2, TR2_FREE_ACT, 0, im_f[1], vul_f[1]);
display_player_flag_aux(row+6, col, "Regene. :", 3, TR3_REGEN, 0, im_f[2], vul_f[2]);
display_player_flag_aux(row+7, col, "Levitation:", 3, TR3_FEATHER, 0, im_f[2], vul_f[2]);
display_player_flag_aux(row+8, col, "Perm Lite :", 3, TR3_LITE, 0, im_f[2], vul_f[2]);
- display_player_flag_aux(row+9, col, "Cursed :", 3, (TR3_CURSED | TR3_HEAVY_CURSE), TR3_PERMA_CURSE, im_f[2], vul_f[2]);
+ display_player_flag_aux(row+9, col, "Cursed :", 4, (TRC_CURSED | TRC_HEAVY_CURSE), TRC_PERMA_CURSE, im_f[2], vul_f[2]);
#endif
}
c_put_str(TERM_BLUE, " ´ðËÜ", row, stat_col+7);
c_put_str(TERM_L_BLUE, " ¼ï ¿¦ À Áõ ", row, stat_col+13);
c_put_str(TERM_L_GREEN, "¹ç·×", row, stat_col+28);
-c_put_str(TERM_YELLOW, "¸½ºß", row, stat_col+33);
+c_put_str(TERM_YELLOW, "¸½ºß", row, stat_col+35);
#else
c_put_str(TERM_WHITE, "Stat", row, stat_col+1);
c_put_str(TERM_BLUE, " Base", row, stat_col+7);
e_adj -= cp_ptr->c_adj[i];
e_adj -= ap_ptr->a_adj[i];
- /* Reduced name of stat */
-#ifdef JP
- c_put_str(TERM_WHITE, stat_names[i], row + i+1, stat_col+1);
-#else
- c_put_str(TERM_WHITE, stat_names_reduced[i], row + i+1, stat_col+1);
-#endif
+ if (p_ptr->stat_cur[i] < p_ptr->stat_max[i])
+ /* Reduced name of stat */
+ c_put_str(TERM_WHITE, stat_names_reduced[i], row + i+1, stat_col+1);
+ else
+ c_put_str(TERM_WHITE, stat_names[i], row + i+1, stat_col+1);
/* Internal "natural" max value. Maxes at 18/100 */
cnv_stat(p_ptr->stat_max[i], buf);
if (p_ptr->stat_max[i] == p_ptr->stat_max_max[i])
{
+#ifdef JP
c_put_str(TERM_WHITE, "!", row + i+1, stat_col + 6);
+#else
+ c_put_str(TERM_WHITE, "!", row + i+1, stat_col + 4);
+#endif
}
c_put_str(TERM_BLUE, buf, row + i+1, stat_col + 13 - strlen(buf));
a = TERM_RED;
/* Label boost */
- if (o_ptr->pval < 10) c = '0' - o_ptr->pval;
+ if (o_ptr->pval > -10) c = '0' - o_ptr->pval;
}
}
a = TERM_RED;
/* Label boost */
- if (dummy < 10) c = '0' - dummy;
+ if (dummy > -10) c = '0' - dummy;
}
}
}
"¥Æ¥ì¥Ý¡¼¥È",
"È¿´¶",
"½ËÊ¡",
-"¼ö¤¤",
-"½Å¤¤¼ö¤¤",
-"±Ê±ó¤Î¼ö¤¤"
+NULL,
+NULL,
+NULL,
#else
"NoTeleport",
"AntiMagic",
"Teleport",
"Aggravate",
"Blessed",
- "Cursed",
- "Hvy Curse",
- "Prm Curse"
+ NULL,
+ NULL,
+ NULL,
#endif
};
/* XXX XXX XXX */
- if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && skip_mutations)
+ if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && display_mutations)
mode = (mode % 7);
else
mode = (mode % 6);
display_player_one_line(ENTRY_REALM, tmp, TERM_L_BLUE);
}
- if (p_ptr->pclass == CLASS_CHAOS_WARRIOR)
+ if ((p_ptr->pclass == CLASS_CHAOS_WARRIOR) || (p_ptr->muta2 & MUT2_CHAOS_GIFT))
display_player_one_line(ENTRY_PATRON, chaos_patrons[p_ptr->chaos_patron], TERM_L_BLUE);
/* Age, Height, Weight, Social */
if (p_ptr->stat_max[i] == p_ptr->stat_max_max[i])
{
- c_put_str(TERM_WHITE, "!", 2+i, 64);
+#ifdef JP
+ c_put_str(TERM_WHITE, "!", 3+i, 59);
+#else
+ c_put_str(TERM_WHITE, "!", 3+i, 59-2);
+#endif
}
}
/* Display "history" info */
if (mode == 1)
{
+ char statmsg[1000];
+
#ifdef JP
put_str("(¥¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á)", 11, 25);
#else
put_str(history[i], i + 12, 10);
}
+ *statmsg = '\0';
- if (death)
+ if (death && total_winner)
+ {
+#ifdef JP
+ strcpy(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¾¡Íø¤Î¸å°úÂष¤¿¡£");
+#else
+ strcpy(statmsg, "...You retired from the adventure after the winning.");
+#endif
+ }
+ else if (death)
{
if (dun_level)
+ {
+ if (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST))
+ {
+ /* Get the quest text */
+ init_flags = INIT_ASSIGN;
+
+ process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
+
+#ifdef JP
+ sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢¥¯¥¨¥¹¥È¡Ö%s¡×¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", quest[p_ptr->inside_quest].name, died_from);
+#else
+ sprintf(statmsg, "...You were killed by %s in the quest '%s'.", died_from, quest[p_ptr->inside_quest].name);
+#endif
+ }
+ else
+ {
#ifdef JP
- put_str(format("¡Ä¤¢¤Ê¤¿¤Ï %s ¤Î %d ³¬¤Ç»à¤ó¤À¡£", map_name(), dun_level), 5 + 12, 10);
+ sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢%s¤Î%d³¬¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), dun_level, died_from);
#else
- put_str(format("...You were dead at level %d of %s.", dun_level, map_name()), 5 + 12, 10);
+ sprintf(statmsg, "...You were killed by %s on level %d of %s.", died_from, dun_level, map_name());
#endif
+ }
+ }
else
#ifdef JP
- put_str(format("¡Ä¤¢¤Ê¤¿¤Ï %s ¤Ç»à¤ó¤À¡£", map_name()), 5 + 12, 10);
+ sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), died_from);
#else
- put_str(format("...You were dead at %s.", map_name()), 5 + 12, 10);
+ sprintf(statmsg, "...You were killed by %s in %s.", died_from, map_name());
#endif
}
- else
+ else if (character_dungeon)
{
if (dun_level)
+ {
+ if (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST))
+ {
+ /* Get the quest text */
+ init_flags = INIT_ASSIGN;
+
+ process_dungeon_file("q_info_j.txt", 0, 0, 0, 0);
+
#ifdef JP
- put_str(format("¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ %s ¤Î %d ³¬¤Çõº÷¤·¤Æ¤¤¤ë¡£", map_name(), dun_level), 5 + 12, 10);
+ sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ ¥¯¥¨¥¹¥È¡Ö%s¡×¤ò¿ë¹ÔÃæ¤À¡£", quest[p_ptr->inside_quest].name);
#else
- put_str(format("...Now, you are exploring at level %d of %s.", dun_level, map_name()), 5 + 12, 10);
+ sprintf(statmsg, "...Now, you are in the quest '%s'.", quest[p_ptr->inside_quest].name);
#endif
+ }
+ else
+ {
+#ifdef JP
+ sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ %s ¤Î %d ³¬¤Çõº÷¤·¤Æ¤¤¤ë¡£", map_name(), dun_level);
+#else
+ sprintf(statmsg, "...Now, you are exploring level %d of %s.", dun_level, map_name());
+#endif
+ }
+ }
else
#ifdef JP
- put_str(format("¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ %s ¤Ë¤¤¤ë¡£", map_name()), 5 + 12, 10);
+ sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ %s ¤Ë¤¤¤ë¡£", map_name());
#else
- put_str(format("...Now, you are in %s.", map_name()), 5 + 12, 10);
+ sprintf(statmsg, "...Now, you are in %s.", map_name());
#endif
}
+
+ if (*statmsg)
+ {
+ char temp[64*2], *t;
+ roff_to_buf(statmsg, 60, temp);
+ t = temp;
+ for(i=0 ; i<2 ; i++)
+ {
+ if(t[0]==0)
+ break;
+ else
+ {
+ put_str(t, i + 5 + 12, 10);
+ t += strlen(t)+1;
+ }
+ }
+ }
+
}
/* Display "various" info */
display_player(1);
/* Dump part of the screen */
- for (y = 11; y < 18; y++)
+ for (y = 10; y < 19; y++)
{
/* Dump each row */
for (x = 0; x < 79; x++)
fprintf(fff, "%s\n", buf);
}
- for (i = 0; i < p_ptr->count / 80; i++)
+ for (i = 0; (unsigned int) i < (p_ptr->count / 80); i++)
fprintf(fff, " ");
fprintf(fff, "\n");
- for (i = 0; i < p_ptr->count % 80; i++)
+ for (i = 0; (unsigned int) i < (p_ptr->count % 80); i++)
fprintf(fff, " ");
+
{
bool pet = FALSE;
#ifdef JP
fprintf(fff, " ¾èÇÏÃæ");
#else
- fprintf(fff, " riding");
+ fprintf(fff, " (riding)");
#endif
fprintf(fff, "\n");
}
#else
fprintf(fff, "\n [Last messages]\n\n");
#endif
- for (i = MIN(message_num(), 15); i >= 0; i--)
+ for (i = MIN(message_num(), 30); i >= 0; i--)
{
fprintf(fff,"> %s\n",message_str((s16b)i));
}
/* Backup value for "line" */
int back = 0;
+ /* Color of the next line */
+ byte color = TERM_WHITE;
+
/* Loop counter */
int cnt;
bool reverse = (line < 0);
+ int wid, hgt, rows;
+
+ Term_get_size(&wid, &hgt);
+ rows = hgt - 4;
+
/* Wipe finder */
strcpy(finder, "");
/* Pre-Parse the file */
while (TRUE)
{
+ char *str;
+
/* Read a line or stop */
if (my_fgets(fff, buf, 1024)) break;
+ /* Get a color */
+ if (prefix(buf, "#####")) str = &buf[6];
+ else str = buf;
+
/* XXX Parse "menu" items */
- if (prefix(buf, "***** "))
+ if (prefix(str, "***** "))
{
/* Notice "menu" requests */
- if ((buf[6] == '[') && (isdigit(buf[7]) || isalpha(buf[7])))
+ if ((str[6] == '[') && isalpha(str[7]))
{
/* This is a menu file */
menu = TRUE;
/* Extract the menu item */
- k = isdigit(buf[7]) ? D2I(buf[7]) : buf[7] - 'A' + 10;
+ k = str[7] - 'A';
- if ((buf[8] == ']') && (buf[9] == ' '))
+ if ((str[8] == ']') && (str[9] == ' '))
{
/* Extract the menu item */
- strncpy(hook[k], buf + 10, 31);
+ strncpy(hook[k], str + 10, 31);
/* Make sure it's null-terminated */
hook[k][31] = '\0';
}
}
/* Notice "tag" requests */
- else if (buf[6] == '<')
+ else if (str[6] == '<')
{
- buf[strlen(buf) - 1] = '\0';
- add_tag(&tags, buf + 7, next);
+ str[strlen(str) - 1] = '\0';
+ add_tag(&tags, str + 7, next);
}
/* Skip this */
/* Save the number of "real" lines */
size = next;
+ /* start from bottom when reverse mode */
+ if (line == -1) line = ((size-1)/rows)*rows;
+
/* Go to the tagged line */
if (tag) line = get_line(&tags, tag);
Term_clear();
/* Restart when necessary */
- if (line >= size) line = 0;
-
+ if (line >= size - rows) line = size - rows;
+ if (line < 0) line = 0;
/* Re-open the file if needed */
if (next > line)
next++;
}
- /* Dump the next 20 lines of the file */
- for (i = 0; i < 20; )
+ /* Dump the next 20, or rows, lines of the file */
+ for (i = 0; i < rows; )
{
+ int print_x, x;
+ cptr str;
+
/* Hack -- track the "first" line */
if (!i) line = next;
/* Hack -- skip "special" lines */
if (prefix(buf, "***** ")) continue;
+ /* Get a color */
+ if (prefix(buf, "#####"))
+ {
+ color = color_char_to_attr(buf[5]);
+ str = &buf[6];
+ }
+ else
+ {
+ color = TERM_WHITE;
+ str = buf;
+ }
+
/* Count the "real" lines */
next++;
- /* Make a lower case version of buf for searching */
- strcpy(lc_buf, buf);
+ /* Make a lower case version of str for searching */
+ strcpy(lc_buf, str);
for (lc_buf_ptr = lc_buf; *lc_buf_ptr != 0; lc_buf_ptr++)
{
find = NULL;
/* Dump the line */
- Term_putstr(0, i+2, -1, TERM_WHITE, buf);
+ x = 0;
+ print_x = 0;
+ while (str[x])
+ {
+ /* Color ? */
+ if (prefix(str + x, "[[[[["))
+ {
+ byte c = color_char_to_attr(str[x + 5]);
+ x += 6;
+
+ /* Ok print the link name */
+ while (str[x] != ']')
+ {
+ Term_putch(print_x, i + 2, c, str[x]);
+ x++;
+ print_x++;
+ }
+ }
+ else
+ {
+ Term_putch(print_x, i + 2, color, str[x]);
+ print_x++;
+ }
+
+ x++;
+ }
/* Hilite "shower" */
if (shower[0])
{
- cptr str = lc_buf;
+ cptr s2 = lc_buf;
/* Display matches */
- while ((str = strstr(str, shower)) != NULL)
+ while ((s2 = strstr(s2, shower)) != NULL)
{
int len = strlen(shower);
/* Display the match */
- Term_putstr(str-lc_buf, i+2, len, TERM_YELLOW, &buf[str-lc_buf]);
+ Term_putstr(s2-lc_buf, i+2, len, TERM_YELLOW, &str[s2-lc_buf]);
/* Advance */
- str += len;
+ s2 += len;
}
}
caption, line, size), 0, 0);
}
- /* Prompt -- menu screen */
- if (menu)
- {
- /* Wait for it */
-#ifdef JP
-prt("[ ÈÖ¹æ¤òÆþÎϤ·¤Æ²¼¤µ¤¤( ESC¤Ç½ªÎ» ) ]", 23, 0);
-#else
- prt("[Press a Number, or ESC to exit.]", 23, 0);
-#endif
-
- }
-
/* Prompt -- small files */
- else if (size <= 20)
+ if (size <= rows)
{
/* Wait for it */
#ifdef JP
-prt("[¥¡¼:(?)¥Ø¥ë¥× (ESC)½ªÎ»]", 23, 0);
+prt("[¥¡¼:(?)¥Ø¥ë¥× (ESC)½ªÎ»]", hgt - 1, 0);
#else
- prt("[Press ESC to exit.]", 23, 0);
+ prt("[Press ESC to exit.]", hgt - 1, 0);
#endif
}
{
#ifdef JP
if(reverse)
- prt("[¥¡¼:(RET/¥¹¥Ú¡¼¥¹)¢¬ (-)¢ (?)¥Ø¥ë¥× (ESC)½ªÎ»]", 23, 0);
+ prt("[¥¡¼:(RET/¥¹¥Ú¡¼¥¹)¢¬ (-)¢ (?)¥Ø¥ë¥× (ESC)½ªÎ»]", hgt - 1, 0);
else
- prt("[¥¡¼:(RET/¥¹¥Ú¡¼¥¹)¢ (-)¢¬ (?)¥Ø¥ë¥× (ESC)½ªÎ»]", 23, 0);
+ prt("[¥¡¼:(RET/¥¹¥Ú¡¼¥¹)¢ (-)¢¬ (?)¥Ø¥ë¥× (ESC)½ªÎ»]", hgt - 1, 0);
#else
- prt("[Press Return, Space, -, =, /, |, or ESC to exit.]", 23, 0);
+ prt("[Press Return, Space, -, =, /, |, or ESC to exit.]", hgt - 1, 0);
#endif
}
{
/* Get "shower" */
#ifdef JP
-prt("¶¯Ä´: ", 23, 0);
+prt("¶¯Ä´: ", hgt - 1, 0);
#else
- prt("Show: ", 23, 0);
+ prt("Show: ", hgt - 1, 0);
#endif
(void)askfor_aux(shower, 80);
{
/* Get "finder" */
#ifdef JP
-prt("¸¡º÷: ", 23, 0);
+prt("¸¡º÷: ", hgt - 1, 0);
#else
- prt("Find: ", 23, 0);
+ prt("Find: ", hgt - 1, 0);
#endif
{
char tmp[81];
#ifdef JP
-prt("¹Ô: ", 23, 0);
+prt("¹Ô: ", hgt - 1, 0);
#else
- prt("Goto Line: ", 23, 0);
+ prt("Goto Line: ", hgt - 1, 0);
#endif
strcpy(tmp, "0");
{
char tmp[81];
#ifdef JP
-prt("¥Õ¥¡¥¤¥ë¡¦¥Í¡¼¥à: ", 23, 0);
+prt("¥Õ¥¡¥¤¥ë¡¦¥Í¡¼¥à: ", hgt - 1, 0);
strcpy(tmp, "jhelp.hlp");
#else
- prt("Goto File: ", 23, 0);
+ prt("Goto File: ", hgt - 1, 0);
strcpy(tmp, "help.hlp");
#endif
}
}
- /* Hack -- Allow backing up */
+ /* Allow backing up */
if (k == '-')
{
- line = line + (reverse ? 20 : -20);
- if (line < 0) line = ((size-1)/20)*20;
+ line = line + (reverse ? rows : -rows);
+ if (line < 0) line = 0;
}
- /* Hack -- Advance a single line */
+ /* Advance a single line */
if ((k == '\n') || (k == '\r'))
{
line = line + (reverse ? -1 : 1);
- if (line < 0) line = ((size-1)/20)*20;
+ if (line < 0) line = 0;
}
+
+ /* Move up / down */
+ if (k == '8')
+ {
+ line--;
+ if (line < 0) line = 0;
+ }
+
+ if (k == '2') line++;
+
/* Advance one page */
if (k == ' ')
{
- line = line + (reverse ? -20 : 20);
- if (line < 0) line = ((size-1)/20)*20;
+ line = line + (reverse ? -rows : rows);
+ if (line < 0) line = ((size-1)/rows)*rows;
}
/* Recurse on numbers */
{
int key = -1;
- if (isdigit(k)) key = D2I(k);
- else if (isalpha(k)) key = k - 'A' + 10;
+ if (isalpha(k))
+ key = k - 'A';
if ((key > -1) && hook[key][0])
{
#endif
-#if defined(WINDOWS) || defined(MSDOS)
+#if defined(MSDOS)
/* Hack -- max length */
if (k > 8) k = 8;
strcat(tmp,player_name);
/* Re-Draw the name (in light blue) */
+ Term_erase(34, 1, 255);
c_put_str(TERM_L_BLUE, tmp, 1, 34);
/* Erase the prompt, etc */
{
/* Verify */
#ifdef JP
-if (!get_check("°úÂष¤Þ¤¹¤«? ")) return;
+if (!get_check_strict("°úÂष¤Þ¤¹¤«? ", CHECK_NO_HISTORY)) return;
#else
- if (!get_check("Do you want to retire? ")) return;
+ if (!get_check_strict("Do you want to retire? ", CHECK_NO_HISTORY)) return;
#endif
}
if ((!send_world_score(do_send)))
{
#ifdef JP
- if (get_check("¸å¤Ç¥¹¥³¥¢¤òÅÐÏ¿¤¹¤ë¤¿¤á¤ËÂÔµ¡¤·¤Þ¤¹¤«¡©"))
+ if (get_check_strict("¸å¤Ç¥¹¥³¥¢¤òÅÐÏ¿¤¹¤ë¤¿¤á¤ËÂÔµ¡¤·¤Þ¤¹¤«¡©", (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
#else
- if (get_check("Stand by for later score registration? "))
+ if (get_check_strict("Stand by for later score registration? ", (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
#endif
{
wait_report_score = TRUE;
if (numentries > 0)
{
/* Grab an appropriate line number */
- line = rand_int(numentries);
+ line = randint0(numentries);
/* Get the random line */
for (counter = 0; counter <= line; counter++)
errr err = 0;
+ /* Drop priv's */
+ safe_setuid_drop();
+
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_USER, name);
err = process_pref_file_aux(buf, TRUE);
+ /* Grab priv's */
+ safe_setuid_grab();
+
/* Result */
return (err);
}
*/
static void handle_signal_abort(int sig)
{
+ int wid, hgt, rows;
+
+ Term_get_size(&wid, &hgt);
+ rows = hgt - 4;
+
/* Disable handler */
(void)signal(sig, SIG_IGN);
clear_mon_lite();
/* Clear the bottom line */
- Term_erase(0, 23, 255);
+ Term_erase(0, hgt - 1, 255);
/* Give a warning */
- Term_putstr(0, 23, -1, TERM_RED,
+ Term_putstr(0, hgt - 1, -1, TERM_RED,
#ifdef JP
"¶²¤í¤·¤¤¥½¥Õ¥È¤Î¥Ð¥°¤¬Èô¤Ó¤«¤«¤Ã¤Æ¤¤¿¡ª");
#else
/* Message */
#ifdef JP
-Term_putstr(45, 23, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥Ö...");
+Term_putstr(45, hgt - 1, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥Ö...");
#else
- Term_putstr(45, 23, -1, TERM_RED, "Panic save...");
+ Term_putstr(45, hgt - 1, -1, TERM_RED, "Panic save...");
#endif
if (save_player())
{
#ifdef JP
-Term_putstr(45, 23, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥ÖÀ®¸ù¡ª");
+Term_putstr(45, hgt - 1, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥ÖÀ®¸ù¡ª");
#else
- Term_putstr(45, 23, -1, TERM_RED, "Panic save succeeded!");
+ Term_putstr(45, hgt - 1, -1, TERM_RED, "Panic save succeeded!");
#endif
}
else
{
#ifdef JP
-Term_putstr(45, 23, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥Ö¼ºÇÔ¡ª");
+Term_putstr(45, hgt - 1, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥Ö¼ºÇÔ¡ª");
#else
- Term_putstr(45, 23, -1, TERM_RED, "Panic save failed!");
+ Term_putstr(45, hgt - 1, -1, TERM_RED, "Panic save failed!");
#endif
}