#include "monster/monster-info.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "mutation/mutation-flag-types.h"
#include "object/warning.h"
#include "player-base/player-class.h"
std::string m_name;
bool can_move = true;
bool do_past = false;
- if (is_monster(grid.m_idx) && (m_ptr->ml || p_can_enter || p_can_kill_walls)) {
+ if (grid.has_monster() && (m_ptr->ml || p_can_enter || p_can_kill_walls)) {
auto *r_ptr = &m_ptr->get_monrace();
auto effects = player_ptr->effects();
auto is_stunned = effects->stun()->is_stunned();
#include "monster/monster-description-types.h"
#include "monster/monster-flag-types.h"
#include "monster/monster-info.h"
-#include "monster/monster-util.h"
#include "mutation/mutation-flag-types.h"
#include "mutation/mutation-techniques.h"
#include "object-enchant/item-feeling.h"
const auto y = player_ptr->y + ddy[dir];
const auto x = player_ptr->x + ddx[dir];
const auto &grid = floor.grid_array[y][x];
- if (!is_monster(grid.m_idx)) {
+ if (!grid.has_monster()) {
msg_print(_("邪悪な存在を感じとれません!", "You sense no evil there!"));
return true;
}
const auto y = player_ptr->y + ddy[dir];
const auto x = player_ptr->x + ddx[dir];
auto &grid = floor.grid_array[y][x];
- if (!is_monster(grid.m_idx)) {
+ if (!grid.has_monster()) {
msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
return true;
}
#include "grid/grid.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
-#include "monster/monster-util.h"
#include "object/object-mark-types.h"
#include "player-status/player-energy.h"
#include "player/player-status-flags.h"
int new_dir = cycle[chome[prev_dir] + i];
const Pos2D pos(player_ptr->y + ddy[new_dir], player_ptr->x + ddx[new_dir]);
const auto &grid = floor.get_grid(pos);
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
const auto &monster = floor.m_list[grid.m_idx];
if (monster.ml) {
return true;
#include "game-option/special-options.h"
#include "grid/feature.h"
#include "grid/grid.h"
-#include "monster/monster-util.h"
#include "player-status/player-energy.h"
#include "player/player-move.h"
#include "system/floor-type-definition.h"
POSITION row = player_ptr->y + ddy[dir];
POSITION col = player_ptr->x + ddx[dir];
g_ptr = &floor_ptr->grid_array[row][col];
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
auto *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
if (m_ptr->ml) {
return 0;
#include "monster/monster-describer.h"
#include "monster/monster-info.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "mspell/mspell-damage-calculator.h"
#include "spell-kind/spells-launcher.h"
#include "spell-kind/spells-lite.h"
const auto &floor = *player_ptr->current_floor_ptr;
const Pos2D pos(target_row, target_col);
const auto &grid = floor.get_grid(pos);
- if (!is_monster(grid.m_idx) || !grid.has_los() || !projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col)) {
+ if (!grid.has_monster() || !grid.has_los() || !projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col)) {
return std::nullopt;
}
#include "monster/monster-info.h"
#include "monster/monster-processor.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "mspell/monster-power-table.h"
#include "player-base/player-class.h"
#include "player-info/mane-data-type.h"
const auto &floor = *player_ptr->current_floor_ptr;
const Pos2D pos(target_row, target_col);
const auto &grid_target = floor.get_grid(pos);
- auto should_teleport = !is_monster(grid_target.m_idx);
+ auto should_teleport = !grid_target.has_monster();
should_teleport &= grid_target.has_los();
should_teleport &= projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col);
if (!should_teleport) {
#include "inventory/inventory-object.h"
#include "inventory/inventory-slot-types.h"
#include "io/input-key-requester.h"
-#include "monster/monster-util.h"
#include "object/tval-types.h"
#include "player-base/player-class.h"
#include "player-info/samurai-data-type.h"
const auto o_idx = chest_check(player_ptr->current_floor_ptr, pos, false);
if (grid.get_terrain_mimic().flags.has_not(TerrainCharacteristics::OPEN) && !o_idx) {
msg_print(_("そこには開けるものが見当たらない。", "You see nothing there to open."));
- } else if (is_monster(grid.m_idx) && player_ptr->riding != grid.m_idx) {
+ } else if (grid.has_monster() && player_ptr->riding != grid.m_idx) {
PlayerEnergy(player_ptr).set_player_turn_energy(100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
const auto &grid = player_ptr->current_floor_ptr->get_grid(pos);
if (grid.get_terrain_mimic().flags.has_not(TerrainCharacteristics::CLOSE)) {
msg_print(_("そこには閉じるものが見当たらない。", "You see nothing there to close."));
- } else if (is_monster(grid.m_idx)) {
+ } else if (grid.has_monster()) {
PlayerEnergy(player_ptr).set_player_turn_energy(100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
const auto o_idx = chest_check(player_ptr->current_floor_ptr, pos, true);
if (!is_trap(player_ptr, feat) && !o_idx) {
msg_print(_("そこには解除するものが見当たらない。", "You see nothing there to disarm."));
- } else if (is_monster(grid.m_idx) && player_ptr->riding != grid.m_idx) {
+ } else if (grid.has_monster() && player_ptr->riding != grid.m_idx) {
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
} else if (o_idx) {
const Grid &grid = player_ptr->current_floor_ptr->get_grid(pos);
if (grid.get_terrain_mimic().flags.has_not(TerrainCharacteristics::BASH)) {
msg_print(_("そこには体当たりするものが見当たらない。", "You see nothing there to bash."));
- } else if (is_monster(grid.m_idx)) {
+ } else if (grid.has_monster()) {
PlayerEnergy(player_ptr).set_player_turn_energy(100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
msg_print(_("そこにはくさびを打てるものが見当たらない。", "You see nothing there to spike."));
} else if (!get_spike(player_ptr, &i_idx)) {
msg_print(_("くさびを持っていない!", "You have no spikes!"));
- } else if (is_monster(grid.m_idx)) {
+ } else if (grid.has_monster()) {
PlayerEnergy(player_ptr).set_player_turn_energy(100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
#include "io/write-diary.h"
#include "main/music-definitions-table.h"
#include "main/sound-of-music.h"
-#include "monster/monster-util.h"
#include "player-base/player-class.h"
#include "player-info/samurai-data-type.h"
#include "player-status/player-energy.h"
const auto &grid = player_ptr->current_floor_ptr->get_grid(pos);
const auto &terrain = grid.get_terrain_mimic();
PlayerEnergy(player_ptr).set_player_turn_energy(100);
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
return false;
}
#include "monster/monster-info.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "monster/smart-learn-types.h"
#include "object-hook/hook-weapon.h"
#include "pet/pet-util.h"
return false;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
PlayerEnergy(player_ptr).set_player_turn_energy(100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
const auto *m_ptr = &player_ptr->current_floor_ptr->m_list[grid.m_idx];
- if (!is_monster(grid.m_idx) || !m_ptr->ml) {
+ if (!grid.has_monster() || !m_ptr->ml) {
msg_print(_("その場所にはモンスターはいません。", "There is no monster here."));
return false;
}
target_pet = old_target_pet;
auto &floor = *player_ptr->current_floor_ptr;
const auto &grid = floor.grid_array[target_row][target_col];
- if (!is_monster(grid.m_idx)) {
+ if (!grid.has_monster()) {
return;
}
player_ptr->pet_t_m_idx = 0;
} else {
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[target_row][target_col];
- if (is_monster(g_ptr->m_idx) && (player_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
+ if (g_ptr->has_monster() && (player_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
player_ptr->pet_t_m_idx = player_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
player_ptr->pet_follow_distance = PET_DESTROY_DIST;
} else {
#include "floor/geometry.h"
#include "grid/grid.h"
#include "io/input-key-requester.h"
-#include "monster/monster-util.h"
#include "player-base/player-class.h"
#include "player-info/samurai-data-type.h"
#include "player-status/player-energy.h"
msg_print(_("ドアは掘れない。", "You cannot tunnel through doors."));
} else if (terrain_mimic.flags.has_not(TerrainCharacteristics::TUNNEL)) {
msg_print(_("そこは掘れない。", "You can't tunnel through that."));
- } else if (is_monster(grid.m_idx)) {
+ } else if (grid.has_monster()) {
PlayerEnergy(player_ptr).set_player_turn_energy(100);
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "object/object-broken.h"
#include "object/object-info.h"
#include "object/object-mark-types.h"
if (snipe_type == SP_KILL_WALL) {
g_ptr = &floor_ptr->grid_array[ny][nx];
- if (g_ptr->cave_has_flag(TerrainCharacteristics::HURT_ROCK) && !is_monster(g_ptr->m_idx)) {
+ if (g_ptr->cave_has_flag(TerrainCharacteristics::HURT_ROCK) && !g_ptr->has_monster()) {
if (any_bits(g_ptr->info, (CAVE_MARK))) {
msg_print(_("岩が砕け散った。", "Wall rocks were shattered."));
}
}
/* Stopped by walls/doors */
- if (!cave_has_flag_bold(floor_ptr, ny, nx, TerrainCharacteristics::PROJECT) && !is_monster(floor_ptr->grid_array[ny][nx].m_idx)) {
+ if (!cave_has_flag_bold(floor_ptr, ny, nx, TerrainCharacteristics::PROJECT) && !floor_ptr->grid_array[ny][nx].has_monster()) {
break;
}
y = ny;
/* Monster here, Try to hit it */
- if (is_monster(floor_ptr->grid_array[y][x].m_idx)) {
+ if (floor_ptr->grid_array[y][x].has_monster()) {
sound(SOUND_SHOOT_HIT);
Grid *c_mon_ptr = &floor_ptr->grid_array[y][x];
if (player_can_see_bold(player_ptr, y, x)) {
obvious = true;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
update_monster(player_ptr, grid.m_idx, false);
}
if (player_can_see_bold(player_ptr, y, x)) {
obvious = true;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
update_monster(player_ptr, grid.m_idx, false);
}
*/
static ProcessResult is_affective(PlayerType *player_ptr, EffectMonster *em_ptr)
{
- if (!is_monster(em_ptr->g_ptr->m_idx)) {
+ if (!em_ptr->g_ptr->has_monster()) {
return ProcessResult::PROCESS_FALSE;
}
if (is_monster(em_ptr->src_idx) && (em_ptr->g_ptr->m_idx == em_ptr->src_idx)) {
if (!src_idx && (project_m_n == 1) && none_bits(flag, PROJECT_JUMP)) {
const Pos2D pos_project(project_m_y, project_m_x);
const auto &grid = floor.get_grid(pos_project);
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
auto &monster = floor.m_list[grid.m_idx];
if (monster.ml) {
if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
#include "grid/grid.h"
#include "monster-race/monster-race.h"
#include "monster/monster-info.h"
-#include "monster/monster-util.h"
#include "room/lake-types.h"
#include "spell-kind/spells-floor.h"
#include "system/artifact-type-definition.h"
}
auto *r_ptr = &monraces_info[floor.m_list[grid.m_idx].r_idx];
- if (is_monster(grid.m_idx) && !(streamer.flags.has(TerrainCharacteristics::PLACE) && monster_can_cross_terrain(player_ptr, feat, r_ptr, 0))) {
+ if (grid.has_monster() && !(streamer.flags.has(TerrainCharacteristics::PLACE) && monster_can_cross_terrain(player_ptr, feat, r_ptr, 0))) {
/* Delete the monster (if any) */
delete_monster(player_ptr, pos.y, pos.x);
}
#include "grid/object-placer.h"
#include "grid/trap.h"
#include "monster-race/monster-race.h"
-#include "monster/monster-util.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
{
auto *floor_ptr = player_ptr->current_floor_ptr;
auto *g_ptr = &floor_ptr->grid_array[y][x];
- if (!g_ptr->is_floor() || pattern_tile(floor_ptr, y, x) || !g_ptr->o_idx_list.empty() || is_monster(g_ptr->m_idx) || next_to_walls(floor_ptr, y, x) < walls) {
+ if (!g_ptr->is_floor() || pattern_tile(floor_ptr, y, x) || !g_ptr->o_idx_list.empty() || g_ptr->has_monster() || next_to_walls(floor_ptr, y, x) < walls) {
return false;
}
x = randint0(floor_ptr->width);
const Pos2D pos(y, x);
const auto &grid = floor_ptr->get_grid(pos);
- if (!grid.is_floor() || !grid.o_idx_list.empty() || is_monster(grid.m_idx)) {
+ if (!grid.is_floor() || !grid.o_idx_list.empty() || grid.has_monster()) {
continue;
}
continue;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
delete_monster_idx(player_ptr, grid.m_idx);
}
continue;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
delete_monster_idx(player_ptr, grid.m_idx);
}
#include "grid/lighting-colors-table.h"
#include "mind/mind-ninja.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "player/special-defense-types.h"
#include "room/door-definition.h"
#include "system/dungeon-info.h"
g_ptr->info &= ~(CAVE_MARK);
}
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
update_monster(player_ptr, g_ptr->m_idx, false);
}
auto *cc_ptr = &floor_ptr->grid_array[yy][xx];
cc_ptr->info |= CAVE_GLOW;
if (cc_ptr->is_view()) {
- if (is_monster(cc_ptr->m_idx)) {
+ if (cc_ptr->has_monster()) {
update_monster(player_ptr, cc_ptr->m_idx, false);
}
#include "monster/monster-info.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "object/item-tester-hooker.h"
#include "object/object-mark-types.h"
#include "player-info/class-info.h"
const auto &grid = player_ptr->current_floor_ptr->get_grid({ y, x });
/* Must be a "naked" floor grid */
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
continue;
}
if (floor.is_in_dungeon()) {
return;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
update_monster(player_ptr, grid.m_idx, false);
}
return false;
}
- if (is_monster(grid.m_idx) && (grid.m_idx != m_idx)) {
+ if (grid.has_monster() && (grid.m_idx != m_idx)) {
return false;
}
if (player_ptr->is_located_at(pos)) {
return false;
}
- if (is_monster(grid.m_idx) && (grid.m_idx != player_ptr->riding)) {
+ if (grid.has_monster() && (grid.m_idx != player_ptr->riding)) {
return false;
}
return;
}
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
delete_monster_idx(player_ptr, g_ptr->m_idx);
}
}
#include "game-option/special-options.h"
#include "grid/feature.h"
#include "io/screen-util.h"
-#include "monster/monster-util.h"
#include "player/player-status.h"
#include "system/angband-system.h"
#include "system/floor-type-definition.h"
TERM_COLOR ta = default_color;
auto tc = '*';
- if (is_monster(g_ptr->m_idx) && floor_ptr->m_list[g_ptr->m_idx].ml) {
+ if (g_ptr->has_monster() && floor_ptr->m_list[g_ptr->m_idx].ml) {
map_info(player_ptr, ny, nx, &a, &c, &ta, &tc);
if (!is_ascii_graphics(a)) {
#include "grid/feature.h"
#include "grid/grid.h"
#include "mind/mind-numbers.h"
-#include "monster/monster-util.h"
#include "player-attack/player-attack.h"
#include "player/player-move.h"
#include "spell-kind/earthquake.h"
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (!is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return false;
}
y += ddy[dir];
x += ddx[dir];
- if (player_can_enter(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat) && !is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_can_enter(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat) && !player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
msg_print(nullptr);
(void)move_player_effect(player_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
}
#include "monster/monster-describer.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "pet/pet-util.h"
#include "player-base/player-class.h"
#include "player-info/equipment-info.h"
PLAYER_LEVEL plev = player_ptr->lev;
int dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
fire_beam(player_ptr, AttributeType::MISSILE, dir, dam);
- if (!is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
return true;
}
#include "monster/monster-describer.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "object-enchant/trc-types.h"
#include "object/object-kind-hook.h"
#include "player-attack/player-attack.h"
continue;
}
- if (!is_monster(grid_new.m_idx)) {
+ if (!grid_new.has_monster()) {
if (tm_idx) {
msg_print(_("失敗!", "Failed!"));
} else {
#include "mind/mind-warrior.h"
#include "cmd-action/cmd-attack.h"
#include "floor/geometry.h"
-#include "monster/monster-util.h"
#include "spell-kind/spells-teleport.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
}
POSITION y = player_ptr->y + ddy[dir];
POSITION x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
if (randint0(player_ptr->skill_dis) < 7) {
msg_print(_("うまく逃げられなかった。", "You failed to run away."));
g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
/* Hack -- attack monsters */
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
} else {
msg_print(_("攻撃が空をきった。", "You attack the empty air."));
#include "monster-race/monster-race.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "player-attack/player-attack.h"
#include "player-base/player-class.h"
#include "player-info/monk-data-type.h"
}
POSITION y = player_ptr->y + ddy[dir];
POSITION x = player_ptr->x + ddx[dir];
- if (!is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
msg_print(nullptr);
return true;
}
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
handle_stuff(player_ptr);
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
}
#include "monster/monster-processor-util.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
*/
bool process_monster_attack_to_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, Grid *g_ptr, bool can_cross)
{
- if (!turn_flags_ptr->do_move || !is_monster(g_ptr->m_idx)) {
+ if (!turn_flags_ptr->do_move || !g_ptr->has_monster()) {
return false;
}
#include "monster/monster-processor-util.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "pet/pet-util.h"
#include "player/player-status-flags.h"
#include "system/angband-system.h"
return true;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
turn_flags_ptr->do_move = true;
return true;
}
#include "monster/monster-info.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
#include "system/item-entity.h"
}
g_ptr = &floor_ptr->grid_array[y][x];
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
delete_monster_idx(player_ptr, g_ptr->m_idx);
}
}
int number_mon = 0;
for (int i2 = 0; i2 < floor.width; ++i2) {
for (int j2 = 0; j2 < floor.height; j2++) {
- auto quest_monster = is_monster(floor.grid_array[j2][i2].m_idx);
+ auto quest_monster = floor.grid_array[j2][i2].has_monster();
quest_monster &= (floor.m_list[floor.grid_array[j2][i2].m_idx].r_idx == q_ptr->r_idx);
if (quest_monster) {
number_mon++;
g_ptr->m_idx = m_pop(&floor);
hack_m_idx_ii = g_ptr->m_idx;
- if (!is_monster(g_ptr->m_idx)) {
+ if (!g_ptr->has_monster()) {
return false;
}
#include "monster/monster-describer.h"
#include "monster/monster-flag-types.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "monster/smart-learn-types.h"
#include "player/player-status-flags.h"
#include "system/floor-type-definition.h"
if (player_ptr->is_located_at(pos)) {
return false;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
return false;
}
if (!in_bounds(floor_ptr, ay, ax)) {
continue;
}
- if (is_monster(floor_ptr->grid_array[ay][ax].m_idx)) {
+ if (floor_ptr->grid_array[ay][ax].has_monster()) {
count++;
}
}
continue;
}
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
k++;
}
}
#include "monster/monster-info.h"
#include "monster/monster-processor-util.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "monster/smart-learn-types.h"
#include "player-base/player-class.h"
#include "player-info/samurai-data-type.h"
}
player_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = g_ptr->m_idx;
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
y_ptr->fy = oy;
y_ptr->fx = ox;
update_monster(player_ptr, g_ptr->m_idx, true);
for (const auto &[y, x] : grid_g) {
const Pos2D pos(y, x);
const auto &grid = floor_ptr->get_grid(pos);
- if (is_monster(grid.m_idx) && (y != y2 || x != x2)) {
+ if (grid.has_monster() && (y != y2 || x != x2)) {
auto *m_ptr = &floor_ptr->m_list[grid.m_idx];
if (is_friend == m_ptr->is_pet()) {
return false;
#include "monster-race/monster-race.h"
#include "monster-race/race-flags-resistance.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "player-base/player-class.h"
#include "player-base/player-race.h"
#include "player-info/race-info.h"
const auto &grid = floor.get_grid(pos);
if (y == y2 && x == x2) {
hit2 = true;
- } else if (is_friend && is_monster(grid.m_idx) && !m_ptr->is_hostile_to_melee(floor.m_list[grid.m_idx])) {
+ } else if (is_friend && grid.has_monster() && !m_ptr->is_hostile_to_melee(floor.m_list[grid.m_idx])) {
return false;
}
#include "floor/geometry.h"
#include "grid/grid.h"
#include "monster/monster-info.h"
-#include "monster/monster-util.h"
#include "player/digestion-processor.h"
#include "player/player-move.h"
#include "player/player-status.h"
msg_print(_("この地形は食べられない。", "You cannot eat this feature."));
} else if (terrain.flags.has(TerrainCharacteristics::PERMANENT)) {
msg_format(_("いてっ!この%sはあなたの歯より硬い!", "Ouch! This %s is harder than your teeth!"), terrain_mimic.name.data());
- } else if (is_monster(grid.m_idx)) {
+ } else if (grid.has_monster()) {
const auto &monster = player_ptr->current_floor_ptr->m_list[grid.m_idx];
msg_print(_("何かが邪魔しています!", "There's something in the way!"));
if (!monster.ml || !monster.is_pet()) {
#include "monster/monster-pain-describer.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "object-enchant/tr-types.h"
#include "object-hook/hook-expendable.h"
#include "object-hook/hook-weapon.h"
auto *floor_ptr = this->player_ptr->current_floor_ptr;
auto *angry_m_ptr = &floor_ptr->m_list[floor_ptr->grid_array[this->y][this->x].m_idx];
- if (!is_monster(floor_ptr->grid_array[this->y][this->x].m_idx) || !angry_m_ptr->is_friendly() || angry_m_ptr->is_invulnerable()) {
+ if (!floor_ptr->grid_array[this->y][this->x].has_monster() || !angry_m_ptr->is_friendly() || angry_m_ptr->is_invulnerable()) {
this->do_drop = false;
return;
}
#include "monster-race/race-indice-types.h"
#include "monster/monster-info.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "mspell/mspell-damage-calculator.h"
#include "mutation/mutation-flag-types.h"
#include "object-enchant/tr-types.h"
const auto *g_ptr = &floor.grid_array[my][mx];
- if (!is_monster(g_ptr->m_idx)) {
+ if (!g_ptr->has_monster()) {
continue;
}
#include "monster-attack/monster-attack-player.h"
#include "monster-race/monster-race.h"
#include "monster/monster-describer.h"
-#include "monster/monster-util.h"
#include "pet/pet-util.h"
#include "player-base/player-class.h"
#include "player/player-damage.h"
Grid *g_ptr;
g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
continue;
}
}
earthquake(player_ptr, player_ptr->y, player_ptr->x, 10, 0);
- if (!is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
*(pa_ptr->mdeath) = true;
}
}
POSITION x = player_ptr->x + ddx_ddd[dir];
g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
- if (is_monster(g_ptr->m_idx) && (m_ptr->ml || cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
+ if (g_ptr->has_monster() && (m_ptr->ml || cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
}
}
#include "monster-race/monster-race-hook.h"
#include "monster-race/monster-race.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "monster/smart-learn-types.h"
#include "mutation/mutation-calculator.h"
#include "mutation/mutation-flag-types.h"
}
lite_spot(player_ptr, y, x);
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
update_monster(player_ptr, g_ptr->m_idx, false);
}
*/
bool player_place(PlayerType *player_ptr, POSITION y, POSITION x)
{
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
return false;
}
#include "dungeon/dungeon-flag-types.h"
#include "floor/geometry.h"
#include "hpmp/hp-mp-processor.h"
-#include "monster/monster-util.h"
#include "player/digestion-processor.h"
#include "player/player-status.h"
#include "spell-kind/spells-specific-bolt.h"
POSITION x = player_ptr->x + ddx[dir];
const auto *g_ptr = &floor.grid_array[y][x];
stop_mouth(player_ptr);
- if (!is_monster(g_ptr->m_idx)) {
+ if (!g_ptr->has_monster()) {
msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
return false;
}
#include "inventory/inventory-slot-types.h"
#include "io/input-key-requester.h"
#include "monster-race/monster-race.h"
-#include "monster/monster-util.h"
#include "object-enchant/object-curse.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
if (dir == 5) {
continue;
}
- if (is_monster(floor_ptr->grid_array[dy][dx].m_idx)) {
+ if (floor_ptr->grid_array[dy][dx].has_monster()) {
flag = true;
}
}
#include "monster/monster-describer.h"
#include "monster/monster-info.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "object-enchant/tr-types.h"
#include "player-info/equipment-info.h"
#include "player/player-damage.h"
y = player_ptr->y + ddy_cdd[cdir];
x = player_ptr->x + ddx_cdd[cdir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
} else {
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = player_ptr->y + ddy_cdd[(cdir + 7) % 8];
x = player_ptr->x + ddx_cdd[(cdir + 7) % 8];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
} else {
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = player_ptr->y + ddy_cdd[(cdir + 1) % 8];
x = player_ptr->x + ddx_cdd[(cdir + 1) % 8];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
} else {
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_FIRE);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_MINEUCHI);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
const auto *floor_ptr = player_ptr->current_floor_ptr;
const auto &grid = floor_ptr->grid_array[y][x];
- if (!is_monster(grid.m_idx)) {
+ if (!grid.has_monster()) {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return std::nullopt;
}
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_POISON);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_ZANMA);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
x = player_ptr->x + ddx[dir];
const auto &floor = *player_ptr->current_floor_ptr;
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
if (floor.get_dungeon_definition().flags.has(DungeonFeatureType::NO_MELEE)) {
return "";
}
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
int i;
POSITION ty = y, tx = x;
POSITION oy = y, ox = x;
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_HAGAN);
}
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_COLD);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_KYUSHO);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_MAJIN);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_SUTEMI);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_ELEC);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
x = player_ptr->x + ddx_ddd[dir];
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
- if (!is_monster(g_ptr->m_idx) || (!m_ptr->ml && !cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
+ if (!g_ptr->has_monster() || (!m_ptr->ml && !cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
continue;
}
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_QUAKE);
} else {
earthquake(player_ptr, player_ptr->y, player_ptr->x, 10, 0);
x = player_ptr->x + ddx[dir];
g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_3DAN);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
}
/* Monster is dead? */
- if (!is_monster(g_ptr->m_idx)) {
+ if (!g_ptr->has_monster()) {
break;
}
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_DRAIN);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
handle_stuff(player_ptr);
do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
}
y = player_ptr->y + ddy[dir];
x = player_ptr->x + ddx[dir];
- if (is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx)) {
+ if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
do_cmd_attack(player_ptr, y, x, HISSATSU_UNDEAD);
} else {
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
#include "grid/trap.h"
#include "monster-floor/monster-generator.h"
#include "monster-floor/place-monster-types.h"
-#include "monster/monster-util.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
#include "system/player-type-definition.h"
static bool is_cave_empty_grid(PlayerType *player_ptr, Grid *g_ptr)
{
bool is_empty_grid = g_ptr->cave_has_flag(TerrainCharacteristics::PLACE);
- is_empty_grid &= !is_monster(g_ptr->m_idx);
+ is_empty_grid &= !g_ptr->has_monster();
is_empty_grid &= !player_grid(player_ptr, g_ptr);
return is_empty_grid;
}
}
g_ptr = &floor_ptr->grid_array[y1][x1];
- if (!g_ptr->is_floor() || !g_ptr->o_idx_list.empty() || is_monster(g_ptr->m_idx)) {
+ if (!g_ptr->is_floor() || !g_ptr->o_idx_list.empty() || g_ptr->has_monster()) {
continue;
}
#include "io/cursor.h"
#include "io/screen-util.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "pet/pet-util.h"
#include "spell-kind/spells-teleport.h"
#include "system/angband-system.h"
reset_bits(g_ptr->info, CAVE_MARK);
}
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
update_monster(this->player_ptr, g_ptr->m_idx, false);
}
continue;
}
- if (!is_monster(g_ref.m_idx)) {
+ if (!g_ref.has_monster()) {
this->remove_mirror(y, x);
}
}
}
const auto &grid = floor.grid_array[project_m_y][project_m_x];
const auto &monster = floor.m_list[grid.m_idx];
- if (project_m_n == 1 && is_monster(grid.m_idx) && monster.ml) {
+ if (project_m_n == 1 && grid.has_monster() && monster.ml) {
if (!this->player_ptr->effects()->hallucination()->is_hallucinated()) {
monster_race_track(this->player_ptr, monster.ap_r_idx);
}
const auto *floor_ptr = player_ptr->current_floor_ptr;
const auto *g_ptr = &floor_ptr->grid_array[project_m_y][project_m_x];
const auto *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
- if (project_m_n == 1 && is_monster(g_ptr->m_idx) && m_ptr->ml) {
+ if (project_m_n == 1 && g_ptr->has_monster() && m_ptr->ml) {
if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
monster_race_track(player_ptr, m_ptr->ap_r_idx);
}
#include "monster/monster-info.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "monster/smart-learn-types.h"
#include "player/player-damage.h"
#include "player/player-move.h"
continue;
}
- if (is_monster(floor_ptr->grid_array[y][x].m_idx)) {
+ if (floor_ptr->grid_array[y][x].has_monster()) {
continue;
}
continue;
}
- if (!is_monster(grid.m_idx)) {
+ if (!grid.has_monster()) {
continue;
}
continue;
}
- if (is_monster(grid_neighbor.m_idx)) {
+ if (grid_neighbor.has_monster()) {
continue;
}
msg_format(_("%s^は岩石に埋もれてしまった!", "%s^ is embedded in the rock!"), m_name.data());
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
const auto &m_ref = floor_ptr->m_list[grid.m_idx];
if (record_named_pet && m_ref.is_named_pet()) {
const auto m2_name = monster_desc(player_ptr, m_ptr, MD_INDEF_VISIBLE);
#include "monster/monster-description-types.h"
#include "monster/monster-info.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "monster/smart-learn-types.h"
#include "object-enchant/special-object-flags.h"
#include "object/object-mark-types.h"
continue;
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
auto &monster = floor.m_list[grid.m_idx];
auto &monrace = monster.get_monrace();
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "player/special-defense-types.h"
#include "spell-kind/spells-launcher.h"
#include "system/angband-system.h"
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
g_ptr->info &= ~(CAVE_TEMP);
g_ptr->info |= (CAVE_GLOW);
- if (is_monster(g_ptr->m_idx)) {
+ if (g_ptr->has_monster()) {
PERCENTAGE chance = 25;
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
auto *r_ptr = &m_ptr->get_monrace();
note_spot(player_ptr, point.y, point.x);
}
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
update_monster(player_ptr, grid.m_idx, false);
}
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
-#include "monster/monster-util.h"
#include "mutation/mutation-flag-types.h"
#include "object-enchant/tr-types.h"
#include "player-base/player-class.h"
Grid *g_ptr;
g_ptr = &player_ptr->current_floor_ptr->grid_array[ty][tx];
- if (!is_monster(g_ptr->m_idx) || (g_ptr->m_idx == player_ptr->riding)) {
+ if (!g_ptr->has_monster() || (g_ptr->m_idx == player_ptr->riding)) {
msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
return false;
}
bool is_anywhere = w_ptr->wizard;
is_anywhere &= (mode & TELEPORT_PASSIVE) == 0;
- is_anywhere &= is_monster(player_ptr->current_floor_ptr->grid_array[y][x].m_idx) || player_ptr->current_floor_ptr->grid_array[y][x].m_idx == player_ptr->riding;
+ is_anywhere &= player_ptr->current_floor_ptr->grid_array[y][x].has_monster() || player_ptr->current_floor_ptr->grid_array[y][x].m_idx == player_ptr->riding;
if (is_anywhere) {
break;
}
#include "monster/monster-describer.h"
#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "player-info/class-info.h"
#include "player/player-damage.h"
#include "spell-kind/spells-floor.h"
const auto &terrrain = grid.get_terrain();
grid.info &= ~(CAVE_ROOM | CAVE_ICKY);
const auto &monster = floor.m_list[grid.m_idx];
- if (is_monster(grid.m_idx) && monster.is_asleep()) {
+ if (grid.has_monster() && monster.is_asleep()) {
(void)set_monster_csleep(player_ptr, grid.m_idx, 0);
if (monster.ml) {
const auto m_name = monster_desc(player_ptr, &monster, 0);
#include "floor/geometry.h"
#include "game-option/disturbance-options.h"
#include "grid/feature-flag-types.h"
-#include "monster/monster-util.h"
#include "spell-realm/spells-crusade.h"
#include "spell/range-calc.h"
#include "system/angband-system.h"
if (!cave_has_flag_bold(&floor, pos_to.y, pos_to.x, TerrainCharacteristics::PROJECT)) {
break;
}
- if ((dir != 5) && is_monster(floor.get_grid(pos_to).m_idx)) {
+ if ((dir != 5) && floor.get_grid(pos_to).has_monster()) {
break;
}
#include "main/sound-of-music.h"
#include "mind/mind-force-trainer.h"
#include "monster/monster-describer.h"
-#include "monster/monster-util.h"
#include "object/object-kind-hook.h"
#include "player-base/player-class.h"
#include "player-info/class-info.h"
return false;
}
- if (is_monster(floor_ptr->grid_array[y][x].m_idx)) {
+ if (floor_ptr->grid_array[y][x].has_monster()) {
const auto m_name = monster_desc(player_ptr, &floor_ptr->m_list[floor_ptr->grid_array[y][x].m_idx], 0);
msg_format(_("%sが邪魔だ!", "%s^ is standing in your way."), m_name.data());
PlayerEnergy(player_ptr).reset_player_turn();
#include "system/grid-type-definition.h"
+#include "monster/monster-util.h"
#include "system/angband-system.h"
#include "system/monster-race-info.h"
#include "system/terrain-type-definition.h"
return this->is_object() && TerrainList::get_instance()[this->mimic].flags.has(TerrainCharacteristics::RUNE_EXPLOSION);
}
+bool Grid::has_monster() const
+{
+ return is_monster(this->m_idx);
+}
+
byte Grid::get_cost(const MonsterRaceInfo *r_ptr) const
{
return this->costs[get_grid_flow_type(r_ptr)];
bool is_mirror() const;
bool is_rune_protection() const;
bool is_rune_explosion() const;
+ bool has_monster() const;
byte get_cost(const MonsterRaceInfo *r_ptr) const;
byte get_distance(const MonsterRaceInfo *r_ptr) const;
FEAT_IDX get_feat_mimic() const;
#include "effect/spells-effect-util.h"
#include "floor/cave.h"
#include "grid/feature-flag-types.h"
-#include "monster/monster-util.h"
#include "spell-class/spells-mirror-master.h"
#include "system/angband-system.h"
#include "system/floor-type-definition.h"
}
}
- if (any_bits(pp_ptr->flag, PROJECT_STOP) && !pp_ptr->position->empty() && (player_ptr->is_located_at(pos) || is_monster(grid.m_idx))) {
+ if (any_bits(pp_ptr->flag, PROJECT_STOP) && !pp_ptr->position->empty() && (player_ptr->is_located_at(pos) || grid.has_monster())) {
return true;
}
#include "monster/monster-describer.h"
#include "monster/monster-description-types.h"
#include "monster/monster-flag-types.h"
-#include "monster/monster-util.h"
#include "object/item-tester-hooker.h"
#include "object/object-mark-types.h"
#include "player-base/player-race.h"
static short describe_grid(PlayerType *player_ptr, GridExamination *ge_ptr)
{
- if (!is_monster(ge_ptr->g_ptr->m_idx) || !player_ptr->current_floor_ptr->m_list[ge_ptr->g_ptr->m_idx].ml) {
+ if (!ge_ptr->g_ptr->has_monster() || !player_ptr->current_floor_ptr->m_list[ge_ptr->g_ptr->m_idx].ml) {
return CONTINUOUS_DESCRIPTION;
}
#include "monster/monster-flag-types.h"
#include "monster/monster-info.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "object/object-mark-types.h"
#include "system/angband-system.h"
#include "system/floor-type-definition.h"
}
const auto &grid = floor.get_grid(pos);
- if (is_monster(grid.m_idx)) {
+ if (grid.has_monster()) {
auto &monster = floor.m_list[grid.m_idx];
if (monster.ml) {
return true;
#include "grid/grid.h"
#include "monster-race/monster-race.h"
#include "monster/monster-flag-types.h"
-#include "monster/monster-util.h"
#include "system/artifact-type-definition.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
/* Extract monster race */
MonsterRaceInfo *ap_r_ptr_a;
- if (is_monster(grid_a.m_idx) && monster_a.ml) {
+ if (grid_a.has_monster() && monster_a.ml) {
ap_r_ptr_a = &monster_a.get_appearance_monrace();
} else {
ap_r_ptr_a = nullptr;
}
MonsterRaceInfo *ap_r_ptr_b;
- if (is_monster(grid_b.m_idx) && monster_b.ml) {
+ if (grid_b.has_monster() && monster_b.ml) {
ap_r_ptr_b = &monster_b.get_appearance_monrace();
} else {
ap_r_ptr_b = nullptr;
#include "grid/feature.h"
#include "grid/grid.h"
#include "monster-race/monster-race.h"
-#include "monster/monster-util.h"
#include "object/object-info.h"
#include "object/object-mark-types.h"
#include "system/baseitem-info.h"
break;
}
- if (is_monster(grid.m_idx) && display_autopick != 0) {
+ if (grid.has_monster() && display_autopick != 0) {
set_term_color(player_ptr, y, x, ap, cp);
return;
}
#include "monster-race/monster-race.h"
#include "monster/monster-describer.h"
#include "monster/monster-description-types.h"
-#include "monster/monster-util.h"
#include "object/item-tester-hooker.h"
#include "object/object-info.h"
#include "player-base/player-class.h"
*/
static const MonsterEntity *monster_on_floor_items(FloorType *floor_ptr, const Grid *g_ptr)
{
- if (!is_monster(g_ptr->m_idx)) {
+ if (!g_ptr->has_monster()) {
return nullptr;
}
#include "monster-floor/monster-summon.h"
#include "monster/monster-describer.h"
#include "monster/monster-status.h"
-#include "monster/monster-util.h"
#include "mutation/mutation-processor.h"
#include "object/lite-processor.h"
#include "perception/simple-perception.h"
for (auto x = 0; x < floor_ptr->width; ++x) {
for (auto y = 0; y < floor_ptr->height; y++) {
auto *g_ptr = &floor_ptr->grid_array[y][x];
- if (is_monster(g_ptr->m_idx) && (g_ptr->m_idx != this->player_ptr->riding)) {
+ if (g_ptr->has_monster() && (g_ptr->m_idx != this->player_ptr->riding)) {
number_mon++;
win_m_idx = g_ptr->m_idx;
}