{
auto *floor_ptr = player_ptr->current_floor_ptr;
int i = ((randint1(floor_ptr->object_level + 2) + 2) / 2) - 1;
- if (one_in_(GREAT_OBJ)) {
+ if (one_in_(CHANCE_BASEITEM_LEVEL_BOOST)) {
i += randint1(floor_ptr->object_level + 1);
}
#pragma once
/*!
- * @brief ベースアイテム生成階層が加算される確率
- * @details
- * There is a 1/10 (10%) chance of inflating the requested object_level
- * during the creation of an object (see "get_obj_num()" in "object.c").
- * Lower values yield better objects more often.
- */
-#define GREAT_OBJ 10
-
-/*!
* @brief 深層モンスターが生成される(NASTY生成)の基本確率(1/x)
* @details
* There is a 1/25 (4%) chance of inflating the requested monster_level
#define MON_DRAIN_LIFE 2 /*!< モンスターの打撃によるプレイヤーの経験値吸収基本倍率(%) / Percent of player exp drained per hit */
#define USE_DEVICE 3 /*!< 魔道具の最低失敗基準値 x> Harder devices x< Easier devices */
+/*!< ベースアイテム生成階層が加算される確率 */
+constexpr auto CHANCE_BASEITEM_LEVEL_BOOST = 10;
+
constexpr auto MAX_PLAYER_SIGHT = 20; /*!< プレイヤーの最大視界グリッド数 */
constexpr auto MAX_MONSTER_SENSING = 100; /*!< モンスターの最大感知グリッド数 */
PERCENTAGE prob = 0;
if (entry.level <= i) {
- prob = entry.prob1 * GREAT_OBJ * K_MAX_DEPTH;
+ prob = entry.prob1 * CHANCE_BASEITEM_LEVEL_BOOST * K_MAX_DEPTH;
} else if (entry.level - 1 > 0) {
prob = entry.prob1 * i * K_MAX_DEPTH / (entry.level - 1);
}
k_ptr = &baseitems_info[entry.index];
- total[i] += prob / (GREAT_OBJ * K_MAX_DEPTH);
- total_frac += prob % (GREAT_OBJ * K_MAX_DEPTH);
+ total[i] += prob / (CHANCE_BASEITEM_LEVEL_BOOST * K_MAX_DEPTH);
+ total_frac += prob % (CHANCE_BASEITEM_LEVEL_BOOST * K_MAX_DEPTH);
if ((k_ptr->tval == tval) && (k_ptr->sval == sval)) {
home = k_ptr->level;
- rarity[i] += prob / (GREAT_OBJ * K_MAX_DEPTH);
+ rarity[i] += prob / (CHANCE_BASEITEM_LEVEL_BOOST * K_MAX_DEPTH);
}
}
- total[i] += total_frac / (GREAT_OBJ * K_MAX_DEPTH);
+ total[i] += total_frac / (CHANCE_BASEITEM_LEVEL_BOOST * K_MAX_DEPTH);
}
for (int i = 0; i < 22; i++) {
}
if ((level > 0) && dungeons_info[player_ptr->dungeon_idx].flags.has_not(DungeonFeatureType::BEGINNER)) {
- if (one_in_(GREAT_OBJ)) {
+ if (one_in_(CHANCE_BASEITEM_LEVEL_BOOST)) {
level = 1 + (level * MAX_DEPTH / randint1(MAX_DEPTH));
}
}