1 #include "melee/melee-spell-util.h"
2 #include "dungeon/dungeon-flag-types.h"
3 #include "dungeon/dungeon.h"
4 #include "dungeon/quest.h"
5 #include "floor/cave.h"
6 #include "floor/geometry.h"
7 #include "monster-race/monster-race.h"
8 #include "monster/monster-info.h"
9 #include "system/floor-type-definition.h"
11 melee_spell_type *initialize_melee_spell_type(player_type *target_ptr, melee_spell_type *ms_ptr, MONSTER_IDX m_idx)
13 ms_ptr->m_idx = m_idx;
16 ms_ptr->target_idx = 0;
17 ms_ptr->thrown_spell = 0;
20 floor_type *floor_ptr = target_ptr->current_floor_ptr;
21 ms_ptr->m_ptr = &floor_ptr->m_list[m_idx];
23 ms_ptr->r_ptr = &r_info[ms_ptr->m_ptr->r_idx];
24 ms_ptr->see_m = is_seen(target_ptr, ms_ptr->m_ptr);
25 ms_ptr->maneable = player_has_los_bold(target_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx);
26 ms_ptr->pet = is_pet(ms_ptr->m_ptr);
27 ms_ptr->in_no_magic_dungeon = (d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && floor_ptr->dun_level
28 && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest));