OSDN Git Service

8ef8c0ed060bff7b871ae2b41278ffea9b3aca21
[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 "monster-race/race-special-flags.h"
16 #include "system/angband.h"
17 #include "util/flag-group.h"
18
19 enum class MonsterRaceId : int16_t;
20
21 struct turn_flags {
22     bool see_m;
23     bool aware;
24     bool is_riding_mon;
25     bool do_turn;
26     bool do_move;
27     bool do_view;
28     bool do_take;
29     bool must_alter_to_move;
30
31     bool did_open_door;
32     bool did_bash_door;
33     bool did_take_item;
34     bool did_kill_item;
35     bool did_move_body;
36     bool did_pass_wall;
37     bool did_kill_wall;
38 };
39
40 // @details ダミーIDが渡されるとオブジェクトが生焼けになるので、ヘッダ側で全て初期化しておく.
41 struct old_race_flags {
42     old_race_flags(MonsterRaceId monrace_id);
43
44     BIT_FLAGS old_r_flags1 = 0;
45     BIT_FLAGS old_r_flags2 = 0;
46     BIT_FLAGS old_r_flags3 = 0;
47     BIT_FLAGS old_r_flagsr = 0;
48     EnumClassFlagGroup<MonsterAbilityType> old_r_ability_flags{};
49     EnumClassFlagGroup<MonsterBehaviorType> old_r_behavior_flags{};
50     EnumClassFlagGroup<MonsterKindType> old_r_kind_flags{};
51     EnumClassFlagGroup<MonsterResistanceType> old_r_resistance_flags{};
52     EnumClassFlagGroup<MonsterDropType> old_r_drop_flags{};
53     EnumClassFlagGroup<MonsterFeatureType> old_r_feature_flags{};
54     EnumClassFlagGroup<MonsterSpecialType> old_r_special_flags{};
55
56     byte old_r_blows0 = 0;
57     byte old_r_blows1 = 0;
58     byte old_r_blows2 = 0;
59     byte old_r_blows3 = 0;
60
61     byte old_r_cast_spell = 0;
62 };
63
64 struct coordinate_candidate {
65     POSITION gy;
66     POSITION gx;
67     POSITION gdis;
68 };
69
70 class MonsterEntity;
71 turn_flags *init_turn_flags(MONSTER_IDX riding_idx, MONSTER_IDX m_idx, turn_flags *turn_flags_ptr);
72 coordinate_candidate init_coordinate_candidate(void);
73
74 void store_enemy_approch_direction(int *mm, POSITION y, POSITION x);
75 void store_moves_val(int *mm, int y, int x);