OSDN Git Service

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