* @param spell 判定対象のID
* @return 特別効果魔法のIDならばTRUEを返す。
*/
-static bool spell_special(byte spell)
+static bool spell_special(player_type *target_ptr, byte spell)
{
- if (p_ptr->phase_out) return FALSE;
+ if (target_ptr->phase_out) return FALSE;
if (spell == 160 + 7) return TRUE;
return FALSE;
}
*\n
* This function may well be an efficiency bottleneck.\n
*/
-static int choose_attack_spell(MONSTER_IDX m_idx, byte spells[], byte num)
+static int choose_attack_spell(player_type *target_ptr, MONSTER_IDX m_idx, byte spells[], byte num)
{
monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (spell_world(spells[i])) world[world_num++] = spells[i];
/* Special spell? */
- if (spell_special(spells[i])) special[special_num++] = spells[i];
+ if (spell_special(target_ptr, spells[i])) special[special_num++] = spells[i];
/* Psycho-spear spell? */
if (spell_psy_spe(spells[i])) psy_spe[psy_spe_num++] = spells[i];
int attempt = 10;
while (attempt--)
{
- thrown_spell = choose_attack_spell(m_idx, spell, num);
+ thrown_spell = choose_attack_spell(target_ptr, m_idx, spell, num);
if (thrown_spell) break;
}
}