OSDN Git Service

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