OSDN Git Service

Merge pull request #2356 from habu1010/feature/monster-race-enum-class
[hengbandforosx/hengbandosx.git] / src / dungeon / dungeon.h
1 #pragma once
2
3 #include <string>
4 #include <vector>
5
6 #include "dungeon/dungeon-flag-types.h"
7 #include "monster-race/race-ability-flags.h"
8 #include "monster-race/race-behavior-flags.h"
9 #include "monster-race/race-flags-resistance.h"
10 #include "monster-race/race-kind-flags.h"
11 #include "monster-race/race-resistance-mask.h"
12 #include "monster-race/race-visual-flags.h"
13 #include "system/angband.h"
14 #include "util/flag-group.h"
15
16 #define DUNGEON_FEAT_PROB_NUM 3
17
18 #define DUNGEON_ANGBAND 1
19 #define DUNGEON_GALGALS 2
20 #define DUNGEON_ORC 3
21 #define DUNGEON_MAZE 4
22 #define DUNGEON_DRAGON 5
23 #define DUNGEON_GRAVE 6
24 #define DUNGEON_WOOD 7
25 #define DUNGEON_VOLCANO 8
26 #define DUNGEON_HELL 9
27 #define DUNGEON_HEAVEN 10
28 #define DUNGEON_OCEAN 11
29 #define DUNGEON_CASTLE 12
30 #define DUNGEON_CTH 13
31 #define DUNGEON_MOUNTAIN 14
32 #define DUNGEON_GOLD 15
33 #define DUNGEON_NO_MAGIC 16
34 #define DUNGEON_NO_MELEE 17
35 #define DUNGEON_CHAMELEON 18
36 #define DUNGEON_DARKNESS 19
37 #define DUNGEON_MAX 19
38
39 enum class MonsterRaceId : int16_t;
40
41 struct feat_prob {
42     FEAT_IDX feat{}; /* Feature tile */
43     PERCENTAGE percent{}; /* Chance of type */
44 };
45
46 /* A structure for the != dungeon types */
47 struct dungeon_type {
48     DUNGEON_IDX idx{};
49
50     std::string name; /* Name */
51     std::string text; /* Description */
52
53     POSITION dy{};
54     POSITION dx{};
55
56     feat_prob floor[DUNGEON_FEAT_PROB_NUM]{}; /* Floor probability */
57     feat_prob fill[DUNGEON_FEAT_PROB_NUM]{}; /* Cave wall probability */
58     FEAT_IDX outer_wall{}; /* Outer wall tile */
59     FEAT_IDX inner_wall{}; /* Inner wall tile */
60     FEAT_IDX stream1{}; /* stream tile */
61     FEAT_IDX stream2{}; /* stream tile */
62
63     DEPTH mindepth{}; /* Minimal depth */
64     DEPTH maxdepth{}; /* Maximal depth */
65     PLAYER_LEVEL min_plev{}; /* Minimal plev needed to enter -- it's an anti-cheating mesure */
66     BIT_FLAGS16 pit{};
67     BIT_FLAGS16 nest{};
68     BIT_FLAGS8 mode{}; /* Mode of combinaison of the monster flags */
69
70     int min_m_alloc_level{}; /* Minimal number of monsters per level */
71     int max_m_alloc_chance{}; /* There is a 1/max_m_alloc_chance chance per round of creating a new monster */
72
73     EnumClassFlagGroup<DungeonFeatureType> flags{}; /* Dungeon Flags */
74
75     BIT_FLAGS mflags1{}; /* The monster flags that are allowed */
76     BIT_FLAGS mflags2{};
77     BIT_FLAGS mflags3{};
78     BIT_FLAGS mflags7{};
79     BIT_FLAGS mflags8{};
80     BIT_FLAGS mflags9{};
81
82     EnumClassFlagGroup<MonsterAbilityType> mon_ability_flags;
83     EnumClassFlagGroup<MonsterBehaviorType> mon_behavior_flags;
84     EnumClassFlagGroup<MonsterVisualType> mon_visual_flags;
85     EnumClassFlagGroup<MonsterKindType> mon_kind_flags;
86     EnumClassFlagGroup<MonsterResistanceType> mon_resistance_flags;
87
88     char r_char[5]{}; /* Monster race allowed */
89     KIND_OBJECT_IDX final_object{}; /* The object you'll find at the bottom */
90     ARTIFACT_IDX final_artifact{}; /* The artifact you'll find at the bottom */
91     MonsterRaceId final_guardian{}; /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
92
93     PROB special_div{}; /* % of monsters affected by the flags/races allowed, to add some variety */
94     int tunnel_percent{};
95     int obj_great{};
96     int obj_good{};
97 };
98
99 extern std::vector<DEPTH> max_dlv;
100 extern std::vector<dungeon_type> d_info;
101
102 class PlayerType;
103 DUNGEON_IDX choose_dungeon(concptr note, POSITION y, POSITION x);
104 bool is_in_dungeon(PlayerType *player_ptr);