return MonraceList::get_instance().get_monrace(ARENA_ENTRIES.at(this->current_entry).monrace_id);
}
+/*!
+ * @brief 対戦相手の確認
+ * @return 最後に倒した対戦相手 (鳳凰以下は一律で鳳凰)
+ */
+ArenaRecord ArenaEntryList::check_arena_record() const
+{
+ const auto max_entries = this->get_max_entries();
+ if (this->current_entry <= max_entries) {
+ return ArenaRecord::FENGFUANG;
+ }
+
+ if (this->current_entry < max_entries + 2) {
+ return ArenaRecord::POWER_WYRM;
+ }
+
+ return ArenaRecord::METAL_BABBLE;
+}
+
void ArenaEntryList::increment_entry()
{
this->current_entry++;
#include <optional>
#include <vector>
+enum class ArenaRecord {
+ FENGFUANG,
+ POWER_WYRM,
+ METAL_BABBLE,
+};
+
class BaseitemKey;
class MonsterRaceInfo;
class ArenaEntryList {
const BaseitemKey &get_bi_key() const;
MonsterRaceInfo &get_monrace();
const MonsterRaceInfo &get_monrace() const;
+ ArenaRecord check_arena_record() const;
void increment_entry();
void reset_entry();
void set_defeated_entry();
#include <numeric>
#include <optional>
-namespace {
-enum class ArenaRecord {
- FENGFUANG,
- POWER_WYRM,
- METAL_BABBLE,
-};
-}
-
/*!
* @brief 優勝時のメッセージを表示し、賞金を与える
* @param player_ptr プレイヤーへの参照ポインタ
return 1000000;
}
-/*!
- * @brief 対戦相手の確認
- * @param player_ptr プレイヤーへの参照ポインタ
- * @return 最後に倒した対戦相手 (鳳凰以下は一律で鳳凰)
- */
-static ArenaRecord check_arena_record()
-{
- const auto &entries = ArenaEntryList::get_instance();
- const auto max_entries = entries.get_max_entries();
- if (entries.get_current_entry() <= max_entries) {
- return ArenaRecord::FENGFUANG;
- }
-
- if (entries.get_current_entry() < max_entries + 2) {
- return ArenaRecord::POWER_WYRM;
- }
-
- return ArenaRecord::METAL_BABBLE;
-}
-
static bool check_battle_metal_babble(PlayerType *player_ptr)
{
msg_print(_("君のために最強の挑戦者を用意しておいた。", "The strongest challenger is waiting for you."));
return false;
}
- const auto arena_record = check_arena_record();
+ const auto arena_record = ArenaEntryList::get_instance().check_arena_record();
if (arena_record == ArenaRecord::METAL_BABBLE) {
msg_print(_("あなたはアリーナに入り、しばらくの間栄光にひたった。", "You enter the arena briefly and bask in your glory."));
msg_print(nullptr);