OSDN Git Service

dd1efb7443acfe5d1087a9366a0b5fc8f9a1c330
[hengbandforosx/hengbandosx.git] / src / system / monster-type-definition.h
1 #pragma once
2
3 #include "monster/monster-flag-types.h"
4 #include "monster/monster-timed-effect-types.h"
5 #include "monster/smart-learn-types.h"
6 #include "object/object-index-list.h"
7 #include "util/flag-group.h"
8
9 /*!
10  * @brief Monster information, for a specific monster.
11  * @Note
12  * fy, fx constrain dungeon size to 256x256
13  * The "hold_o_idx" field points to the first object of a stack
14  * of objects (if any) being carried by the monster (see above).
15  */
16 constexpr int MONSTER_MAXHP = 30000; //!< モンスターの最大HP
17
18 struct floor_type;
19 struct monster_race;
20 struct monster_type {
21         MONRACE_IDX r_idx{};            /*!< モンスターの実種族ID (これが0の時は死亡扱いになる) / Monster race index 0 = dead. */
22         MONRACE_IDX ap_r_idx{}; /*!< モンスターの外見種族ID(あやしい影、たぬき、ジュラル星人誤認などにより変化する)Monster race appearance index */
23         floor_type *current_floor_ptr{}; /*!< 所在フロアID(現状はfloor_type構造体によるオブジェクトは1つしかないためソースコード設計上の意義以外はない)*/
24
25         /* Sub-alignment flags for neutral monsters */
26         #define SUB_ALIGN_NEUTRAL 0x0000 /*!< モンスターのサブアライメント:中立 */
27         #define SUB_ALIGN_EVIL    0x0001 /*!< モンスターのサブアライメント:善 */
28         #define SUB_ALIGN_GOOD    0x0002 /*!< モンスターのサブアライメント:悪 */
29         BIT_FLAGS8 sub_align{}; /*!< 中立属性のモンスターが召喚主のアライメントに従い一時的に立っている善悪陣営 / Sub-alignment for a neutral monster */
30
31         POSITION fy{};          /*!< 所在グリッドY座標 / Y location on map */
32         POSITION fx{};          /*!< 所在グリッドX座標 / X location on map */
33         HIT_POINT hp{};         /*!< 現在のHP / Current Hit points */
34         HIT_POINT maxhp{};              /*!< 現在の最大HP(衰弱効果などにより低下したものの反映) / Max Hit points */
35         HIT_POINT max_maxhp{};          /*!< 生成時の初期最大HP / Max Max Hit points */
36         HIT_POINT dealt_damage{};               /*!< これまでに蓄積して与えてきたダメージ / Sum of damages dealt by player */
37         TIME_EFFECT mtimed[MAX_MTIMED]{};       /*!< 与えられた時限効果の残りターン / Timed status counter */
38         byte mspeed{};          /*!< モンスターの個体加速値 / Monster "speed" */
39         ACTION_ENERGY energy_need{};    /*!< モンスター次ターンまでに必要な行動エネルギー / Monster "energy" */
40         POSITION cdis{};                /*!< 現在のプレイヤーから距離(逐一計算を避けるためのテンポラリ変数) Current dis from player */
41         EnumClassFlagGroup<MonsterTemporaryFlagType> mflag{};   /*!< モンスター個体に与えられた特殊フラグ1 (セーブ不要) / Extra monster flags */
42         EnumClassFlagGroup<MonsterConstantFlagType> mflag2{};   /*!< モンスター個体に与えられた特殊フラグ2 (セーブ必要) / Extra monster flags */
43         bool ml{};              /*!< モンスターがプレイヤーにとって視認できるか(処理のためのテンポラリ変数) Monster is "visible" */
44         ObjectIndexList hold_o_idx_list{};      /*!< モンスターが所持しているアイテムのリスト / Object list being held (if any) */
45         POSITION target_y{};            /*!< モンスターの攻撃目標対象Y座標 / Can attack !los player */
46         POSITION target_x{};            /*!< モンスターの攻撃目標対象X座標 /  Can attack !los player */
47         STR_OFFSET nickname{};  /*!< ペットに与えられた名前の保存先文字列オフセット Monster's Nickname */
48         EXP exp{}; /*!< モンスターの現在所持経験値 */
49
50         /* TODO: クローン、ペット、有効化は意義が異なるので別変数に切り離すこと。save/loadのバージョン更新が面倒そうだけど */
51         EnumClassFlagGroup<MonsterSmartLearnType> smart{}; /*!< モンスターのプレイヤーに対する学習状態 / Field for "smart_learn" - Some bit-flags for the "smart" field */
52         MONSTER_IDX parent_m_idx{}; /*!< 召喚主のモンスターID */
53 };