cptr note_level = "";
bool do_level = TRUE;
char note_level_buf[40];
+ int q_idx;
static bool disable_nikki = FALSE;
return (-1);
}
+ q_idx = quest_number(dun_level);
+
if (write_level)
{
if (p_ptr->inside_arena)
#else
note_level = "Surface:";
#endif
- else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
+ else if (q_idx && (is_fixed_quest_idx(q_idx)
+ && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
#ifdef JP
note_level = "¥¯¥¨¥¹¥È:";
#else
case NIKKI_STAIR:
{
cptr to;
- if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
+ if (q_idx && (is_fixed_quest_idx(q_idx)
+ && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
{
#ifdef JP
to = "ÃϾå";
{
if (quest[i].status == QUEST_STATUS_FINISHED)
{
- if (i < MIN_RANDOM_QUEST)
+ if (is_fixed_quest_idx(i))
{
int old_quest;
total++;
- if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
+ if (!is_fixed_quest_idx(i) && quest[i].r_idx)
{
/* Print the quest info */
{
if ((quest[i].status == QUEST_STATUS_FAILED_DONE) || (quest[i].status == QUEST_STATUS_FAILED))
{
- if (i < MIN_RANDOM_QUEST)
+ if (is_fixed_quest_idx(i))
{
int old_quest;
total++;
- if ((i >= MIN_RANDOM_QUEST) && quest[i].r_idx)
+ if (!is_fixed_quest_idx(i) && quest[i].r_idx)
{
/* Print the quest info */
#ifdef JP
#define MIN_RANDOM_QUEST 40
#define MAX_RANDOM_QUEST 49
+/* Check is the quest index is "fixed" */
+#define is_fixed_quest_idx(Q_IDX) (((Q_IDX) < MIN_RANDOM_QUEST) || ((Q_IDX) > MAX_RANDOM_QUEST))
+
#define QUEST_OBERON 8
#define QUEST_SERPENT 9
void leave_quest_check(void)
{
- /* Save quset number for dungeon pref file ($LEAVING_QUEST) */
+ /* Save quest number for dungeon pref file ($LEAVING_QUEST) */
leaving_quest = p_ptr->inside_quest;
/* Leaving an 'only once' quest marks it as failed */
s32b len = TURNS_PER_TICK * TOWN_DAWN;
s32b tick = turn % len + len / 4;
+ int quest_num = quest_number(dun_level);
+
extract_day_hour_min(&day, &hour, &min);
prev_min = (1440 * (tick - TURNS_PER_TICK) / len) % 60;
if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK)
- && (dun_level) &&
- !(quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT || !(quest[quest_number(dun_level)].flags & QUEST_FLAG_PRESET)))) &&
- !(p_ptr->inside_battle))
+ && dun_level &&
+ !(quest_num && (is_fixed_quest_idx(quest_num) &&
+ !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
+ !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) &&
+ !p_ptr->inside_battle)
do_cmd_feeling();
if (p_ptr->inside_battle && !p_ptr->leaving)
/* Refresh */
Term_fresh();
- if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT || !(quest[quest_number(dun_level)].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
+ if (quest_num && (is_fixed_quest_idx(quest_num) &&
+ !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
+ !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
if (p_ptr->inside_battle)
{
}
else
{
-
#ifdef JP
msg_print("»î¹ç³«»Ï¡ª");
#else
d_name+d_info[dungeon_type].name,
r_name+r_info[d_info[dungeon_type].final_guardian].name);
#else
- msg_format("%^s lives in this level as the keeper of %s.",
- r_name+r_info[d_info[dungeon_type].final_guardian].name,
- d_name+d_info[dungeon_type].name);
+ msg_format("%^s lives in this level as the keeper of %s.",
+ r_name+r_info[d_info[dungeon_type].final_guardian].name,
+ d_name+d_info[dungeon_type].name);
#endif
}
}
else
{
+ int q_idx = quest_number(dun_level);
+
#ifdef WORLD_SCORE
/* Make screen dump */
screen_dump = make_screen_dump();
#else
strcpy(buf,"on the surface");
#endif
- else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
+ else if (q_idx && (is_fixed_quest_idx(q_idx) &&
+ !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
#ifdef JP
strcpy(buf,"¥¯¥¨¥¹¥È");
#else
sprintf(statmsg, "...You were killed by %s in %s.", p_ptr->died_from, map_name());
#endif
}
- else if (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST))
+ else if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest))
{
/* Get the quest text */
/* Bewere that INIT_ASSIGN resets the cur_num. */
#endif
}
else
- {
+ {
#ifdef JP
sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢%s¤Î%d³¬¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), dun_level, p_ptr->died_from);
#else
sprintf(statmsg, "...Now, you are in %s.", map_name());
#endif
}
- else if (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST))
+ else if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest))
{
/* Clear the text */
/* Must be done before doing INIT_SHOW_TEXT */
#else
sprintf(statmsg, "...Now, you are in the quest '%s'.", quest[p_ptr->inside_quest].name);
#endif
- }
+ }
else
{
#ifdef JP
if (quest[num].status == QUEST_STATUS_FINISHED)
{
- if (num < MIN_RANDOM_QUEST)
+ if (is_fixed_quest_idx(num))
{
int old_quest;
-
+
/* Set the quest number temporary */
old_quest = p_ptr->inside_quest;
p_ptr->inside_quest = num;
total++;
- if ((num >= MIN_RANDOM_QUEST) && quest[num].r_idx)
+ if (!is_fixed_quest_idx(num) && quest[num].r_idx)
{
/* Print the quest info */
if ((quest[num].status == QUEST_STATUS_FAILED_DONE) || (quest[num].status == QUEST_STATUS_FAILED))
{
- if (num < MIN_RANDOM_QUEST)
+ if (is_fixed_quest_idx(num))
{
int old_quest;
total++;
- if ((num >= MIN_RANDOM_QUEST) && quest[num].r_idx)
+ if (!is_fixed_quest_idx(num) && quest[num].r_idx)
{
/* Print the quest info */
#ifdef JP
/* No effect out of standard dungeon floor */
if (!dun_level || (!up && !down) ||
- (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)) ||
+ (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) ||
p_ptr->inside_arena || p_ptr->inside_battle)
{
/* arena or quest */
/* Accept this monster */
entry->prob2 = entry->prob1;
- if (dun_level && (!p_ptr->inside_quest || p_ptr->inside_quest < MIN_RANDOM_QUEST) && !restrict_monster_to_dungeon(entry->index) && !p_ptr->inside_battle)
+ if (dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && !restrict_monster_to_dungeon(entry->index) && !p_ptr->inside_battle)
{
int hoge = entry->prob2 * d_info[dungeon_type].special_div;
entry->prob2 = hoge / 64;
f6 &= ~(RF6_DARKNESS);
}
- if (dun_level && (!p_ptr->inside_quest || (p_ptr->inside_quest < MIN_RANDOM_QUEST)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
+ if (dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
{
f4 &= (RF4_NOMAGIC_MASK);
f5 &= (RF5_NOMAGIC_MASK);
/* Extract the monster level */
rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
- if (dun_level && (!p_ptr->inside_quest || (p_ptr->inside_quest < MIN_RANDOM_QUEST)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
+ if (dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
{
f4 &= (RF4_NOMAGIC_MASK);
f5 &= (RF5_NOMAGIC_MASK);
wr_byte(quest[i].complev);
/* Save quest status if quest is running */
- if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED || ((i >= MIN_RANDOM_QUEST) && (i <= MAX_RANDOM_QUEST)))
+ if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED || !is_fixed_quest_idx(i))
{
wr_s16b(quest[i].cur_num);
wr_s16b(quest[i].max_num);
/* Prevent destruction of quest levels and town */
- if ((p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)) || !dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
{
return (FALSE);
}
/* Prevent destruction of quest levels and town */
- if ((p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)) || !dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
{
return (FALSE);
}
cptr map_name(void)
{
- if (p_ptr->inside_quest && (p_ptr->inside_quest < MIN_RANDOM_QUEST)
+ if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)
&& (quest[p_ptr->inside_quest].flags & QUEST_FLAG_PRESET))
#ifdef JP
return "¥¯¥¨¥¹¥È";