OSDN Git Service

[cleanup] GCCの警告に対応
[hengband/hengband.git] / src / melee / melee-spell-util.c
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
11 melee_spell_type *initialize_melee_spell_type(player_type *target_ptr, melee_spell_type *ms_ptr, MONSTER_IDX m_idx)
12 {
13     ms_ptr->m_idx = m_idx;
14     ms_ptr->y = 0;
15     ms_ptr->x = 0;
16     ms_ptr->target_idx = 0;
17     ms_ptr->thrown_spell = 0;
18     ms_ptr->dam = 0;
19     ms_ptr->num = 0;
20     floor_type *floor_ptr = target_ptr->current_floor_ptr;
21     ms_ptr->m_ptr = &floor_ptr->m_list[m_idx];
22     ms_ptr->t_ptr = NULL;
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));
29     return ms_ptr;
30 }