floor.quest_number = QuestId::RANDOM_QUEST1;
parse_fixed_map(player_ptr, QUEST_DEFINITION_LIST, 0, 0, 0, 0);
floor.quest_number = QuestId::NONE;
- for (auto quest_id : EnumRangeInclusive(QuestId::RANDOM_QUEST1, QuestId::RANDOM_QUEST10)) {
+ for (auto quest_id : RANDOM_QUEST_ID_RANGE) {
auto &quest = quests.get_quest(quest_id);
quest.status = QuestStatusType::TAKEN;
determine_random_questor(player_ptr, quest);
#include "system/angband.h"
#include "util/enum-converter.h"
+#include "util/enum-range.h"
#include <map>
#include <string>
#include <vector>
RANDOM_QUEST10 = 49, /*<! ランダムクエストを割り当てるクエストIDの終了値 */
};
+constexpr auto RANDOM_QUEST_ID_RANGE = EnumRangeInclusive(QuestId::RANDOM_QUEST1, QuestId::RANDOM_QUEST10);
constexpr auto MIN_RANDOM_QUEST = enum2i(QuestId::RANDOM_QUEST1);
constexpr auto MAX_RANDOM_QUEST = enum2i(QuestId::RANDOM_QUEST10);
{
if (player_ptr->is_dead) {
auto &quests = QuestList::get_instance();
- for (const auto quest_id : EnumRangeInclusive(QuestId::RANDOM_QUEST1, QuestId::RANDOM_QUEST10)) {
+ for (const auto quest_id : RANDOM_QUEST_ID_RANGE) {
quests.get_quest(quest_id).get_bounty().misc_flags.reset(MonsterMiscType::QUESTOR);
}
const auto level = level_opt.value_or(this->dun_level);
const auto &quests = QuestList::get_instance();
- for (auto quest_id : EnumRangeInclusive(QuestId::RANDOM_QUEST1, QuestId::RANDOM_QUEST10)) {
+ for (auto quest_id : RANDOM_QUEST_ID_RANGE) {
const auto &quest = quests.get_quest(quest_id);
auto is_random_quest = (quest.type == QuestKindType::RANDOM);
is_random_quest &= (quest.status == QuestStatusType::TAKEN);
}
auto &world = AngbandWorld::get_instance();
- for (auto quest_id : EnumRangeInclusive(QuestId::RANDOM_QUEST1, QuestId::RANDOM_QUEST10)) {
+ for (auto quest_id : RANDOM_QUEST_ID_RANGE) {
auto &quest = quests.get_quest(quest_id);
auto is_taken_quest = (quest.type == QuestKindType::RANDOM);
is_taken_quest &= (quest.status == QuestStatusType::TAKEN);