OSDN Git Service

Merge branch 'master' of https://github.com/hengband/hengband
[hengbandforosx/hengbandosx.git] / src / monster / monster-processor-util.h
1 /*!
2  * @brief monster-processのための構造体群
3  * @date 2020/03/07
4  * @author Hourier
5  */
6
7 #pragma once
8
9 #include "monster-race/race-ability-flags.h"
10 #include "monster-race/race-behavior-flags.h"
11 #include "monster-race/race-drop-flags.h"
12 #include "monster-race/race-feature-flags.h"
13 #include "monster-race/race-flags-resistance.h"
14 #include "monster-race/race-kind-flags.h"
15 #include "system/angband.h"
16 #include "util/flag-group.h"
17
18 enum class MonsterRaceId : int16_t;
19
20 struct turn_flags {
21     bool see_m;
22     bool aware;
23     bool is_riding_mon;
24     bool do_turn;
25     bool do_move;
26     bool do_view;
27     bool do_take;
28     bool must_alter_to_move;
29
30     bool did_open_door;
31     bool did_bash_door;
32     bool did_take_item;
33     bool did_kill_item;
34     bool did_move_body;
35     bool did_pass_wall;
36     bool did_kill_wall;
37 };
38
39 struct old_race_flags {
40     BIT_FLAGS old_r_flags1;
41     BIT_FLAGS old_r_flags2;
42     BIT_FLAGS old_r_flags3;
43     BIT_FLAGS old_r_flagsr;
44     EnumClassFlagGroup<MonsterAbilityType> old_r_ability_flags;
45     EnumClassFlagGroup<MonsterBehaviorType> old_r_behavior_flags;
46     EnumClassFlagGroup<MonsterKindType> old_r_kind_flags;
47     EnumClassFlagGroup<MonsterResistanceType> old_r_resistance_flags;
48     EnumClassFlagGroup<MonsterDropType> old_r_drop_flags;
49     EnumClassFlagGroup<MonsterFeatureType> old_r_feature_flags;
50
51     byte old_r_blows0;
52     byte old_r_blows1;
53     byte old_r_blows2;
54     byte old_r_blows3;
55
56     byte old_r_cast_spell;
57 };
58
59 struct coordinate_candidate {
60     POSITION gy;
61     POSITION gx;
62     POSITION gdis;
63 };
64
65 class MonsterEntity;
66 turn_flags *init_turn_flags(MONSTER_IDX riding_idx, MONSTER_IDX m_idx, turn_flags *turn_flags_ptr);
67 old_race_flags *init_old_race_flags(old_race_flags *old_race_flags_ptr);
68 coordinate_candidate init_coordinate_candidate(void);
69
70 void store_enemy_approch_direction(int *mm, POSITION y, POSITION x);
71 void store_moves_val(int *mm, int y, int x);
72 void save_old_race_flags(MonsterRaceId monster_race_idx, old_race_flags *old_race_flags_ptr);