OSDN Git Service

Merge pull request #3845 from dis-/feature/refactor-save-floors
[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 // @details ダミーIDが渡されるとオブジェクトが生焼けになるので、ヘッダ側で全て初期化しておく.
40 struct old_race_flags {
41     old_race_flags(MonsterRaceId monrace_id);
42
43     BIT_FLAGS old_r_flags1 = 0;
44     BIT_FLAGS old_r_flags2 = 0;
45     BIT_FLAGS old_r_flags3 = 0;
46     BIT_FLAGS old_r_flagsr = 0;
47     EnumClassFlagGroup<MonsterAbilityType> old_r_ability_flags{};
48     EnumClassFlagGroup<MonsterBehaviorType> old_r_behavior_flags{};
49     EnumClassFlagGroup<MonsterKindType> old_r_kind_flags{};
50     EnumClassFlagGroup<MonsterResistanceType> old_r_resistance_flags{};
51     EnumClassFlagGroup<MonsterDropType> old_r_drop_flags{};
52     EnumClassFlagGroup<MonsterFeatureType> old_r_feature_flags{};
53
54     byte old_r_blows0 = 0;
55     byte old_r_blows1 = 0;
56     byte old_r_blows2 = 0;
57     byte old_r_blows3 = 0;
58
59     byte old_r_cast_spell = 0;
60 };
61
62 struct coordinate_candidate {
63     POSITION gy;
64     POSITION gx;
65     POSITION gdis;
66 };
67
68 class MonsterEntity;
69 turn_flags *init_turn_flags(MONSTER_IDX riding_idx, MONSTER_IDX m_idx, turn_flags *turn_flags_ptr);
70 coordinate_candidate init_coordinate_candidate(void);
71
72 void store_enemy_approch_direction(int *mm, POSITION y, POSITION x);
73 void store_moves_val(int *mm, int y, int x);