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"
10 #include "system/monster-race-definition.h"
11 #include "system/monster-type-definition.h"
12 #include "system/player-type-definition.h"
14 melee_spell_type *initialize_melee_spell_type(player_type *player_ptr, melee_spell_type *ms_ptr, MONSTER_IDX m_idx)
16 ms_ptr->m_idx = m_idx;
19 ms_ptr->target_idx = 0;
20 ms_ptr->thrown_spell = RF_ABILITY::MAX;
22 floor_type *floor_ptr = player_ptr->current_floor_ptr;
23 ms_ptr->m_ptr = &floor_ptr->m_list[m_idx];
24 ms_ptr->t_ptr = nullptr;
25 ms_ptr->r_ptr = &r_info[ms_ptr->m_ptr->r_idx];
26 ms_ptr->see_m = is_seen(player_ptr, ms_ptr->m_ptr);
27 ms_ptr->maneable = player_has_los_bold(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx);
28 ms_ptr->pet = is_pet(ms_ptr->m_ptr);
29 ms_ptr->in_no_magic_dungeon = d_info[player_ptr->dungeon_idx].flags.has(DF::NO_MAGIC) && floor_ptr->dun_level
30 && (!floor_ptr->inside_quest || is_fixed_quest_idx(floor_ptr->inside_quest));