{"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 }
};
option_info[i].o_text &&
streq(option_info[i].o_text, buf + 2))
{
- if (alive && 6 == option_info[i].o_page)
+ if (p_ptr->playing && 6 == option_info[i].o_page && !p_ptr->wizard)
{
#ifdef JP
msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤¤Þ¤»¤ó! '%s'", buf);
option_info[i].o_text &&
streq(option_info[i].o_text, buf + 2))
{
- if (alive && 6 == option_info[i].o_page)
+ if (p_ptr->playing && 6 == option_info[i].o_page && !p_ptr->wizard)
{
#ifdef JP
msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤¤Þ¤»¤ó! '%s'", buf);
*/
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;
-
- 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;
- }
+ if (!autopick_new_entry(&entry, buf)) return 0;
- /* 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;
}
if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW))
- show_tohit += (weapon_exp[0][o_ptr->sval])/400;
+ show_tohit += (p_ptr->weapon_exp[0][o_ptr->sval])/400;
else
- show_tohit += (weapon_exp[0][o_ptr->sval]-4000)/200;
+ show_tohit += (p_ptr->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);
/* 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
- "%ldÆüÌÜ %2ld:%02ld",
+ "%dÆüÌÜ %2d:%02d",
#else
- "Day %ld %2ld:%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
}
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 */
/* Display "history" info */
if (mode == 1)
{
+ char statmsg[1000];
+
#ifdef JP
put_str("(¥¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á)", 11, 25);
#else
for (i = 0; i < 4; i++)
{
- put_str(history[i], i + 12, 10);
+ put_str(p_ptr->history[i], i + 12, 10);
}
+ *statmsg = '\0';
- if (death && total_winner)
+ if (p_ptr->is_dead && p_ptr->total_winner)
{
#ifdef JP
- put_str("¡Ä¤¢¤Ê¤¿¤Ï¾¡Íø¤Î¸å°úÂष¤¿¡£", 5 + 12, 10);
+ strcpy(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¾¡Íø¤Î¸å°úÂष¤¿¡£");
#else
- put_str("...You retired from the adventure after the winning.", 5 + 12, 10);
+ strcpy(statmsg, "...You retired from the adventure after the winning.");
#endif
}
- else if (death)
+ else if (p_ptr->is_dead)
{
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¡×¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", quest[p_ptr->inside_quest].name, p_ptr->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 in the quest '%s'.", p_ptr->died_from, quest[p_ptr->inside_quest].name);
#endif
+ }
+ else
+ {
+#ifdef JP
+ sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢%s¤Î%d³¬¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), dun_level, p_ptr->died_from);
+#else
+ sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->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(), p_ptr->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.", p_ptr->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 */
char buf[1024];
-#ifndef FAKE_VERSION
- /* Begin dump */
- fprintf(fff, " [Angband %d.%d.%d Character Dump]\n\n",
- VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
-#else
#ifdef JP
fprintf(fff, " [ÊѶòÈÚÅÜ %d.%d.%d ¥¥ã¥é¥¯¥¿¾ðÊó]\n\n",
FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
#endif
-#endif
-
update_playtime();
/* Display player */
display_player(1);
/* Dump part of the screen */
- for (y = 10; 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;
- int max_num, min_num, riding_num;
- if (death)
+ for (i = m_max - 1; i >= 1; i--)
{
- max_num = 21;
- min_num = 0;
- riding_num = 0;
- }
- else
- {
- max_num = m_max;
- min_num = 1;
- riding_num = p_ptr->riding;
- }
-
- for (i = max_num - 1; i >= min_num; i--)
- {
- monster_type *m_ptr;
+ monster_type *m_ptr = &m_list[i];
char pet_name[80];
- if (death)
- m_ptr = &party_mon[i];
- else
- m_ptr = &m_list[i];
-
if (!m_ptr->r_idx) continue;
if (!is_pet(m_ptr)) continue;
- if (!m_ptr->nickname && (riding_num != i)) continue;
+ if (!m_ptr->nickname && (p_ptr->riding != i)) continue;
if (!pet)
{
#ifdef JP
}
monster_desc(pet_name, m_ptr, 0x88);
fprintf(fff, "%s", pet_name);
- if (riding_num == i)
+ if (p_ptr->riding == i)
#ifdef JP
fprintf(fff, " ¾èÇÏÃæ");
#else
if (pet) fprintf(fff, "\n");
}
- if (death && !total_winner)
+ if (p_ptr->is_dead && !p_ptr->total_winner)
{
#ifdef JP
fprintf(fff, "\n [»à¤ÌľÁ°¤Î¥á¥Ã¥»¡¼¥¸]\n\n");
#endif
}
- if (noscore)
+ if (p_ptr->noscore)
#ifdef JP
fprintf(fff, "\n ²¿¤«ÉÔÀµ¤Ê¤³¤È¤ò¤·¤Æ¤·¤Þ¤Ã¤Æ¤Þ¤¹¡£");
#else
/* 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 */
size = next;
/* start from bottom when reverse mode */
- if (line == -1) line = ((size-1)/20)*20;
+ 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 */
flush();
/* Verify Retirement */
- if (total_winner)
+ if (p_ptr->total_winner)
{
/* 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 (!noscore)
+ if (!p_ptr->noscore)
{
/* Special Verification for suicide */
#ifdef JP
}
/* Stop playing */
- alive = FALSE;
+ p_ptr->playing = FALSE;
/* Kill the player */
- death = TRUE;
+ p_ptr->is_dead = TRUE;
/* Leaving */
p_ptr->leaving = TRUE;
- if (!total_winner)
+ if (!p_ptr->total_winner)
{
#ifdef JP
do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥À¥ó¥¸¥ç¥ó¤Îõº÷¤ËÀä˾¤·¤Æ¼«»¦¤·¤¿¡£");
/* Cause of death */
#ifdef JP
-(void)strcpy(died_from, "ÅÓÃ潪λ");
+(void)strcpy(p_ptr->died_from, "ÅÓÃ潪λ");
#else
- (void)strcpy(died_from, "Quitting");
+ (void)strcpy(p_ptr->died_from, "Quitting");
#endif
}
/* The player is not dead */
#ifdef JP
-(void)strcpy(died_from, "(¥»¡¼¥Ö)");
+(void)strcpy(p_ptr->died_from, "(¥»¡¼¥Ö)");
#else
- (void)strcpy(died_from, "(saved)");
+ (void)strcpy(p_ptr->died_from, "(saved)");
#endif
/* Note that the player is not dead */
#ifdef JP
-(void)strcpy(died_from, "(¸µµ¤¤ËÀ¸¤¤Æ¤¤¤ë)");
+(void)strcpy(p_ptr->died_from, "(¸µµ¤¤ËÀ¸¤¤Æ¤¤¤ë)");
#else
- (void)strcpy(died_from, "(alive and well)");
+ (void)strcpy(p_ptr->died_from, "(alive and well)");
#endif
}
*/
void do_cmd_save_and_exit(void)
{
- alive = FALSE;
+ p_ptr->playing = FALSE;
/* Leaving */
p_ptr->leaving = TRUE;
if ((p_ptr->pseikaku == SEIKAKU_MUNCHKIN) && point)
{
point = 1;
- if (total_winner) point = 2;
+ if (p_ptr->total_winner) point = 2;
}
if (easy_band) point = (0 - point);
/* Ignore wizards and borgs */
- if (!(noscore & 0x00FF))
+ if (!(p_ptr->noscore & 0x00FF))
{
/* Ignore people who die in town */
if (dun_level)
/* King or Queen */
- if (total_winner || (p_ptr->lev > PY_MAX_LEVEL))
+ if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
{
#ifdef JP
/* ±ÑÆüÀÚ¤êÂؤ¨ */
#ifdef JP
/* Êè¤Ë¹ï¤à¸ÀÍÕ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¼¨ */
- if (streq(died_from, "ÅÓÃ潪λ"))
+ if (streq(p_ptr->died_from, "ÅÓÃ潪λ"))
{
strcpy(tmp, "<¼«»¦>");
}
else
{
- if (streq(died_from, "ripe"))
+ if (streq(p_ptr->died_from, "ripe"))
{
strcpy(tmp, "°úÂà¸å¤ËÅ·¼÷¤òÁ´¤¦");
}
- else if (streq(died_from, "Seppuku"))
+ else if (streq(p_ptr->died_from, "Seppuku"))
{
strcpy(tmp, "¾¡Íø¤Î¸å¡¢ÀÚÊ¢");
}
else
{
- strcpy(tmp, died_from);
+ strcpy(tmp, p_ptr->died_from);
}
}
center_string(buf, tmp);
put_str(buf, 14, 11);
- if(!streq(died_from, "ripe") && !streq(died_from, "Seppuku"))
+ if(!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku"))
{
if( dun_level == 0 )
{
cptr town = (p_ptr->town_num ? "³¹" : "¹ÓÌî");
- if(streq(died_from, "ÅÓÃ潪λ"))
+ if(streq(p_ptr->died_from, "ÅÓÃ潪λ"))
{
sprintf(tmp, "%s¤Ç»à¤ó¤À", town);
}
}
else
{
- if(streq(died_from, "ÅÓÃ潪λ"))
+ if(streq(p_ptr->died_from, "ÅÓÃ潪λ"))
{
sprintf(tmp, "Ãϲ¼ %d ³¬¤Ç»à¤ó¤À", dun_level);
}
put_str(buf, 14, 11);
- if (strlen(died_from) > 24)
+ if (strlen(p_ptr->died_from) > 24)
{
- strncpy(dummy, died_from, 24);
+ strncpy(dummy, p_ptr->died_from, 24);
dummy[24] = '\0';
(void)sprintf(tmp, "by %s.", dummy);
}
else
- (void)sprintf(tmp, "by %s.", died_from);
+ (void)sprintf(tmp, "by %s.", p_ptr->died_from);
center_string(buf, tmp);
put_str(buf, 15, 11);
#ifndef SCORE_WIZARDS
/* Wizard-mode pre-empts scoring */
- if (noscore & 0x000F)
+ if (p_ptr->noscore & 0x000F)
{
#ifdef JP
msg_print("¥¦¥£¥¶¡¼¥É¡¦¥â¡¼¥É¤Ç¤Ï¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
#ifndef SCORE_BORGS
/* Borg-mode pre-empts scoring */
- if (noscore & 0x00F0)
+ if (p_ptr->noscore & 0x00F0)
{
#ifdef JP
msg_print("¥Ü¡¼¥°¡¦¥â¡¼¥É¤Ç¤Ï¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
#ifndef SCORE_CHEATERS
/* Cheaters are not scored */
- if (noscore & 0xFF00)
+ if (p_ptr->noscore & 0xFF00)
{
#ifdef JP
msg_print("º¾µ½¤ò¤ä¤Ã¤¿¿Í¤Ï¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
/* Interupted */
#ifdef JP
-if (!total_winner && streq(died_from, "¶¯À©½ªÎ»"))
+if (!p_ptr->total_winner && streq(p_ptr->died_from, "¶¯À©½ªÎ»"))
#else
- if (!total_winner && streq(died_from, "Interrupting"))
+ if (!p_ptr->total_winner && streq(p_ptr->died_from, "Interrupting"))
#endif
{
/* Quitter */
#ifdef JP
-if (!total_winner && streq(died_from, "ÅÓÃ潪λ"))
+if (!p_ptr->total_winner && streq(p_ptr->died_from, "ÅÓÃ潪λ"))
#else
- if (!total_winner && streq(died_from, "Quitting"))
+ if (!p_ptr->total_winner && streq(p_ptr->died_from, "Quitting"))
#endif
{
/* Handle death */
- if (death)
+ if (p_ptr->is_dead)
{
/* Handle retirement */
- if (total_winner) kingly();
+ if (p_ptr->total_winner) kingly();
/* Save memories */
#ifdef JP
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;
- death = FALSE;
+ p_ptr->wait_report_score = TRUE;
+ p_ptr->is_dead = FALSE;
#ifdef JP
if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
#else
#endif
}
}
- if (!wait_report_score)
+ if (!p_ptr->wait_report_score)
(void)top_twenty();
}
else if (highscore_fd >= 0)
disturb(1, 0);
/* Mega-Hack -- Delay death */
- if (p_ptr->chp < 0) death = FALSE;
+ if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;
/* Hardcode panic save */
- panic_save = 1;
+ p_ptr->panic_save = 1;
/* Forbid suspend */
signals_ignore_tstp();
/* Indicate panic save */
#ifdef JP
-(void)strcpy(died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
+(void)strcpy(p_ptr->died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
#else
- (void)strcpy(died_from, "(panic save)");
+ (void)strcpy(p_ptr->died_from, "(panic save)");
#endif
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++)
/* Terminate dead characters */
- if (death)
+ if (p_ptr->is_dead)
{
/* Mark the savefile */
#ifdef JP
-(void)strcpy(died_from, "¶¯À©½ªÎ»");
+(void)strcpy(p_ptr->died_from, "¶¯À©½ªÎ»");
#else
- (void)strcpy(died_from, "Abortion");
+ (void)strcpy(p_ptr->died_from, "Abortion");
#endif
forget_lite();
{
/* Cause of "death" */
#ifdef JP
-(void)strcpy(died_from, "¶¯À©½ªÎ»Ãæ");
+(void)strcpy(p_ptr->died_from, "¶¯À©½ªÎ»Ãæ");
#else
- (void)strcpy(died_from, "Interrupting");
+ (void)strcpy(p_ptr->died_from, "Interrupting");
#endif
clear_mon_lite();
/* Stop playing */
- alive = FALSE;
+ p_ptr->playing = FALSE;
/* Suicide */
- death = TRUE;
+ p_ptr->is_dead = TRUE;
/* Leaving */
p_ptr->leaving = TRUE;
*/
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
Term_fresh();
/* Panic Save */
- panic_save = 1;
+ p_ptr->panic_save = 1;
/* Panic save */
#ifdef JP
-(void)strcpy(died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
+(void)strcpy(p_ptr->died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
#else
- (void)strcpy(died_from, "(panic save)");
+ (void)strcpy(p_ptr->died_from, "(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
}