OSDN Git Service

b0643ac95283cfb34c60d47dd362efdb7400908e
[hengbandforosx/hengbandosx.git] / src / system / monster-race-definition.h
1 #pragma once
2
3 #include "monster-attack/monster-attack-effect.h"
4 #include "monster-attack/monster-attack-table.h"
5 #include "monster-race/monster-aura-types.h"
6 #include "monster-race/race-ability-flags.h"
7 #include "monster-race/race-behavior-flags.h"
8 #include "monster-race/race-drop-flags.h"
9 #include "monster-race/race-flags-resistance.h"
10 #include "monster-race/race-kind-flags.h"
11 #include "monster-race/race-visual-flags.h"
12 #include "system/angband.h"
13 #include "util/flag-group.h"
14 #include <string>
15 #include <tuple>
16 #include <vector>
17
18 /*! モンスターが1ターンに攻撃する最大回数 (射撃を含む) / The maximum number of times a monster can attack in a turn (including SHOOT) */
19 constexpr int MAX_NUM_BLOWS = 4;
20
21 enum class MonsterRaceId : int16_t;
22
23 class MonsterBlow {
24 public:
25     RaceBlowMethodType method{};
26     RaceBlowEffectType effect{};
27     DICE_NUMBER d_dice{};
28     DICE_SID d_side{};
29 };
30
31 /*!
32  * @brief モンスター種族の定義構造体
33  * @details
34  * Monster "race" information, including racial memories
35  *
36  * Note that "d_attr" and "d_char" are used for MORE than "visual" stuff.
37  *
38  * Note that "x_attr" and "x_char" are used ONLY for "visual" stuff.
39  *
40  * Note that "cur_num" (and "max_num") represent the number of monsters
41  * of the given race currently on (and allowed on) the current level.
42  * This information yields the "dead" flag for Unique monsters.
43  *
44  * Note that "max_num" is reset when a new player is created.
45  * Note that "cur_num" is reset when a new level is created.
46  *
47  * Note that several of these fields, related to "recall", can be
48  * scrapped if space becomes an issue, resulting in less "complete"
49  * monster recall (no knowledge of spells, etc).  All of the "recall"
50  * fields have a special prefix to aid in searching for them.
51  */
52 struct monster_race {
53     MonsterRaceId idx{};
54     std::string name; //!< 名前データのオフセット(日本語) /  Name offset(Japanese)
55 #ifdef JP
56     std::string E_name; //!< 名前データのオフセット(英語) /  Name offset(English)
57 #endif
58     std::string text; //!< 思い出テキストのオフセット / Lore text offset
59     DICE_NUMBER hdice{}; //!< HPのダイス数 / Creatures hit dice count
60     DICE_SID hside{}; //!< HPのダイス面数 / Creatures hit dice sides
61     ARMOUR_CLASS ac{}; //!< アーマークラス / Armour Class
62     SLEEP_DEGREE sleep{}; //!< 睡眠値 / Inactive counter (base)
63     POSITION aaf{}; //!< 感知範囲(1-100スクエア) / Area affect radius (1-100)
64     byte speed{}; //!< 加速(110で+0) / Speed (normally 110)
65     EXP mexp{}; //!< 殺害時基本経験値 / Exp value for kill
66     BIT_FLAGS16 extra{}; //!< 未使用 /  Unused (for now)
67     RARITY freq_spell{}; //!< 魔法&特殊能力仕様頻度(1/n) /  Spell frequency
68     BIT_FLAGS flags1{}; //!< Flags 1 (general)
69     BIT_FLAGS flags2{}; //!< Flags 2 (abilities)
70     BIT_FLAGS flags3{}; //!< Flags 3 (race/resist)
71     BIT_FLAGS flags7{}; //!< Flags 7 (movement related abilities)
72     BIT_FLAGS flags8{}; //!< Flags 8 (wilderness info)
73     BIT_FLAGS flags9{}; //!< Flags 9 (drops info)
74     EnumClassFlagGroup<MonsterAbilityType> ability_flags; //!< 能力フラグ(魔法/ブレス) / Ability Flags
75     EnumClassFlagGroup<MonsterAuraType> aura_flags; //!< オーラフラグ / Aura Flags
76     EnumClassFlagGroup<MonsterBehaviorType> behavior_flags; //!< 能力フラグ(習性)
77     EnumClassFlagGroup<MonsterVisualType> visual_flags; //!< 能力フラグ(シンボル) / Symbol Flags
78     EnumClassFlagGroup<MonsterKindType> kind_flags; //!< 能力フラグ(種族・徳) / Attr Flags
79     EnumClassFlagGroup<MonsterResistanceType> resistance_flags; //!< 耐性フラグ / Flags R (resistances info)
80     EnumClassFlagGroup<MonsterDropType> drop_flags; //!< 能力フラグ(ドロップ) / Drop Flags
81     MonsterBlow blow[MAX_NUM_BLOWS]{}; //!< 打撃能力定義 / Up to four blows per round
82
83     //! 指定護衛リスト <モンスター種族ID,護衛数ダイス数,護衛数ダイス面>
84     std::vector<std::tuple<MonsterRaceId, DICE_NUMBER, DICE_SID>> reinforces;
85
86     //! 特定アーティファクトドロップリスト <アーティファクトID,ドロップ率>
87     std::vector<std::tuple<ARTIFACT_IDX, PERCENTAGE>> drop_artifacts;
88
89     PERCENTAGE arena_ratio{}; //!< モンスター闘技場の掛け金倍率修正値(%基準 / 0=100%) / The adjustment ratio for gambling monster
90     MonsterRaceId next_r_idx{}; //!< 進化先モンスター種族ID
91     EXP next_exp{}; //!< 進化に必要な経験値
92     DEPTH level{}; //!< レベル / Level of creature
93     RARITY rarity{}; //!< レアリティ / Rarity of creature
94     TERM_COLOR d_attr{}; //!< デフォルトの表示色 / Default monster attribute
95     char d_char{}; //!< デフォルトの表示文字 / Default monster character
96     TERM_COLOR x_attr{}; //!< 設定した表示色(またはタイル位置Y) / Desired monster attribute
97     char x_char{}; //!< 設定した表示文字(またはタイル位置X) / Desired monster character
98     MONSTER_NUMBER max_num{}; //!< 階に最大存在できる数 / Maximum population allowed per level
99     MONSTER_NUMBER cur_num{}; //!< 階に現在いる数 / Monster population on current level
100     FLOOR_IDX floor_id{}; //!< 存在している保存階ID /  Location of unique monster
101     MONSTER_NUMBER r_sights{}; //!< 見えている数 / Count sightings of this monster
102     MONSTER_NUMBER r_deaths{}; //!< このモンスターに殺された人数 / Count deaths from this monster
103     MONSTER_NUMBER r_pkills{}; //!< このゲームで倒すのを見た数 / Count visible monsters killed in this life
104     MONSTER_NUMBER r_akills{}; //!< このゲームで倒した数 / Count all monsters killed in this life
105     MONSTER_NUMBER r_tkills{}; //!< 全ゲームで倒した数 / Count monsters killed in all lives
106     byte r_wake{}; //!< @に気づいて起きた数 / Number of times woken up (?)
107     byte r_ignore{}; //!< @に気づいていない数 / Number of times ignored (?)
108     bool r_can_evolve{}; //!< 進化するか否か / Flag being able to evolve
109     byte r_xtra2{}; //!< 未使用 / Something (unused)
110     ITEM_NUMBER r_drop_gold{}; //!< これまでに撃破時に落とした財宝の数 / Max number of gold dropped at once
111     ITEM_NUMBER r_drop_item{}; //!< これまでに撃破時に落としたアイテムの数 / Max number of item dropped at once
112     byte r_cast_spell{}; //!< 使った魔法/ブレスの種類数 /  Max unique number of spells seen
113     byte r_blows[MAX_NUM_BLOWS]{}; //!< 受けた打撃 /  Number of times each blow type was seen
114     uint32_t r_flags1{}; //!< Observed racial flags
115     uint32_t r_flags2{}; //!< Observed racial flags
116     uint32_t r_flags3{}; //!< Observed racial flags
117     EnumClassFlagGroup<MonsterAbilityType> r_ability_flags; //!< 見た能力フラグ(魔法/ブレス) / Observed racial ability flags
118     EnumClassFlagGroup<MonsterAuraType> r_aura_flags; //!< 見た能力フラグ(オーラ) / Observed aura flags
119     EnumClassFlagGroup<MonsterBehaviorType> r_behavior_flags; //!< 見た能力フラグ(習性) / Observed racial attr flags
120     EnumClassFlagGroup<MonsterKindType> r_kind_flags; //!< 見た能力フラグ(種族・徳) / Observed racial attr flags
121     EnumClassFlagGroup<MonsterResistanceType> r_resistance_flags; //!< 見た耐性フラグ / Observed racial resistances flags
122     EnumClassFlagGroup<MonsterDropType> r_drop_flags; //!< 見た能力フラグ(ドロップ) / Observed drop flags
123     PLAYER_LEVEL defeat_level{}; //!< 倒したレベル(ユニーク用) / player level at which defeated this race
124     REAL_TIME defeat_time{}; //!< 倒した時間(ユニーク用) / time at which defeated this race
125     PERCENTAGE cur_hp_per{}; //!< 生成時現在HP率(%)
126 };