MonsterRaceId pet_r_idx = pc.equals(PlayerClassType::CAVALRY) ? MonsterRaceId::HORSE : MonsterRaceId::YASE_HORSE;
auto *r_ptr = &monraces_info[pet_r_idx];
- place_monster_aux(player_ptr, 0, player_ptr->y, player_ptr->x - 1, pet_r_idx, (PM_FORCE_PET | PM_NO_KAGE));
+ place_specific_monster(player_ptr, 0, player_ptr->y, player_ptr->x - 1, pet_r_idx, (PM_FORCE_PET | PM_NO_KAGE));
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[hack_m_idx_ii];
m_ptr->mspeed = r_ptr->speed;
m_ptr->maxhp = r_ptr->hdice * (r_ptr->hside + 1) / 2;
POSITION y, x;
y = player_ptr->y + ddy[player_ptr->fishing_dir];
x = player_ptr->x + ddx[player_ptr->fishing_dir];
- if (place_monster_aux(player_ptr, 0, y, x, r_idx, PM_NO_KAGE)) {
+ if (place_specific_monster(player_ptr, 0, y, x, r_idx, PM_NO_KAGE)) {
const auto m_name = monster_desc(player_ptr, &floor_ptr->m_list[floor_ptr->grid_array[y][x].m_idx], 0);
msg_print(_(format("%sが釣れた!", m_name.data()), "You have a good catch!"));
success = true;
return false;
}
- if (place_monster_aux(player_ptr, 0, y, x, quest.r_idx, mode)) {
+ if (place_specific_monster(player_ptr, 0, y, x, quest.r_idx, mode)) {
break;
} else {
continue;
if (random & RANDOM_MONSTER) {
floor_ptr->monster_level = floor_ptr->base_level + monster_index;
- place_monster(player_ptr, *qtwg_ptr->y, *qtwg_ptr->x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_NO_QUEST));
+ place_random_monster(player_ptr, *qtwg_ptr->y, *qtwg_ptr->x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_NO_QUEST));
floor_ptr->monster_level = floor_ptr->base_level;
} else if (monster_index) {
}
}
- place_monster_aux(player_ptr, 0, *qtwg_ptr->y, *qtwg_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_NO_KAGE));
+ place_specific_monster(player_ptr, 0, *qtwg_ptr->y, *qtwg_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_NO_KAGE));
if (clone) {
floor_ptr->m_list[hack_m_idx_ii].mflag2.set(MonsterConstantFlagType::CLONED);
r_ref.cur_num = old_cur_num;
build_arena(player_ptr, &y, &x);
player_place(player_ptr, y, x);
- if (place_monster_aux(player_ptr, 0, player_ptr->y + 5, player_ptr->x, arena_info[player_ptr->arena_number].r_idx, PM_NO_KAGE | PM_NO_PET)) {
+ if (place_specific_monster(player_ptr, 0, player_ptr->y + 5, player_ptr->x, arena_info[player_ptr->arena_number].r_idx, PM_NO_KAGE | PM_NO_PET)) {
return;
}
build_battle(player_ptr, &y, &x);
player_place(player_ptr, y, x);
for (MONSTER_IDX i = 0; i < 4; i++) {
- place_monster_aux(player_ptr, 0, player_ptr->y + 8 + (i / 2) * 4, player_ptr->x - 2 + (i % 2) * 4, battle_mon_list[i], (PM_NO_KAGE | PM_NO_PET));
+ place_specific_monster(player_ptr, 0, player_ptr->y + 8 + (i / 2) * 4, player_ptr->x - 2 + (i % 2) * 4, battle_mon_list[i], (PM_NO_KAGE | PM_NO_PET));
set_friendly(&floor_ptr->m_list[floor_ptr->grid_array[player_ptr->y + 8 + (i / 2) * 4][player_ptr->x - 2 + (i % 2) * 4].m_idx]);
}
mode |= PM_NO_PET;
}
- if (!place_monster_aux(player_ptr, m_idx, y, x, m_ptr->r_idx, (mode | PM_NO_KAGE | PM_MULTIPLY))) {
+ if (!place_specific_monster(player_ptr, m_idx, y, x, m_ptr->r_idx, (mode | PM_NO_KAGE | PM_MULTIPLY))) {
return false;
}
}
/*!
- * @brief 一般的なモンスター生成処理のサブルーチン / Attempt to place a monster of the given race at the given location
+ * @brief 特定モンスターを生成する
* @param player_ptr プレイヤーへの参照ポインタ
* @param who 召喚主のモンスター情報ID
* @param y 生成地点y座標
* @param r_idx 生成するモンスターの種族ID
* @param mode 生成オプション
* @return 生成に成功したらtrue
+ * @details 護衛も一緒に生成する
*/
-bool place_monster_aux(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
+bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
{
auto *r_ptr = &monraces_info[r_idx];
}
/*!
- * @brief 一般的なモンスター生成処理のメインルーチン / Attempt to place a monster of the given race at the given location
+ * @brief フロア相当のモンスターを1体生成する
* @param player_ptr プレイヤーへの参照ポインタ
* @param y 生成地点y座標
* @param x 生成地点x座標
* @param mode 生成オプション
* @return 生成に成功したらtrue
*/
-bool place_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
+bool place_random_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
{
get_mon_num_prep(player_ptr, get_monster_hook(player_ptr), get_monster_hook2(player_ptr, y, x));
MonsterRaceId r_idx;
mode |= PM_JURAL;
}
- return place_monster_aux(player_ptr, 0, y, x, r_idx, mode);
+ return place_specific_monster(player_ptr, 0, y, x, r_idx, mode);
}
static std::optional<MonsterRaceId> select_horde_leader_r_idx(PlayerType *player_ptr)
return false;
}
- if (place_monster_aux(player_ptr, 0, y, x, r_idx.value(), 0L)) {
+ if (place_specific_monster(player_ptr, 0, y, x, r_idx.value(), 0L)) {
break;
}
}
continue;
}
- if (place_monster_aux(player_ptr, 0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) {
+ if (place_specific_monster(player_ptr, 0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) {
return true;
}
return true;
}
} else {
- if (place_monster(player_ptr, y, x, (mode | PM_ALLOW_GROUP))) {
+ if (place_random_monster(player_ptr, y, x, (mode | PM_ALLOW_GROUP))) {
return true;
}
}
bool mon_scatter(PlayerType *player_ptr, MonsterRaceId r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist);
bool multiply_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
-bool place_monster_aux(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode);
-bool place_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
+bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode);
+bool place_random_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
bool alloc_horde(PlayerType *player_ptr, POSITION y, POSITION x, summon_specific_pf summon_specific);
bool alloc_guardian(PlayerType *player_ptr, bool def_val);
bool alloc_monster(PlayerType *player_ptr, POSITION dis, BIT_FLAGS mode, summon_specific_pf summon_specific);
mode |= PM_NO_KAGE;
}
- if (!place_monster_aux(player_ptr, who, y, x, r_idx, mode)) {
+ if (!place_specific_monster(player_ptr, who, y, x, r_idx, mode)) {
summon_specific_type = SUMMON_NONE;
return false;
}
return false;
}
- return place_monster_aux(player_ptr, who, y, x, r_idx, (mode | PM_NO_KAGE));
+ return place_specific_monster(player_ptr, who, y, x, r_idx, (mode | PM_NO_KAGE));
}
r_idx = nest_mon_info[i].r_idx;
/* Place that "random" monster (no groups) */
- (void)place_monster_aux(player_ptr, 0, y, x, r_idx, 0L);
+ (void)place_specific_monster(player_ptr, 0, y, x, r_idx, 0L);
nest_mon_info[i].used = true;
}
/* Top and bottom rows */
for (x = xval - 9; x <= xval + 9; x++) {
- place_monster_aux(player_ptr, 0, yval - 2, x, what[0], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, yval + 2, x, what[0], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, yval - 2, x, what[0], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, yval + 2, x, what[0], PM_NO_KAGE);
}
/* Middle columns */
for (y = yval - 1; y <= yval + 1; y++) {
- place_monster_aux(player_ptr, 0, y, xval - 9, what[0], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 9, what[0], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 9, what[0], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 9, what[0], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval - 8, what[1], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 8, what[1], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 8, what[1], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 8, what[1], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval - 7, what[1], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 7, what[1], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 7, what[1], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 7, what[1], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval - 6, what[2], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 6, what[2], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 6, what[2], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 6, what[2], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval - 5, what[2], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 5, what[2], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 5, what[2], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 5, what[2], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval - 4, what[3], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 4, what[3], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 4, what[3], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 4, what[3], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval - 3, what[3], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 3, what[3], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 3, what[3], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 3, what[3], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval - 2, what[4], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, y, xval + 2, what[4], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval - 2, what[4], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, xval + 2, what[4], PM_NO_KAGE);
}
/* Above/Below the center monster */
for (x = xval - 1; x <= xval + 1; x++) {
- place_monster_aux(player_ptr, 0, yval + 1, x, what[5], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, yval - 1, x, what[5], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, yval + 1, x, what[5], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, yval - 1, x, what[5], PM_NO_KAGE);
}
/* Next to the center monster */
- place_monster_aux(player_ptr, 0, yval, xval + 1, what[6], PM_NO_KAGE);
- place_monster_aux(player_ptr, 0, yval, xval - 1, what[6], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, yval, xval + 1, what[6], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, yval, xval - 1, what[6], PM_NO_KAGE);
/* Center monster */
- place_monster_aux(player_ptr, 0, yval, xval, what[7], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, yval, xval, what[7], PM_NO_KAGE);
return true;
}
for (i = 0; place_table_trapped_pit[i][2] >= 0; i++) {
y = yval + place_table_trapped_pit[i][0];
x = xval + place_table_trapped_pit[i][1];
- place_monster_aux(player_ptr, 0, y, x, what[place_table_trapped_pit[i][2]], PM_NO_KAGE);
+ place_specific_monster(player_ptr, 0, y, x, what[place_table_trapped_pit[i][2]], PM_NO_KAGE);
}
return true;
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
if (MonsterRace(r_idx).is_valid()) {
- place_monster_aux(player_ptr, 0, y, x, r_idx, PM_ALLOW_SLEEP);
+ place_specific_monster(player_ptr, 0, y, x, r_idx, PM_ALLOW_SLEEP);
}
/* Walls around the breather */
r_idx = get_mon_num(player_ptr, 0, floor_ptr->dun_level, 0);
if (MonsterRace(r_idx).is_valid()) {
- place_monster_aux(player_ptr, 0, yval, xval, r_idx, 0L);
+ place_specific_monster(player_ptr, 0, yval, xval, r_idx, 0L);
}
/* Walls around the breather */
y = yval + ddy_ddd[dir1];
x = xval + ddx_ddd[dir1];
if (MonsterRace(r_idx).is_valid()) {
- place_monster_aux(player_ptr, 0, y, x, r_idx, 0L);
+ place_specific_monster(player_ptr, 0, y, x, r_idx, 0L);
}
}
switch (*t) {
case '&': {
floor_ptr->monster_level = floor_ptr->base_level + 5;
- place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+ place_random_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
floor_ptr->monster_level = floor_ptr->base_level;
break;
}
/* Meaner monster */
case '@': {
floor_ptr->monster_level = floor_ptr->base_level + 11;
- place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+ place_random_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
floor_ptr->monster_level = floor_ptr->base_level;
break;
}
/* Meaner monster, plus treasure */
case '9': {
floor_ptr->monster_level = floor_ptr->base_level + 9;
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP);
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 7;
place_object(player_ptr, y, x, AM_GOOD);
/* Nasty monster and treasure */
case '8': {
floor_ptr->monster_level = floor_ptr->base_level + 40;
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP);
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 20;
place_object(player_ptr, y, x, AM_GOOD | AM_GREAT);
case ',': {
if (randint0(100) < 50) {
floor_ptr->monster_level = floor_ptr->base_level + 3;
- place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+ place_random_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
floor_ptr->monster_level = floor_ptr->base_level;
}
if (randint0(100) < 50) {
if (value < 0) {
floor_ptr->monster_level = floor_ptr->base_level + 40;
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 20;
place_object(player_ptr, y, x, AM_GOOD);
floor_ptr->object_level = floor_ptr->base_level;
} else if (value < 5) {
floor_ptr->monster_level = floor_ptr->base_level + 20;
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 10;
place_object(player_ptr, y, x, AM_GOOD);
floor_ptr->object_level = floor_ptr->base_level;
} else if (value < 10) {
floor_ptr->monster_level = floor_ptr->base_level + 9;
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
floor_ptr->monster_level = floor_ptr->base_level;
} else if (value < 17) {
} else if (value < 23) {
}
} else if (value < 30) {
floor_ptr->monster_level = floor_ptr->base_level + 5;
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
floor_ptr->monster_level = floor_ptr->base_level;
place_trap(player_ptr, y, x);
} else if (value < 40) {
if (randint0(100) < 50) {
floor_ptr->monster_level = floor_ptr->base_level + 3;
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
floor_ptr->monster_level = floor_ptr->base_level;
}
place_trap(player_ptr, y, x);
} else {
if (randint0(100) < 20) {
- place_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
+ place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
} else if (randint0(100) < 50) {
place_trap(player_ptr, y, x);
} else if (randint0(100) < 50) {
}
floor_ptr->monster_level = floor_ptr->base_level + 2;
- (void)place_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
+ (void)place_random_monster(player_ptr, y, x, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
floor_ptr->monster_level = floor_ptr->base_level;
}
}
return false;
}
- if (!place_monster_aux(player_ptr, 0, player_ptr->y + ddy[dir], player_ptr->x + ddx[dir], r_idx, PM_FORCE_PET | PM_NO_KAGE)) {
+ if (!place_specific_monster(player_ptr, 0, player_ptr->y + ddy[dir], player_ptr->x + ddx[dir], r_idx, PM_FORCE_PET | PM_NO_KAGE)) {
return false;
}
m_ptr->hold_o_idx_list.clear();
delete_monster_idx(player_ptr, g_ptr->m_idx);
bool polymorphed = false;
- if (place_monster_aux(player_ptr, 0, y, x, new_r_idx, mode)) {
+ if (place_specific_monster(player_ptr, 0, y, x, new_r_idx, mode)) {
floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
floor_ptr->m_list[hack_m_idx_ii].hold_o_idx_list = back_m.hold_o_idx_list;
polymorphed = true;
} else {
- if (place_monster_aux(player_ptr, 0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN))) {
+ if (place_specific_monster(player_ptr, 0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN))) {
floor_ptr->m_list[hack_m_idx_ii] = back_m;
mproc_init(floor_ptr);
} else {