*/
monster_race *real_r_ptr(monster_type *m_ptr)
{
+ return &r_info[real_r_idx(m_ptr)];
+}
+
+MONRACE_IDX real_r_idx(monster_type *m_ptr)
+{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Extract real race */
if (m_ptr->mflag2 & MFLAG2_CHAMELEON)
{
if (r_ptr->flags1 & RF1_UNIQUE)
- return &r_info[MON_CHAMELEON_K];
+ return MON_CHAMELEON_K;
else
- return &r_info[MON_CHAMELEON];
+ return MON_CHAMELEON;
}
else
{
- return r_ptr;
+ return m_ptr->r_idx;
}
}
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
case SUMMON_HI_DRAGON_LIVING:
{
- okay = ((r_ptr->d_char == 'D') && monster_living(r_ptr));
+ okay = ((r_ptr->d_char == 'D') && monster_living(r_idx));
break;
}
case SUMMON_LIVING:
{
- okay = monster_living(r_ptr);
+ okay = monster_living(r_idx);
break;
}
for (i = 0; i < 4; i++)
if (r_ptr->blow[i].method == RBM_EXPLODE) okay = TRUE;
- okay = (okay && monster_living(r_ptr));
+ okay = (okay && monster_living(r_idx));
break;
}
* "disturb_near" (monster which is "easily" viewable moves in some
* way). Note that "moves" includes "appears" and "disappears".
*/
-void update_mon(MONSTER_IDX m_idx, bool full)
+void update_monster(MONSTER_IDX m_idx, bool full)
{
monster_type *m_ptr = &m_list[m_idx];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
-
- /* Update the monster */
- update_mon(i, full);
+ update_monster(i, full);
}
}
m_ptr->r_idx = r_idx;
m_ptr->ap_r_idx = r_idx;
- update_mon(m_idx, FALSE);
+ update_monster(m_idx, FALSE);
lite_spot(m_ptr->fy, m_ptr->fx);
if ((r_info[old_r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) ||
p_ptr->update |= (PU_MON_LITE);
else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !MON_CSLEEP(m_ptr))
p_ptr->update |= (PU_MON_LITE);
-
- /* Update the monster */
- update_mon(c_ptr->m_idx, TRUE);
+ update_monster(c_ptr->m_idx, TRUE);
/* Count the monsters on the level */
* @param mode 生成オプション
* @return 成功したらtrue
*/
-static bool place_monster_group(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
+static bool place_monster_group(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
monster_race *r_ptr = &r_info[r_idx];
* @brief 護衛対象となるモンスター種族IDを渡すグローバル変数 / Hack -- help pick an escort type
* @todo 関数ポインタの都合を配慮しながら、グローバル変数place_monster_idxを除去し、関数引数化する
*/
-static IDX place_monster_idx = 0;
+static MONSTER_IDX place_monster_idx = 0;
/*!
* @var place_monster_m_idx
* @brief 護衛対象となるモンスターIDを渡すグローバル変数 / Hack -- help pick an escort type
* @todo 関数ポインタの都合を配慮しながら、グローバル変数place_monster_m_idxを除去し、関数引数化する
*/
-static IDX place_monster_m_idx = 0;
+static MONSTER_IDX place_monster_m_idx = 0;
/*!
* @brief モンスター種族が召喚主の護衛となれるかどうかをチェックする / Hack -- help pick an escort type
/* Drop objects being carried */
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
-
- /* Get local object */
q_ptr = &forge;
/* Copy the object */