OSDN Git Service

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