OSDN Git Service

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