leave_quest_check(player_ptr);
player_ptr->current_floor_ptr->quest_number = i2enum<QuestId>(g_ptr->special);
const auto quest_number = player_ptr->current_floor_ptr->quest_number;
- if (quest_list[quest_number].status == QuestStatusType::UNTAKEN) {
- if (quest_list[quest_number].type != QuestKindType::RANDOM) {
+ auto &q_ref = quest_list[quest_number];
+ if (q_ref.status == QuestStatusType::UNTAKEN) {
+ if (q_ref.type != QuestKindType::RANDOM) {
init_flags = INIT_ASSIGN;
parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
}
- quest_list[quest_number].status = QuestStatusType::TAKEN;
+ q_ref.status = QuestStatusType::TAKEN;
}
if (!inside_quest(quest_number)) {
}
const auto quest_number = player_ptr->current_floor_ptr->quest_number;
+ auto &q_ref = quest_list[quest_number];
- if (inside_quest(quest_number) && quest_list[quest_number].type == QuestKindType::RANDOM) {
+ if (inside_quest(quest_number) && q_ref.type == QuestKindType::RANDOM) {
leave_quest_check(player_ptr);
player_ptr->current_floor_ptr->quest_number = QuestId::NONE;
}
- if (inside_quest(quest_number) && quest_list[quest_number].type != QuestKindType::RANDOM) {
+ if (inside_quest(quest_number) && q_ref.type != QuestKindType::RANDOM) {
leave_quest_check(player_ptr);
player_ptr->current_floor_ptr->quest_number = i2enum<QuestId>(g_ptr->special);
player_ptr->current_floor_ptr->dun_level = 0;
leave_quest_check(player_ptr);
leave_tower_check(player_ptr);
player_ptr->current_floor_ptr->quest_number = i2enum<QuestId>(g_ptr->special);
- if (quest_list[player_ptr->current_floor_ptr->quest_number].status == QuestStatusType::UNTAKEN) {
- if (quest_list[player_ptr->current_floor_ptr->quest_number].type != QuestKindType::RANDOM) {
+
+ auto ¤t_quest = quest_list[player_ptr->current_floor_ptr->quest_number];
+ if (current_quest.status == QuestStatusType::UNTAKEN) {
+ if (current_quest.type != QuestKindType::RANDOM) {
init_flags = INIT_ASSIGN;
parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
}
- quest_list[player_ptr->current_floor_ptr->quest_number].status = QuestStatusType::TAKEN;
+ current_quest.status = QuestStatusType::TAKEN;
}
if (!inside_quest(player_ptr->current_floor_ptr->quest_number)) {
disturb(player_ptr, true, true);
auto quest_num = quest_number(player_ptr, floor_ptr->dun_level);
const auto &quest_list = QuestList::get_instance();
+ auto *questor_ptr = &r_info[quest_list[quest_num].r_idx];
if (inside_quest(quest_num)) {
- r_info[quest_list[quest_num].r_idx].flags1 |= RF1_QUESTOR;
+ questor_ptr->flags1 |= RF1_QUESTOR;
}
if (player_ptr->max_plv < player_ptr->lev) {
}
}
- if ((inside_quest(quest_num)) && r_info[quest_list[quest_num].r_idx].kind_flags.has_not(MonsterKindType::UNIQUE)) {
- r_info[quest_list[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
+ if ((inside_quest(quest_num)) && questor_ptr->kind_flags.has_not(MonsterKindType::UNIQUE)) {
+ questor_ptr->flags1 &= ~RF1_QUESTOR;
}
if (player_ptr->playing && !player_ptr->is_dead) {
{
auto &quest_list = QuestList::get_instance();
leaving_quest = player_ptr->current_floor_ptr->quest_number;
+
+ auto &tower1 = quest_list[QuestId::TOWER1];
bool is_leaving_from_tower = inside_quest(leaving_quest);
is_leaving_from_tower &= quest_list[leaving_quest].type == QuestKindType::TOWER;
- is_leaving_from_tower &= quest_list[QuestId::TOWER1].status != QuestStatusType::COMPLETED;
+ is_leaving_from_tower &= tower1.status != QuestStatusType::COMPLETED;
if (!is_leaving_from_tower) {
return;
}
if (quest_list[leaving_quest].type != QuestKindType::TOWER) {
return;
}
-
- quest_list[QuestId::TOWER1].status = QuestStatusType::FAILED;
- quest_list[QuestId::TOWER1].complev = player_ptr->lev;
+ tower1.status = QuestStatusType::FAILED;
+ tower1.complev = player_ptr->lev;
update_playtime();
- quest_list[QuestId::TOWER1].comptime = w_ptr->play_time;
+ tower1.comptime = w_ptr->play_time;
}
/*!
auto old_quest = player_ptr->current_floor_ptr->quest_number;
const auto &quest_list = QuestList::get_instance();
- player_ptr->current_floor_ptr->quest_number = (quest_list[num].type == QuestKindType::RANDOM) ? QuestId::NONE : num;
+ const auto &q_ref = quest_list[num];
+ player_ptr->current_floor_ptr->quest_number = (q_ref.type == QuestKindType::RANDOM) ? QuestId::NONE : num;
init_flags = INIT_NAME_ONLY;
parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
player_ptr->current_floor_ptr->quest_number = old_quest;
switch (type) {
case DIARY_FIX_QUEST_C: {
- if (quest_list[num].flags & QUEST_FLAG_SILENT) {
+ if (q_ref.flags & QUEST_FLAG_SILENT) {
break;
}
- fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n", " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest_list[num].name);
+ fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n", " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, q_ref.name);
break;
}
case DIARY_FIX_QUEST_F: {
- if (quest_list[num].flags & QUEST_FLAG_SILENT) {
+ if (q_ref.flags & QUEST_FLAG_SILENT) {
break;
}
- fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n", " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, quest_list[num].name);
+ fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n", " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, q_ref.name);
break;
}
case DIARY_RAND_QUEST_C: {
GAME_TEXT name[MAX_NLEN];
- strcpy(name, r_info[quest_list[num].r_idx].name.c_str());
+ strcpy(name, r_info[q_ref.r_idx].name.c_str());
fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)を達成した。\n", " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name);
break;
}
case DIARY_RAND_QUEST_F: {
GAME_TEXT name[MAX_NLEN];
- strcpy(name, r_info[quest_list[num].r_idx].name.c_str());
+ strcpy(name, r_info[q_ref.r_idx].name.c_str());
fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)から逃げ出した。\n", " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name);
break;
}
case DIARY_TO_QUEST: {
- if (quest_list[num].flags & QUEST_FLAG_SILENT) {
+ if (q_ref.flags & QUEST_FLAG_SILENT) {
break;
}
fprintf(fff, _(" %2d:%02d %20s クエスト「%s」へと突入した。\n", " %2d:%02d %20s entered the quest '%s'.\n"),
- hour, min, note_level, quest_list[num].name);
+ hour, min, note_level, q_ref.name);
break;
}
default:
get_questinfo(player_ptr, questnum, do_init);
const auto &quest_list = QuestList::get_instance();
+ const auto *q_ptr = &quest_list[questnum];
GAME_TEXT tmp_str[80];
- sprintf(tmp_str, _("クエスト情報 (危険度: %d 階相当)", "Quest Information (Danger level: %d)"), (int)quest_list[questnum].level);
+ sprintf(tmp_str, _("クエスト情報 (危険度: %d 階相当)", "Quest Information (Danger level: %d)"), (int)q_ptr->level);
prt(tmp_str, 5, 0);
- prt(quest_list[questnum].name, 7, 0);
+ prt(q_ptr->name, 7, 0);
for (int i = 0; i < 10; i++) {
c_put_str(TERM_YELLOW, quest_text[i], i + 8, 0);
const auto &quest_list = QuestList::get_instance();
QuestId number = quest_number(player_ptr, floor_ptr->dun_level);
- if ((quest_list[number].type != QuestKindType::KILL_LEVEL) && (quest_list[number].type != QuestKindType::RANDOM)) {
+ const auto *q_ptr = &quest_list[number];
+ if ((q_ptr->type != QuestKindType::KILL_LEVEL) && (q_ptr->type != QuestKindType::RANDOM)) {
return true;
}
- if (r_idx != quest_list[number].r_idx) {
+ if (r_idx != q_ptr->r_idx) {
return true;
}
int number_mon = 0;
for (int i2 = 0; i2 < floor_ptr->width; ++i2) {
for (int j2 = 0; j2 < floor_ptr->height; j2++) {
auto quest_monster = (floor_ptr->grid_array[j2][i2].m_idx > 0);
- quest_monster &= (floor_ptr->m_list[floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest_list[number].r_idx);
+ quest_monster &= (floor_ptr->m_list[floor_ptr->grid_array[j2][i2].m_idx].r_idx == q_ptr->r_idx);
if (quest_monster) {
number_mon++;
}
}
}
- if (number_mon + quest_list[number].cur_num >= quest_list[number].max_num) {
+ if (number_mon + q_ptr->cur_num >= q_ptr->max_num) {
return false;
}
return true;
QuestId old_quest = player_ptr->current_floor_ptr->quest_number;
const auto &quest_list = QuestList::get_instance();
const QuestId number = i2enum<QuestId>(eg_ptr->g_ptr->special);
+ const auto *q_ptr = &quest_list[number];
std::string_view msg(_("クエスト「%s」(%d階相当)", "the entrance to the quest '%s'(level %d)"));
for (int j = 0; j < 10; j++) {
quest_text[j][0] = '\0';
init_flags = INIT_NAME_ONLY;
parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
player_ptr->current_floor_ptr->quest_number = old_quest;
- return format(msg.data(), quest_list[number].name, quest_list[number].level);
+ return format(msg.data(), q_ptr->name, q_ptr->level);
}
if (eg_ptr->f_ptr->flags.has(FloorFeatureType::BLDG) && !player_ptr->current_floor_ptr->inside_arena) {
/* Bewere that INIT_ASSIGN resets the cur_num. */
init_flags = INIT_NAME_ONLY;
parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
+
+ const auto *q_ptr = &quest_list[floor_ptr->quest_number];
#ifdef JP
- return std::string(format("…あなたは、クエスト「%s」で%sに殺された。", quest_list[floor_ptr->quest_number].name, player_ptr->died_from.c_str()));
+ return std::string(format("…あなたは、クエスト「%s」で%sに殺された。", q_ptr->name, player_ptr->died_from.c_str()));
#else
- return std::string(format("...You were killed by %s in the quest '%s'.", player_ptr->died_from.c_str(), quest_list[floor_ptr->quest_number].name));
+ return std::string(format("...You were killed by %s in the quest '%s'.", player_ptr->died_from.c_str(), q_ptr->name));
#endif
}