mproc_init(&floor);
while (true) {
- if ((floor.m_cnt + 32 > w_ptr->max_m_idx) && !is_watching) {
+ if ((floor.m_cnt + 32 > MAX_FLOOR_MONSTERS) && !is_watching) {
compact_monsters(player_ptr, 64);
}
compact_monsters(player_ptr, 0);
}
- if (floor.o_cnt + 32 > w_ptr->max_o_idx) {
+ if (floor.o_cnt + 32 > MAX_FLOOR_ITEMS) {
compact_objects(player_ptr, 64);
}
okay = level_gen(player_ptr, &why);
}
- if (floor_ptr->o_max >= w_ptr->max_o_idx) {
+ if (floor_ptr->o_max >= MAX_FLOOR_ITEMS) {
why = _("アイテムが多すぎる", "too many objects");
okay = false;
- } else if (floor_ptr->m_max >= w_ptr->max_m_idx) {
+ } else if (floor_ptr->m_max >= MAX_FLOOR_MONSTERS) {
why = _("モンスターが多すぎる", "too many monsters");
okay = false;
}
}
limit = rd_u16b();
- if (limit > w_ptr->max_o_idx) {
+ if (limit > MAX_FLOOR_ITEMS) {
return 151;
}
}
limit = rd_u16b();
- if (limit > w_ptr->max_m_idx) {
+ if (limit > MAX_FLOOR_MONSTERS) {
return 161;
}
uint16_t limit;
limit = rd_u16b();
- if (limit > w_ptr->max_o_idx) {
+ if (limit > MAX_FLOOR_ITEMS) {
load_note(format(_("アイテムの配列が大きすぎる(%d)!", "Too many (%d) object entries!"), limit));
return 151;
}
}
limit = rd_u16b();
- if (limit > w_ptr->max_m_idx) {
+ if (limit > MAX_FLOOR_MONSTERS) {
load_note(format(_("モンスターの配列が大きすぎる(%d)!", "Too many (%d) monster entries!"), limit));
return 161;
}
#include "util/angband-files.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
-#include "world/world.h"
#include <algorithm>
/*!
{
player_ptr->current_floor_ptr = &floor_info; // TODO:本当はこんなところで初期化したくない
auto *floor_ptr = player_ptr->current_floor_ptr;
- floor_ptr->o_list.assign(w_ptr->max_o_idx, {});
- floor_ptr->m_list.assign(w_ptr->max_m_idx, {});
+ floor_ptr->o_list.assign(MAX_FLOOR_ITEMS, {});
+ floor_ptr->m_list.assign(MAX_FLOOR_MONSTERS, {});
for (auto &list : floor_ptr->mproc_list) {
- list.assign(w_ptr->max_m_idx, {});
+ list.assign(MAX_FLOOR_MONSTERS, {});
}
max_dlv.assign(dungeons_info.size(), {});
MONSTER_IDX m_pop(FloorType *floor_ptr)
{
/* Normal allocation */
- if (floor_ptr->m_max < w_ptr->max_m_idx) {
- MONSTER_IDX i = floor_ptr->m_max;
+ if (floor_ptr->m_max < MAX_FLOOR_MONSTERS) {
+ const auto i = floor_ptr->m_max;
floor_ptr->m_max++;
floor_ptr->m_cnt++;
return i;
}
/* Recycle dead monsters */
- for (MONSTER_IDX i = 1; i < floor_ptr->m_max; i++) {
- MonsterEntity *m_ptr;
- m_ptr = &floor_ptr->m_list[i];
- if (MonsterRace(m_ptr->r_idx).is_valid()) {
+ for (short i = 1; i < floor_ptr->m_max; i++) {
+ const auto &monster = floor_ptr->m_list[i];
+ if (MonsterRace(monster.r_idx).is_valid()) {
continue;
}
+
floor_ptr->m_cnt++;
return i;
}
if (w_ptr->character_dungeon) {
msg_print(_("モンスターが多すぎる!", "Too many monsters!"));
}
+
return 0;
}
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
-#include "world/world.h"
#if JP
#else
#include "monster/monster-description-types.h"
*/
void mproc_add(FloorType *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
{
- if (floor_ptr->mproc_max[mproc_type] < w_ptr->max_m_idx) {
+ if (floor_ptr->mproc_max[mproc_type] < MAX_FLOOR_MONSTERS) {
floor_ptr->mproc_list[mproc_type][floor_ptr->mproc_max[mproc_type]++] = (int16_t)m_idx;
}
}
constexpr auto CHANCE_ABILITY_SCORE_DECREASE = 16; /*!< 属性攻撃を受けた際に能力値低下を起こす確率(1/n) */
constexpr auto CHANCE_STRENGTHENING = 12; /*!< ランダムアーティファクトにバイアス外の耐性がつき、4を超えるpvalを許可する確率 */
constexpr auto STANDARD_SPEED = 110; /* プレイヤー/モンスターの標準速度 (加速0) */
+constexpr short MAX_FLOOR_ITEMS = 1024; /*!< 1フロアに存在可能な最大アイテム数 */
+constexpr short MAX_FLOOR_MONSTERS = 1024; /*!< 1フロアに存在可能な最大モンスター数 */
/*!
* @brief 1フロアに存在可能な、増殖フラグ付きモンスター実体の最大数
*/
OBJECT_IDX o_pop(FloorType *floor_ptr)
{
- if (floor_ptr->o_max < w_ptr->max_o_idx) {
- OBJECT_IDX i = floor_ptr->o_max;
+ if (floor_ptr->o_max < MAX_FLOOR_ITEMS) {
+ const auto i = floor_ptr->o_max;
floor_ptr->o_max++;
floor_ptr->o_cnt++;
return i;
}
- for (OBJECT_IDX i = 1; i < floor_ptr->o_max; i++) {
+ for (short i = 1; i < floor_ptr->o_max; i++) {
if (floor_ptr->o_list[i].is_valid()) {
continue;
}
bool wizard{}; /* This world under wizard mode */
- OBJECT_IDX max_o_idx = 1024; /*!< 1フロアに存在可能な最大アイテム数 */
- MONSTER_IDX max_m_idx = 1024; /*!< 1フロアに存在可能な最大モンスター数 */
-
void set_arena(const bool new_status);
bool get_arena() const;
std::tuple<int, int, int> extract_date_time(PlayerRaceType start_race) const;