extern void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode);
/* mspells4.c */
-extern bool spell_learnable(MONSTER_IDX m_idx);
+extern bool spell_learnable(player_type *target_ptr, MONSTER_IDX m_idx);
extern HIT_POINT monspell_to_player(int SPELL_NUM, player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
extern HIT_POINT monspell_to_monster(player_type *target_ptr, int SPELL_NUM, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
extern HIT_POINT monspell_damage(int SPELL_NUM, MONSTER_IDX m_idx, int TYPE);
/* Target the player with a bolt attack */
if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
- bool learnable = spell_learnable(m_idx);
+ bool learnable = spell_learnable(target_ptr, m_idx);
(void)project(target_ptr, m_idx, 0, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
}
}
/* Target the player with a bolt attack */
- bool learnable = spell_learnable(m_idx);
+ bool learnable = spell_learnable(target_ptr, m_idx);
(void)project(target_ptr, m_idx, 0, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
}
}
/* Target the player with a ball attack */
- bool learnable = spell_learnable(m_idx);
+ bool learnable = spell_learnable(target_ptr, m_idx);
(void)project(target_ptr, m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
}
* @param m_idx モンスターID
* @return プレイヤーが青魔法で学習できるならTRUE、そうでなければFALSEを返す。
*/
-bool spell_learnable(MONSTER_IDX m_idx)
+bool spell_learnable(player_type *target_ptr, MONSTER_IDX m_idx)
{
- monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
/* Extract the "see-able-ness" */
- bool seen = (!p_ptr->blind && m_ptr->ml);
+ bool seen = (!target_ptr->blind && m_ptr->ml);
- bool maneable = player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx);
+ bool maneable = player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx);
return (seen && maneable && !current_world_ptr->timewalk_m_idx);
}