OSDN Git Service

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