OSDN Git Service

8c9b744899524db132f650ba5bb795d9c0705a1c
[hengbandforosx/hengbandosx.git] / src / player-info / race-info.h
1 #pragma once
2
3 #include <optional>
4 #include <unordered_map>
5 #include <vector>
6
7 #include "object-enchant/tr-flags.h"
8 #include "object-enchant/tr-types.h"
9 #include "player-ability/player-ability-types.h"
10 #include "player-info/race-types.h"
11 #include "player/player-class-types.h"
12 #include "system/angband.h"
13
14 /*
15  * @brief Constant for kinds of mimic
16  * @todo 後ほど時間がある時にenum classへ変換する.
17  */
18 enum mimic_kind_type {
19     MIMIC_NONE = 0,
20     MIMIC_DEMON = 1,
21     MIMIC_DEMON_LORD = 2,
22     MIMIC_VAMPIRE = 3,
23 };
24
25 /*!
26  * @brief プレイヤー種族の生命形態
27  */
28 enum class PlayerRaceLife {
29     LIVING = 0, //!< 生きている
30     UNDEAD = 1, //!< 不死
31     DEMON = 2, //!< 悪魔
32     NONLIVING = 3, //!< 生きてない
33     MAX
34 };
35
36 /*!
37  * @brief プレイヤー種族の食料形態
38  */
39 enum class PlayerRaceFood {
40     RATION = 0, //!< 食料
41     WATER = 1, //!< 水
42     OIL = 2, //!< 油
43     BLOOD = 3, //!< 血
44     MANA = 4, //!< 魔力
45     CORPSE = 5, //!< 死体(捧げる)
46     MAX
47 };
48
49 /*!
50  * @brief プレイヤー種族の条件設定構造体
51  */
52 struct player_race_condition {
53     tr_type type{};
54     PLAYER_LEVEL level{};
55     std::optional<player_class_type> pclass{};
56     bool not_class{};
57
58     player_race_condition(tr_type t, PLAYER_LEVEL l = 1, const std::optional<player_class_type> &c = std::nullopt, bool nc = false)
59         : type(t)
60         , level(l)
61         , pclass(c)
62         , not_class(nc)
63     {
64     }
65 };
66
67 /*!
68  * @brief プレイヤー種族情報構造体 / Player racial info
69  */
70 struct player_race_info {
71     concptr title{}; //!< 種族名 / Title of race
72 #ifdef JP
73     concptr E_title{}; //!< 英語種族名
74 #endif
75     concptr symbol{}; //!< 種族シンボル(救援召喚) / Race symbols
76     int16_t r_adj[A_MAX]{}; //!< 能力値ボーナス / Racial stat bonuses
77
78     int16_t r_dis{}; //!< 解除 / disarming
79     int16_t r_dev{}; //!< 魔道具使用 /magic devices
80     int16_t r_sav{}; //!< 魔法防御 / saving throw
81     int16_t r_stl{}; //!< 隠密 / stealth
82     int16_t r_srh{}; //!< 探索 / search ability
83     int16_t r_fos{}; //!< 知覚 / search frequency
84     int16_t r_thn{}; //!< 打撃修正(命中) / combat (normal)
85     int16_t r_thb{}; //!< 射撃修正(命中) / combat (shooting)
86
87     byte r_mhp{}; //!< ヒットダイス /  Race hit-dice modifier
88     byte r_exp{}; //!< 経験値修正 /Race experience factor
89
90     byte b_age{}; //!< 年齢最小値 / base age
91     byte m_age{}; //!< 年齢加算範囲 / mod age
92
93     byte m_b_ht{}; //!< 身長最小値(男) / base height (males)
94     byte m_m_ht{}; //!< 身長加算範囲(男) / mod height (males)
95     byte m_b_wt{}; //!< 体重最小値(男) / base weight (males)
96     byte m_m_wt{}; //!< 体重加算範囲(男) / mod weight (males)
97
98     byte f_b_ht{}; //!< 身長最小値(女) / base height (females)
99     byte f_m_ht{}; //!< 身長加算範囲(女) / mod height (females)
100     byte f_b_wt{}; //!< 体重最小値(女) / base weight (females)
101     byte f_m_wt{}; //!< 体重加算範囲(女) / mod weight (females)
102
103     byte infra{}; //!< 赤外線視力 / Infra-vision range
104
105     uint32_t choice{}; //!< 似つかわしい職業(ミミック時はミミック種族属性) / Legal class choices
106     PlayerRaceLife life{}; //!< 生命の形態
107     PlayerRaceFood food{}; //!< 食料の形態
108
109     std::vector<player_race_condition> extra_flags;
110 };
111
112 extern const player_race_info *rp_ptr;
113
114 struct player_type;
115 SYMBOL_CODE get_summon_symbol_from_player(player_type *creature_ptr);
116 bool player_race_has_flag(player_type *creature_ptr, tr_type flag, bool base_race = false);
117 void add_player_race_flags(player_type *creature_ptr, TrFlags &flags, bool base_race = false);
118 PlayerRaceLife player_race_life(player_type *creature_ptr, bool base_race = false);
119 PlayerRaceFood player_race_food(player_type *creature_ptr, bool base_race = false);