-#include "spell-kind/spells-lite.h"
+#include "spell-kind/spells-lite.h"
#include "dungeon/dungeon-flag-types.h"
-#include "dungeon/dungeon.h"
#include "effect/attribute-types.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "floor/floor-util.h"
#include "floor/geometry.h"
#include "game-option/map-screen-options.h"
-#include "grid/feature.h"
#include "grid/grid.h"
#include "mind/mind-ninja.h"
#include "monster-race/monster-race.h"
#include "monster/monster-update.h"
#include "player/special-defense-types.h"
#include "spell-kind/spells-launcher.h"
+#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
-#include "system/monster-race-definition.h"
-#include "system/monster-type-definition.h"
+#include "system/monster-entity.h"
+#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
+#include "system/terrain-type-definition.h"
#include "target/projection-path-calculator.h"
+#include "timed-effect/player-blindness.h"
+#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/point-2d.h"
#include "view/display-messages.h"
#include "world/world.h"
#include <vector>
-using PassBoldFunc = bool (*)(floor_type *, POSITION, POSITION);
+using PassBoldFunc = bool (*)(FloorType *, POSITION, POSITION);
/*!
* @brief 指定した座標全てを照らす。
if (g_ptr->m_idx) {
PERCENTAGE chance = 25;
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
- auto *r_ptr = &r_info[m_ptr->r_idx];
+ auto *r_ptr = &monraces_info[m_ptr->r_idx];
update_monster(player_ptr, g_ptr->m_idx, false);
- if (r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID)) {
chance = 10;
- if (r_ptr->behavior_flags.has(MonsterBehaviorType::SMART))
+ }
+ if (r_ptr->behavior_flags.has(MonsterBehaviorType::SMART)) {
chance = 100;
+ }
- if (monster_csleep_remaining(m_ptr) && (randint0(100) < chance)) {
+ if (m_ptr->is_asleep() && (randint0(100) < chance)) {
(void)set_monster_csleep(player_ptr, g_ptr->m_idx, 0);
if (m_ptr->ml) {
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(player_ptr, m_name, m_ptr, 0);
- msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
+ const auto m_name = monster_desc(player_ptr, m_ptr, 0);
+ msg_format(_("%s^が目を覚ました。", "%s^ wakes up."), m_name.data());
}
}
}
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
bool do_dark = !g_ptr->is_mirror();
g_ptr->info &= ~(CAVE_TEMP);
- if (!do_dark)
+ if (!do_dark) {
continue;
+ }
if (player_ptr->current_floor_ptr->dun_level || !is_daytime()) {
for (int j = 0; j < 9; j++) {
if (in_bounds2(player_ptr->current_floor_ptr, by, bx)) {
grid_type *cc_ptr = &player_ptr->current_floor_ptr->grid_array[by][bx];
- if (f_info[cc_ptr->get_feat_mimic()].flags.has(FloorFeatureType::GLOW)) {
+ if (terrains_info[cc_ptr->get_feat_mimic()].flags.has(TerrainCharacteristics::GLOW)) {
do_dark = false;
break;
}
}
}
- if (!do_dark)
+ if (!do_dark) {
continue;
+ }
}
g_ptr->info &= ~(CAVE_GLOW);
- if (f_info[g_ptr->get_feat_mimic()].flags.has_not(FloorFeatureType::REMEMBER)) {
- if (!view_torch_grids)
+ if (terrains_info[g_ptr->get_feat_mimic()].flags.has_not(TerrainCharacteristics::REMEMBER)) {
+ if (!view_torch_grids) {
g_ptr->info &= ~(CAVE_MARK);
+ }
note_spot(player_ptr, y, x);
}
* @param pass_bold 地形条件を返す関数ポインタ
* @return 該当地形の数
*/
-static int next_to_open(floor_type *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
+static int next_to_open(FloorType *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
{
int len = 0;
int blen = 0;
* @param pass_bold 地形条件を返す関数ポインタ
* @return 該当地形の数
*/
-static int next_to_walls_adj(floor_type *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
+static int next_to_walls_adj(FloorType *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
{
POSITION y, x;
int c = 0;
y = cy + ddy_ddd[i];
x = cx + ddx_ddd[i];
- if (!pass_bold(floor_ptr, y, x))
+ if (!pass_bold(floor_ptr, y, x)) {
c++;
+ }
}
return c;
auto *g_ptr = &floor_ptr->grid_array[y][x];
// 既に points に追加済みなら何もしない。
- if (g_ptr->info & (CAVE_TEMP))
+ if (g_ptr->info & (CAVE_TEMP)) {
return;
+ }
if (!(g_ptr->info & (CAVE_ROOM))) {
- if (only_room)
+ if (only_room) {
return;
- if (!in_bounds2(floor_ptr, y, x))
+ }
+ if (!in_bounds2(floor_ptr, y, x)) {
return;
- if (distance(player_ptr->y, player_ptr->x, y, x) > get_max_range(player_ptr))
+ }
+ if (distance(player_ptr->y, player_ptr->x, y, x) > get_max_range(player_ptr)) {
return;
+ }
/* Verify this grid */
/*
* properly.
* This leaves only a check for 6 bounding walls!
*/
- if (in_bounds(floor_ptr, y, x) && pass_bold(floor_ptr, y, x) && (next_to_walls_adj(floor_ptr, y, x, pass_bold) == 6) && (next_to_open(floor_ptr, y, x, pass_bold) <= 1))
+ if (in_bounds(floor_ptr, y, x) && pass_bold(floor_ptr, y, x) && (next_to_walls_adj(floor_ptr, y, x, pass_bold) == 6) && (next_to_open(floor_ptr, y, x, pass_bold) <= 1)) {
return;
+ }
}
// (y,x) を points に追加し、追加済みフラグを立てる。
* @param x 指定X座標
* @return 射線を通すならばtrueを返す。
*/
-static bool cave_pass_dark_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+static bool cave_pass_dark_bold(FloorType *floor_ptr, POSITION y, POSITION x)
{
- return cave_has_flag_bold(floor_ptr, y, x, FloorFeatureType::PROJECT);
+ return cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::PROJECT);
}
/*!
const POSITION y = point.y;
const POSITION x = point.x;
- if (!cave_los_bold(floor_ptr, y, x))
+ if (!cave_los_bold(floor_ptr, y, x)) {
continue;
+ }
cave_temp_lite_room_aux(player_ptr, points, y + 1, x);
cave_temp_lite_room_aux(player_ptr, points, y - 1, x);
const POSITION y = point.y;
const POSITION x = point.x;
- if (!cave_pass_dark_bold(floor_ptr, y, x))
+ if (!cave_pass_dark_bold(floor_ptr, y, x)) {
continue;
+ }
cave_temp_unlite_room_aux(player_ptr, points, y + 1, x);
cave_temp_unlite_room_aux(player_ptr, points, y - 1, x);
*/
bool starlight(PlayerType *player_ptr, bool magic)
{
- if (!player_ptr->blind && !magic) {
+ if (!player_ptr->effects()->blindness()->is_blind() && !magic) {
msg_print(_("杖の先が明るく輝いた...", "The end of the staff glows brightly..."));
}
while (attempts--) {
scatter(player_ptr, &y, &x, player_ptr->y, player_ptr->x, 4, PROJECT_LOS);
- if (!cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, FloorFeatureType::PROJECT))
+ if (!cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT)) {
continue;
- if (!player_bold(player_ptr, y, x))
+ }
+ if (!player_bold(player_ptr, y, x)) {
break;
+ }
}
project(player_ptr, 0, 0, y, x, damroll(6 + player_ptr->lev / 8, 10), AttributeType::LITE_WEAK,
*/
bool lite_area(PlayerType *player_ptr, int dam, POSITION rad)
{
- if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) {
+ if (player_ptr->current_floor_ptr->get_dungeon_definition().flags.has(DungeonFeatureType::DARKNESS)) {
msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorbs your light."));
return false;
}
- if (!player_ptr->blind) {
+ if (!player_ptr->effects()->blindness()->is_blind()) {
msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
}
*/
bool unlite_area(PlayerType *player_ptr, int dam, POSITION rad)
{
- if (!player_ptr->blind) {
+ if (!player_ptr->effects()->blindness()->is_blind()) {
msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
}