-/*!
+#pragma once
+
+/*!
* @file types.h
* @brief グローバルな構造体の定義 / global type declarations
* @date 2014/08/10
* </pre>
*/
+#include "h-type.h"
+#include "defines.h"
+#include "object.h"
-/*!
- * @struct feature_state
- * @brief 地形状態変化指定構造体 / Feature state structure
- */
-typedef struct feature_state feature_state;
-
-struct feature_state
-{
- FF_FLAGS_IDX action; /*!< 変化条件をFF_*のIDで指定 / Action (FF_*) */
- STR_OFFSET result_tag; /*!< 変化先ID / Result (f_info ID) */
- FEAT_IDX result; /*!< 変化先ID / Result (f_info ID) */
-};
-
-
-/*!
- * @struct feature_type
- * @brief 地形情報の構造体 / Information about terrain "features"
- */
-
-typedef struct feature_type feature_type;
-
-struct feature_type
-{
- STR_OFFSET name; /*!< 地形名参照のためのネームバッファオフセット値 / Name (offset) */
- STR_OFFSET text; /*!< 地形説明参照のためのネームバッファオフセット値 / Text (offset) */
- STR_OFFSET tag; /*!< 地形特性タグ参照のためのネームバッファオフセット値 / Tag (offset) */
-
- STR_OFFSET mimic_tag;
- STR_OFFSET destroyed_tag;
-
- FEAT_IDX mimic; /*!< 未確定時の外形地形ID / Feature to mimic */
- FEAT_IDX destroyed; /*!< *破壊*に巻き込まれた時の地形移行先(未実装?) / Default destroyed state */
-
- BIT_FLAGS flags[FF_FLAG_SIZE]; /*!< 地形の基本特性ビット配列 / Flags */
-
- FEAT_PRIORITY priority; /*!< 縮小表示で省略する際の表示優先度 / Map priority */
-
- feature_state state[MAX_FEAT_STATES]; /*!< feature_state テーブル */
-
- FEAT_SUBTYPE subtype; /*!< 副特性値 */
- FEAT_POWER power; /*!< 地形強度 */
-
- TERM_COLOR d_attr[F_LIT_MAX]; /*!< デフォルトの地形シンボルカラー / Default feature attribute */
- SYMBOL_CODE d_char[F_LIT_MAX]; /*!< デフォルトの地形シンボルアルファベット / Default feature character */
-
- TERM_COLOR x_attr[F_LIT_MAX]; /*!< 設定変更後の地形シンボルカラー / Desired feature attribute */
- SYMBOL_CODE x_char[F_LIT_MAX]; /*!< 設定変更後の地形シンボルアルファベット / Desired feature character */
-};
-
-
-/*!
- * @struct object_kind
- * @brief ベースアイテム情報の構造体 / Information about object "kinds", including player knowledge.
- * @details
- * ゲーム進行用のセーブファイル上では aware と tried のみ保存対象とすること。と英文ではあるが実際はもっとある様子である。 /
- * Only "aware" and "tried" are saved in the savefile
- */
-
-typedef struct object_kind object_kind;
-
-struct object_kind
-{
- STR_OFFSET name; /*!< ベースアイテム名参照のためのネームバッファオフセット値 / Name (offset) */
- STR_OFFSET text; /*!< 解説テキスト参照のためのネームバッファオフセット値 / Text (offset) */
- STR_OFFSET flavor_name; /*!< 未確定名参照のためのネームバッファオフセット値 / Flavor name (offset) */
-
- OBJECT_TYPE_VALUE tval; /*!< ベースアイテム種別の大項目値 Object type */
- OBJECT_SUBTYPE_VALUE sval; /*!< ベースアイテム種別の小項目値 Object sub type */
-
- PARAMETER_VALUE pval; /*!< ベースアイテムのpval(能力修正共通値) Object extra info */
-
- HIT_PROB to_h; /*!< ベースアイテムの命中修正値 / Bonus to hit */
- HIT_POINT to_d; /*!< ベースアイテムのダメージ修正値 / Bonus to damage */
- ARMOUR_CLASS to_a; /*!< ベースアイテムのAC修正値 / Bonus to armor */
-
- ARMOUR_CLASS ac; /*!< ベースアイテムのAC基本値 / Base armor */
-
- DICE_NUMBER dd;
- DICE_SID ds; /*!< ダメージダイスの数と大きさ / Damage dice/sides */
-
- WEIGHT weight; /*!< ベースアイテムの重量 / Weight */
-
- PRICE cost; /*!< ベースアイテムの基本価値 / Object "base cost" */
-
- BIT_FLAGS flags[TR_FLAG_SIZE]; /*!< ベースアイテムの基本特性ビット配列 / Flags */
-
- BIT_FLAGS gen_flags; /*!< ベースアイテムの生成特性ビット配列 / flags for generate */
-
- DEPTH locale[4]; /*!< ベースアイテムの生成階テーブル / Allocation level(s) */
- PROB chance[4]; /*!< ベースアイテムの生成確率テーブル / Allocation chance(s) */
-
- DEPTH level; /*!< ベースアイテムの基本生成階 / Level */
- BIT_FLAGS8 extra; /*!< その他色々のビットフラグ配列 / Something */
-
- TERM_COLOR d_attr; /*!< デフォルトのアイテムシンボルカラー / Default object attribute */
- SYMBOL_CODE d_char; /*!< デフォルトのアイテムシンボルアルファベット / Default object character */
-
- TERM_COLOR x_attr; /*!< 設定変更後のアイテムシンボルカラー / Desired object attribute */
- SYMBOL_CODE x_char; /*!< 設定変更後のアイテムシンボルアルファベット / Desired object character */
-
- IDX flavor; /*!< 調査中(TODO) / Special object flavor (or zero) */
-
- bool easy_know; /*!< ベースアイテムが初期からベース名を判断可能かどうか / This object is always known (if aware) */
-
- bool aware; /*!< ベースアイテムが鑑定済かどうか / The player is "aware" of the item's effects */
-
- bool tried; /*!< ベースアイテムを未鑑定のまま試したことがあるか / The player has "tried" one of the items */
-
- ACTIVATION_IDX act_idx; /*!< 発動能力のID / Activative ability index */
-};
-
-
-
-typedef struct artifact_type artifact_type;
-
-/*!
- * @struct artifact_type
- * @brief 固定アーティファクト情報の構造体 / Artifact structure.
- * @details
- * @note
- * the save-file only writes "cur_num" to the savefile.
- * "max_num" is always "1" (if that artifact "exists")
- */
-struct artifact_type
-{
- STR_OFFSET name; /*!< アーティファクト名(headerオフセット参照) / Name (offset) */
- STR_OFFSET text; /*!< アーティファクト解説(headerオフセット参照) / Text (offset) */
-
- OBJECT_TYPE_VALUE tval; /*!< ベースアイテム大項目ID / Artifact type */
- OBJECT_SUBTYPE_VALUE sval; /*!< ベースアイテム小項目ID / Artifact sub type */
-
- PARAMETER_VALUE pval; /*!< pval修正値 / Artifact extra info */
-
- HIT_PROB to_h; /*!< 命中ボーナス値 / Bonus to hit */
- HIT_POINT to_d; /*!< ダメージボーナス値 / Bonus to damage */
- ARMOUR_CLASS to_a; /*!< ACボーナス値 / Bonus to armor */
-
- ARMOUR_CLASS ac; /*!< 上書きベースAC値 / Base armor */
-
- DICE_NUMBER dd;
- DICE_SID ds; /*!< ダイス値 / Damage when hits */
-
- WEIGHT weight; /*!< 重量 / Weight */
-
- PRICE cost; /*!< 基本価格 / Artifact "cost" */
-
- BIT_FLAGS flags[TR_FLAG_SIZE]; /*! アイテムフラグ / Artifact Flags */
-
- BIT_FLAGS gen_flags; /*! アイテム生成フラグ / flags for generate */
-
- DEPTH level; /*! 基本生成階 / Artifact level */
- RARITY rarity; /*! レアリティ / Artifact rarity */
-
- byte cur_num; /*! 現在の生成数 / Number created (0 or 1) */
- byte max_num; /*! (未使用)最大生成数 / Unused (should be "1") */
-
- FLOOR_IDX floor_id; /*! アイテムを落としたフロアのID / Leaved on this location last time */
-
- byte act_idx; /*! 発動能力ID / Activative ability index */
-};
+//#include "player-skill.h"
/*
/*
- * Monster "race" information, including racial memories
- *
- * Note that "d_attr" and "d_char" are used for MORE than "visual" stuff.
- *
- * Note that "x_attr" and "x_char" are used ONLY for "visual" stuff.
- *
- * Note that "cur_num" (and "max_num") represent the number of monsters
- * of the given race currently on (and allowed on) the current level.
- * This information yields the "dead" flag for Unique monsters.
- *
- * Note that "max_num" is reset when a new player is created.
- * Note that "cur_num" is reset when a new level is created.
- *
- * Note that several of these fields, related to "recall", can be
- * scrapped if space becomes an issue, resulting in less "complete"
- * monster recall (no knowledge of spells, etc). All of the "recall"
- * fields have a special prefix to aid in searching for them.
- */
-
-
-typedef struct monster_race monster_race;
-
-struct monster_race
-{
- STR_OFFSET name; /*!< 名前データのオフセット(日本語) / Name offset(Japanese) */
-#ifdef JP
- STR_OFFSET E_name; /*!< 名前データのオフセット(英語) / Name offset(English) */
-#endif
- STR_OFFSET text; /*!< 思い出テキストのオフセット / Lore text offset */
-
- DICE_NUMBER hdice; /*!< HPのダイス数 / Creatures hit dice count */
- DICE_SID hside; /*!< HPのダイス面数 / Creatures hit dice sides */
-
- ARMOUR_CLASS ac; /*!< アーマークラス / Armour Class */
-
- SLEEP_DEGREE sleep; /*!< 睡眠値 / Inactive counter (base) */
- POSITION aaf; /*!< 感知範囲(1-100スクエア) / Area affect radius (1-100) */
- SPEED speed; /*!< 加速(110で+0) / Speed (normally 110) */
-
- EXP mexp; /*!< 殺害時基本経験値 / Exp value for kill */
-
- BIT_FLAGS16 extra; /*!< 未使用 / Unused (for now) */
-
- RARITY freq_spell; /*!< 魔法&特殊能力仕様頻度(1/n) / Spell frequency */
-
- BIT_FLAGS flags1; /* Flags 1 (general) */
- BIT_FLAGS flags2; /* Flags 2 (abilities) */
- BIT_FLAGS flags3; /* Flags 3 (race/resist) */
- BIT_FLAGS flags4; /* Flags 4 (inate/breath) */
- BIT_FLAGS flags7; /* Flags 7 (movement related abilities) */
- BIT_FLAGS flags8; /* Flags 8 (wilderness info) */
- BIT_FLAGS flags9; /* Flags 9 (drops info) */
- BIT_FLAGS flagsr; /* Flags R (resistances info) */
-
- BIT_FLAGS a_ability_flags1; /* Activate Ability Flags 5 (normal spells) */
- BIT_FLAGS a_ability_flags2; /* Activate Ability Flags 6 (special spells) */
- BIT_FLAGS a_ability_flags3; /* Activate Ability Flags 7 (implementing) */
- BIT_FLAGS a_ability_flags4; /* Activate Ability Flags 8 (implementing) */
-
- monster_blow blow[4]; /* Up to four blows per round */
- MONRACE_IDX reinforce_id[6];
- DICE_NUMBER reinforce_dd[6];
- DICE_SID reinforce_ds[6];
-
- ARTIFACT_IDX artifact_id[4]; /* 特定アーティファクトドロップID */
- RARITY artifact_rarity[4]; /* 特定アーティファクトレア度 */
- PERCENTAGE artifact_percent[4]; /* 特定アーティファクトドロップ率 */
-
- PERCENTAGE arena_ratio; /* アリーナの評価修正値(%基準 / 0=100%) / Arena */
-
- MONRACE_IDX next_r_idx;
- EXP next_exp;
-
- DEPTH level; /* Level of creature */
- RARITY rarity; /* Rarity of creature */
-
- TERM_COLOR d_attr; /* Default monster attribute */
- SYMBOL_CODE d_char; /* Default monster character */
-
- TERM_COLOR x_attr; /* Desired monster attribute */
- SYMBOL_CODE x_char; /* Desired monster character */
-
-
- MONSTER_NUMBER max_num; /* Maximum population allowed per level */
- MONSTER_NUMBER cur_num; /* Monster population on current level */
-
- FLOOR_IDX floor_id; /* Location of unique monster */
-
-
- MONSTER_NUMBER r_sights; /* Count sightings of this monster */
- MONSTER_NUMBER r_deaths; /* Count deaths from this monster */
-
- MONSTER_NUMBER r_pkills; /* Count visible monsters killed in this life */
- MONSTER_NUMBER r_akills; /* Count all monsters killed in this life */
- MONSTER_NUMBER r_tkills; /* Count monsters killed in all lives */
-
- byte r_wake; /* Number of times woken up (?) */
- byte r_ignore; /* Number of times ignored (?) */
-
- byte r_xtra1; /* Something (unused) */
- byte r_xtra2; /* Something (unused) */
-
- ITEM_NUMBER r_drop_gold; /*!< これまでに撃破時に落とした財宝の数 / Max number of gold dropped at once */
- ITEM_NUMBER r_drop_item; /*!< これまでに撃破時に落としたアイテムの数 / Max number of item dropped at once */
-
- byte r_cast_spell; /* Max number of other spells seen */
-
- byte r_blows[4]; /* Number of times each blow type was seen */
-
- u32b r_flags1; /* Observed racial flags */
- u32b r_flags2; /* Observed racial flags */
- u32b r_flags3; /* Observed racial flags */
- u32b r_flags4; /* Observed racial flags */
- u32b r_flags5; /* Observed racial flags */
- u32b r_flags6; /* Observed racial flags */
- /* u32b r_flags7; */ /* Observed racial flags */
- u32b r_flagsr; /* Observed racial resistance flags */
-};
-
-
-
-/*
- * Information about "vault generation"
- */
-
-typedef struct vault_type vault_type;
-
-struct vault_type
-{
- STR_OFFSET name; /* Name (offset) */
- STR_OFFSET text; /* Text (offset) */
-
- ROOM_IDX typ; /* Vault type */
- PROB rat; /* Vault rating (unused) */
- POSITION hgt; /* Vault height */
- POSITION wid; /* Vault width */
-};
-
-
-/*
- * Information about "skill"
- */
-
-typedef struct skill_table skill_table;
-
-struct skill_table
-{
- SUB_EXP w_start[5][64]; /* start weapon exp */
- SUB_EXP w_max[5][64]; /* max weapon exp */
- SUB_EXP s_start[10]; /* start skill */
- SUB_EXP s_max[10]; /* max skill */
-};
-
-
-/*
- * A single "grid" in a Cave
- *
- * Note that several aspects of the code restrict the actual current_floor_ptr->grid_array
- * to a max size of 256 by 256. In partcular, locations are often
- * saved as bytes, limiting each coordinate to the 0-255 range.
- *
- * The "o_idx" and "m_idx" fields are very interesting. There are
- * many places in the code where we need quick access to the actual
- * monster or object(s) in a given grid. The easiest way to
- * do this is to simply keep the index of the monster and object
- * (if any) with the grid, but this takes 198*66*4 bytes of memory.
- * Several other methods come to mind, which require only half this
- * amound of memory, but they all seem rather complicated, and would
- * probably add enough code that the savings would be lost. So for
- * these reasons, we simply store an index into the "o_list" and
- * "current_floor_ptr->m_list" arrays, using "zero" when no monster/object is present.
- *
- * Note that "o_idx" is the index of the top object in a stack of
- * objects, using the "next_o_idx" field of objects (see below) to
- * create the singly linked list of objects. If "o_idx" is zero
- * then there are no objects in the grid.
- *
- * Note the special fields for the "MONSTER_FLOW" code.
- */
-
-typedef struct grid_type grid_type;
-
-struct grid_type
-{
- BIT_FLAGS info; /* Hack -- current_floor_ptr->grid_array flags */
-
- FEAT_IDX feat; /* Hack -- feature type */
- OBJECT_IDX o_idx; /* Object in this grid */
- MONSTER_IDX m_idx; /* Monster in this grid */
-
- /*! 地形の特別な情報を保存する / Special current_floor_ptr->grid_array info
- * 具体的な使用一覧はクエスト行き階段の移行先クエストID、
- * 各ダンジョン入口の移行先ダンジョンID、
- *
- */
- s16b special;
-
- FEAT_IDX mimic; /* Feature to mimic */
-
- byte cost; /* Hack -- cost of flowing */
- byte dist; /* Hack -- distance from player */
- byte when; /* Hack -- when cost was computed */
-};
-
-
-
-/*
- * Simple structure to hold a map location
- */
-typedef struct coord coord;
-
-struct coord
-{
- POSITION y;
- POSITION x;
-};
-
-
-
-/*
- * Object information, for a specific object.
- *
- * Note that a "discount" on an item is permanent and never goes away.
- *
- * Note that inscriptions are now handled via the "quark_str()" function
- * applied to the "note" field, which will return NULL if "note" is zero.
- *
- * Note that "object" records are "copied" on a fairly regular basis,
- * and care must be taken when handling such objects.
- *
- * Note that "object flags" must now be derived from the object kind,
- * the artifact and ego-item indexes, and the two "xtra" fields.
- *
- * Each grid points to one (or zero) objects via the "o_idx"
- * field (above). Each object then points to one (or zero) objects
- * via the "next_o_idx" field, forming a singly linked list, which
- * in game terms, represents a "stack" of objects in the same grid.
- *
- * Each monster points to one (or zero) objects via the "hold_o_idx"
- * field (below). Each object then points to one (or zero) objects
- * via the "next_o_idx" field, forming a singly linked list, which
- * in game terms, represents a pile of objects held by the monster.
- *
- * The "held_m_idx" field is used to indicate which monster, if any,
- * is holding the object. Objects being held have "ix=0" and "iy=0".
- */
-
-typedef struct object_type object_type;
-
-struct object_type
-{
- KIND_OBJECT_IDX k_idx; /* Kind index (zero if "dead") */
-
- POSITION iy; /* Y-position on map, or zero */
- POSITION ix; /* X-position on map, or zero */
-
- OBJECT_TYPE_VALUE tval; /* Item type (from kind) */
- OBJECT_SUBTYPE_VALUE sval; /* Item sub-type (from kind) */
-
- PARAMETER_VALUE pval; /* Item extra-parameter */
-
- DISCOUNT_RATE discount; /* Discount (if any) */
-
- ITEM_NUMBER number; /* Number of items */
-
- WEIGHT weight; /* Item weight */
-
- ARTIFACT_IDX name1; /* Artifact type, if any */
- EGO_IDX name2; /* Ego-Item type, if any */
-
- XTRA8 xtra1; /* Extra info type (now unused) */
- XTRA8 xtra2; /* Extra info activation index */
- XTRA8 xtra3; /* Extra info for weaponsmith */
- XTRA16 xtra4; /*!< 光源の残り寿命、あるいは捕らえたモンスターの現HP / Extra info fuel or captured monster's current HP */
- XTRA16 xtra5; /*!< 捕らえたモンスターの最大HP / Extra info captured monster's max HP */
-
- HIT_PROB to_h; /* Plusses to hit */
- HIT_POINT to_d; /* Plusses to damage */
- ARMOUR_CLASS to_a; /* Plusses to AC */
-
- ARMOUR_CLASS ac; /* Normal AC */
-
- DICE_NUMBER dd;
- DICE_SID ds; /* Damage dice/sides */
-
- TIME_EFFECT timeout; /* Timeout Counter */
-
- byte ident; /* Special flags */
- byte marked; /* Object is marked */
-
- u16b inscription; /* Inscription index */
- u16b art_name; /* Artifact name (random artifacts) */
-
- byte feeling; /* Game generated inscription number (eg, pseudo-id) */
-
- BIT_FLAGS art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */
- BIT_FLAGS curse_flags; /* Flags for curse */
-
- OBJECT_IDX next_o_idx; /* Next object in stack (if any) */
- MONSTER_IDX held_m_idx; /* Monster holding us (if any) */
-
- ARTIFACT_BIAS_IDX artifact_bias; /*!< ランダムアーティファクト生成時のバイアスID */
-};
-
-
-
-/*
- * Monster information, for a specific monster.
- * Note: fy, fx constrain dungeon size to 256x256
- * The "hold_o_idx" field points to the first object of a stack
- * of objects (if any) being carried by the monster (see above).
- */
-
-typedef struct monster_type monster_type;
-
-struct monster_type
-{
- MONRACE_IDX r_idx; /* Monster race index */
- MONRACE_IDX ap_r_idx; /* Monster race appearance index */
- byte sub_align; /* Sub-alignment for a neutral monster */
-
- POSITION fy; /* Y location on map */
- POSITION fx; /* X location on map */
-
- HIT_POINT hp; /* Current Hit points */
- HIT_POINT maxhp; /* Max Hit points */
- HIT_POINT max_maxhp; /* Max Max Hit points */
- HIT_POINT dealt_damage; /* Sum of damages dealt by player */
-
- TIME_EFFECT mtimed[MAX_MTIMED]; /* Timed status counter */
-
- SPEED mspeed; /* Monster "speed" */
- ACTION_ENERGY energy_need; /* Monster "energy" */
-
- POSITION cdis; /* Current dis from player */
-
- BIT_FLAGS8 mflag; /* Extra monster flags */
- BIT_FLAGS8 mflag2; /* Extra monster flags */
-
- bool ml; /* Monster is "visible" */
-
- OBJECT_IDX hold_o_idx; /* Object being held (if any) */
-
- POSITION target_y; /* Can attack !los player */
- POSITION target_x; /* Can attack !los player */
-
- STR_OFFSET nickname; /* Monster's Nickname */
-
- EXP exp;
-
- /* TODO: クローン、ペット、有効化は意義が異なるので別変数に切り離すこと。save/loadのバージョン更新が面倒そうだけど */
- BIT_FLAGS smart; /*!< Field for "smart_learn" - Some bit-flags for the "smart" field */
- #define SM_RES_ACID 0x00000001 /*!< モンスターの学習フラグ: プレイヤーに酸耐性あり */
- #define SM_RES_ELEC 0x00000002 /*!< モンスターの学習フラグ: プレイヤーに電撃耐性あり */
- #define SM_RES_FIRE 0x00000004 /*!< モンスターの学習フラグ: プレイヤーに火炎耐性あり */
- #define SM_RES_COLD 0x00000008 /*!< モンスターの学習フラグ: プレイヤーに冷気耐性あり */
- #define SM_RES_POIS 0x00000010 /*!< モンスターの学習フラグ: プレイヤーに毒耐性あり */
- #define SM_RES_NETH 0x00000020 /*!< モンスターの学習フラグ: プレイヤーに地獄耐性あり */
- #define SM_RES_LITE 0x00000040 /*!< モンスターの学習フラグ: プレイヤーに閃光耐性あり */
- #define SM_RES_DARK 0x00000080 /*!< モンスターの学習フラグ: プレイヤーに暗黒耐性あり */
- #define SM_RES_FEAR 0x00000100 /*!< モンスターの学習フラグ: プレイヤーに恐怖耐性あり */
- #define SM_RES_CONF 0x00000200 /*!< モンスターの学習フラグ: プレイヤーに混乱耐性あり */
- #define SM_RES_CHAOS 0x00000400 /*!< モンスターの学習フラグ: プレイヤーにカオス耐性あり */
- #define SM_RES_DISEN 0x00000800 /*!< モンスターの学習フラグ: プレイヤーに劣化耐性あり */
- #define SM_RES_BLIND 0x00001000 /*!< モンスターの学習フラグ: プレイヤーに盲目耐性あり */
- #define SM_RES_NEXUS 0x00002000 /*!< モンスターの学習フラグ: プレイヤーに因果混乱耐性あり */
- #define SM_RES_SOUND 0x00004000 /*!< モンスターの学習フラグ: プレイヤーに轟音耐性あり */
- #define SM_RES_SHARD 0x00008000 /*!< モンスターの学習フラグ: プレイヤーに破片耐性あり */
- #define SM_OPP_ACID 0x00010000 /*!< モンスターの学習フラグ: プレイヤーに二重酸耐性あり */
- #define SM_OPP_ELEC 0x00020000 /*!< モンスターの学習フラグ: プレイヤーに二重電撃耐性あり */
- #define SM_OPP_FIRE 0x00040000 /*!< モンスターの学習フラグ: プレイヤーに二重火炎耐性あり */
- #define SM_OPP_COLD 0x00080000 /*!< モンスターの学習フラグ: プレイヤーに二重冷気耐性あり */
- #define SM_OPP_POIS 0x00100000 /*!< モンスターの学習フラグ: プレイヤーに二重毒耐性あり */
- #define SM_OPP_XXX1 0x00200000 /*!< 未使用 / (unused) */
- #define SM_CLONED 0x00400000 /*!< クローンである / Cloned */
- #define SM_PET 0x00800000 /*!< ペットである / Pet */
- #define SM_IMM_ACID 0x01000000 /*!< モンスターの学習フラグ: プレイヤーに酸免疫あり */
- #define SM_IMM_ELEC 0x02000000 /*!< モンスターの学習フラグ: プレイヤーに電撃免疫あり */
- #define SM_IMM_FIRE 0x04000000 /*!< モンスターの学習フラグ: プレイヤーに火炎免疫あり */
- #define SM_IMM_COLD 0x08000000 /*!< モンスターの学習フラグ: プレイヤーに冷気免疫あり */
- #define SM_FRIENDLY 0x10000000 /*!< 友好的である / Friendly */
- #define SM_IMM_REFLECT 0x20000000 /*!< モンスターの学習フラグ: プレイヤーに反射あり */
- #define SM_IMM_FREE 0x40000000 /*!< モンスターの学習フラグ: プレイヤーに麻痺耐性あり */
- #define SM_IMM_MANA 0x80000000 /*!< モンスターの学習フラグ: プレイヤーにMPがない */
-
- MONSTER_IDX parent_m_idx;
-};
-
-
-
-
-/*
* An entry for the object/monster allocation functions
*
* Pass 1 is determined from allocation information
/*
- * Available "options"
- *
- * - Address of actual option variable (or NULL)
- *
- * - Normal Value (TRUE or FALSE)
- *
- * - Option Page Number (or zero)
- *
- * - Savefile Set (or zero)
- * - Savefile Bit in that set
- *
- * - Textual name (or NULL)
- * - Textual description
- */
-
-typedef struct option_type option_type;
-
-struct option_type
-{
- bool *o_var;
-
- byte o_norm;
-
- byte o_page;
-
- byte o_set;
- byte o_bit;
-
- concptr o_text;
- concptr o_desc;
-};
-
-
-typedef struct quest_type quest_type;
-
-/*!
- * @struct quest_type
- * @brief クエスト情報の構造体 / Structure for the "quests".
- */
-
-struct quest_type
-{
- QUEST_STATUS status; /*!< クエストの進行ステータス / Is the quest taken, completed, finished? */
- QUEST_TYPE type; /*!< クエストの種別 / The quest type */
-
- GAME_TEXT name[60]; /*!< クエスト名 / Quest name */
- DEPTH level; /*!< 処理階層 / Dungeon level */
- MONRACE_IDX r_idx; /*!< クエスト対象のモンスターID / Monster race */
-
- MONSTER_NUMBER cur_num; /*!< 撃破したモンスターの数 / Number killed */
- MONSTER_NUMBER max_num; /*!< 求められるモンスターの撃破数 / Number required */
-
- KIND_OBJECT_IDX k_idx; /*!< クエスト対象のアイテムID / object index */
- MONSTER_NUMBER num_mon; /*!< QUEST_TYPE_KILL_NUMBER時の目標撃破数 number of monsters on level */
-
- BIT_FLAGS flags; /*!< クエストに関するフラグビット / quest flags */
- DUNGEON_IDX dungeon; /*!< クエスト対象のダンジョンID / quest dungeon */
-
- PLAYER_LEVEL complev; /*!< クリア時プレイヤーレベル / player level (complete) */
- REAL_TIME comptime; /*!< クリア時ゲーム時間 / quest clear time*/
-};
-
-
-/*
- * A store owner
- */
-typedef struct owner_type owner_type;
-
-struct owner_type
-{
- concptr owner_name; /* Name */
- PRICE max_cost; /* Purse limit */
- byte max_inflate; /* Inflation (max) */
- byte min_inflate; /* Inflation (min) */
- byte haggle_per; /* Haggle unit */
- byte insult_max; /* Insult limit */
- byte owner_race; /* Owner race */
-};
-
-
-
-
-/*
* A store, with an owner, various state flags, a current stock
* of items, and a table of items that are often purchased.
*/
/*
- * Information about the player's "magic"
- *
- * Note that a player with a "spell_book" of "zero" is illiterate.
- */
-
-typedef struct player_magic player_magic;
-
-struct player_magic
-{
- OBJECT_TYPE_VALUE spell_book; /* Tval of spell books (if any) */
- int spell_xtra; /* Something for later */
-
- int spell_stat; /* Stat for spells (if any) */
- int spell_type; /* Spell type (mage/priest) */
-
- int spell_first; /* Level of first spell */
- int spell_weight; /* Weight that hurts spells */
-
- magic_type info[MAX_MAGIC][32]; /* The available spells */
-};
-
-
-
-/*
* Player sex info
*/
};
-/*
- * Player class info
- */
-
-typedef struct player_class player_class;
-
-struct player_class
-{
- concptr title; /* Type of class */
-
-#ifdef JP
- concptr E_title; /* 英語職業 */
-#endif
- s16b c_adj[6]; /* Class stat modifier */
-
- s16b c_dis; /* class disarming */
- s16b c_dev; /* class magic devices */
- s16b c_sav; /* class saving throws */
- s16b c_stl; /* class stealth */
- s16b c_srh; /* class searching ability */
- s16b c_fos; /* class searching frequency */
- s16b c_thn; /* class to hit (normal) */
- s16b c_thb; /* class to hit (bows) */
-
- s16b x_dis; /* extra disarming */
- s16b x_dev; /* extra magic devices */
- s16b x_sav; /* extra saving throws */
- s16b x_stl; /* extra stealth */
- s16b x_srh; /* extra searching ability */
- s16b x_fos; /* extra searching frequency */
- s16b x_thn; /* extra to hit (normal) */
- s16b x_thb; /* extra to hit (bows) */
-
- s16b c_mhp; /* Class hit-dice adjustment */
- s16b c_exp; /* Class experience factor */
-
- byte pet_upkeep_div; /* Pet upkeep divider */
-};
-
-
typedef struct player_seikaku player_seikaku;
struct player_seikaku
{
TIME_EFFECT dustrobe; /* Timed -- Robe of dust */
bool timewalk;
-
+ GAME_TURN resting; /* Current counter for resting, if any */
PATRON_IDX chaos_patron;
FEED food; /* Current nutrition */
- BIT_FLAGS special_attack; /* Special attack capacity -LM- */
- BIT_FLAGS special_defense; /* Special block capacity -LM- */
+ /*
+ * p_ptr->special_attackによるプレイヤーの攻撃状態の定義 / Bit flags for the "p_ptr->special_attack" variable. -LM-
+ *
+ * Note: The elemental and poison attacks should be managed using the
+ * function "set_ele_attack", in spell2.c. This provides for timeouts and
+ * prevents the player from getting more than one at a time.
+ */
+ BIT_FLAGS special_attack;
+ #define ATTACK_CONFUSE 0x00000001 /*!< プレイヤーのステータス:混乱打撃 */
+ #define ATTACK_XXX1 0x00000002 /*!< プレイヤーのステータス:未使用1 */
+ #define ATTACK_XXX2 0x00000004 /*!< プレイヤーのステータス:未使用2 */
+ #define ATTACK_XXX3 0x00000008 /*!< プレイヤーのステータス:未使用3 */
+ #define ATTACK_ACID 0x00000010 /*!< プレイヤーのステータス:魔法剣/溶解 */
+ #define ATTACK_ELEC 0x00000020 /*!< プレイヤーのステータス:魔法剣/電撃 */
+ #define ATTACK_FIRE 0x00000040 /*!< プレイヤーのステータス:魔法剣/火炎 */
+ #define ATTACK_COLD 0x00000080 /*!< プレイヤーのステータス:魔法剣/冷凍 */
+ #define ATTACK_POIS 0x00000100 /*!< プレイヤーのステータス:魔法剣/毒殺 */
+ #define ATTACK_HOLY 0x00000200 /*!< プレイヤーのステータス:対邪?(未使用) */
+ #define ATTACK_SUIKEN 0x00000400 /*!< プレイヤーのステータス:酔拳 */
+
+ /*
+ * p_ptr->special_defenseによるプレイヤーの防御状態の定義 / Bit flags for the "p_ptr->special_defense" variable. -LM-
+ */
+ BIT_FLAGS special_defense;
+ #define DEFENSE_ACID 0x00000001 /*!< プレイヤーのステータス:酸免疫 */
+ #define DEFENSE_ELEC 0x00000002 /*!< プレイヤーのステータス:電撃免疫 */
+ #define DEFENSE_FIRE 0x00000004 /*!< プレイヤーのステータス:火炎免疫 */
+ #define DEFENSE_COLD 0x00000008 /*!< プレイヤーのステータス:冷気免疫 */
+ #define DEFENSE_POIS 0x00000010 /*!< プレイヤーのステータス:毒免疫 */
+ #define KAMAE_GENBU 0x00000020 /*!< プレイヤーのステータス:玄武の構え */
+ #define KAMAE_BYAKKO 0x00000040 /*!< プレイヤーのステータス:白虎の構え */
+ #define KAMAE_SEIRYU 0x00000080 /*!< プレイヤーのステータス:青竜の構え */
+ #define KAMAE_SUZAKU 0x00000100 /*!< プレイヤーのステータス:朱雀の構え */
+ #define KATA_IAI 0x00000200 /*!< プレイヤーのステータス:居合 */
+ #define KATA_FUUJIN 0x00000400 /*!< プレイヤーのステータス:風塵 */
+ #define KATA_KOUKIJIN 0x00000800 /*!< プレイヤーのステータス:降鬼陣 */
+ #define KATA_MUSOU 0x00001000 /*!< プレイヤーのステータス:無想 */
+ #define NINJA_KAWARIMI 0x00002000 /*!< プレイヤーのステータス:変わり身 */
+ #define NINJA_S_STEALTH 0x00004000 /*!< プレイヤーのステータス:超隠密 */
+ #define MAX_KAMAE 4 /*!< 修行僧の構え最大数 */
+ #define KAMAE_MASK (KAMAE_GENBU | KAMAE_BYAKKO | KAMAE_SEIRYU | KAMAE_SUZAKU) /*!< 修行僧の構えビット配列 */
+ #define MAX_KATA 4 /*!< 修行僧の型最大数 */
+ #define KATA_MASK (KATA_IAI | KATA_FUUJIN | KATA_KOUKIJIN | KATA_MUSOU) /*!< 修行僧の型ビット配列 */
+
ACTION_IDX action; /* Currently action */
+ #define ACTION_NONE 0 /*!< 持続行動: なし */
+ #define ACTION_SEARCH 1 /*!< 持続行動: 探索 */
+ #define ACTION_REST 2 /*!< 持続行動: 休憩 */
+ #define ACTION_LEARN 3 /*!< 持続行動: 青魔法ラーニング */
+ #define ACTION_FISH 4 /*!< 持続行動: 釣り */
+ #define ACTION_KAMAE 5 /*!< 持続行動: 修行僧の構え */
+ #define ACTION_KATA 6 /*!< 持続行動: 剣術家の型 */
+ #define ACTION_SING 7 /*!< 持続行動: 歌 */
+ #define ACTION_HAYAGAKE 8 /*!< 持続行動: 早駆け */
+ #define ACTION_SPELL 9 /*!< 持続行動: 呪術 */
BIT_FLAGS spell_learned1; /* bit mask of spells learned */
BIT_FLAGS spell_learned2; /* bit mask of spells learned */
bool wait_report_score; /* Waiting to report score */
bool is_dead; /* Player is dead */
bool now_damaged;
+ bool ambush_flag;
bool wizard; /* Player is in wizard mode */
byte feeling; /* Most recent dungeon feeling */
s32b feeling_turn; /* The current_world_ptr->game_turn of the last dungeon feeling */
+ object_type *inventory_list; /* The player's p_ptr->inventory_list [INVEN_TOTAL] */
+ s16b inven_cnt; /* Number of items in inventory */
+ s16b equip_cnt; /* Number of items in equipment */
- /*** Temporary fields ***/
+ /*** Temporary fields ***/
bool playing; /* True if player is playing */
bool leaving; /* True if player is leaving */
+ bool monk_armour_aux;
+ bool monk_notify_aux;
+
+ byte leave_bldg;
byte exit_bldg; /* Goal obtained in arena? -KMW- */
bool leaving_dungeon; /* True if player is leaving the dungeon */
bool old_riding_ryoute;
bool old_monlite;
- s16b old_lite; /* Old radius of lite (if any) */
+ POSITION old_lite; /* Old radius of lite (if any) */
bool cumber_armor; /* Mana draining armor */
bool cumber_glove; /* Mana draining gloves */
bool riding_ryoute; /* Riding weapon */
bool monlite;
- s16b cur_lite; /* Radius of lite (if any) */
+ POSITION cur_lite; /* Radius of lite (if any) */
BIT_FLAGS update; /* Pending Updates */
#define PU_BONUS 0x00000001L /*!< ステータス更新フラグ: 能力値修正 / Calculate bonuses */
BIT_FLAGS redraw; /* Normal Redraws */
BIT_FLAGS window; /* Window Redraws */
- s16b stat_use[6]; /* Current modified stats */
- s16b stat_top[6]; /* Maximal modified stats */
+ s16b stat_use[A_MAX]; /* Current modified stats */
+ s16b stat_top[A_MAX]; /* Maximal modified stats */
bool sutemi;
bool counter;
WEIGHT total_weight; /*!< 所持品と装備品の計算総重量 / Total weight being carried */
- s16b stat_add[6]; /* Modifiers to stat values */
- s16b stat_ind[6]; /* Indexes into stat tables */
+ s16b stat_add[A_MAX]; /* Modifiers to stat values */
+ s16b stat_ind[A_MAX]; /* Indexes into stat tables */
+
+ bool hack_mutation;
bool immune_acid; /* Immunity to acid */
bool immune_elec; /* Immunity to lightning */
concptr info;
};
-/* Mindcrafters */
-typedef struct mind_type mind_type;
-struct mind_type
-{
- PLAYER_LEVEL min_lev;
- MANA_POINT mana_cost;
- PERCENTAGE fail;
- concptr name;
-};
-
-typedef struct mind_power mind_power;
-struct mind_power
-{
- mind_type info[MAX_MIND_POWERS];
-};
/* Imitator */
/*
- * A structure to describe a building.
- * From Kamband
- */
-typedef struct building_type building_type;
-
-struct building_type
-{
- GAME_TEXT name[20]; /* proprietor name */
- GAME_TEXT owner_name[20]; /* proprietor name */
- GAME_TEXT owner_race[20]; /* proprietor race */
-
- GAME_TEXT act_names[8][30]; /* action names */
- PRICE member_costs[8]; /* Costs for class members of building */
- PRICE other_costs[8]; /* Costs for nonguild members */
- char letters[8]; /* action letters */
- BACT_IDX actions[8]; /* action codes */
- BACT_RESTRICT_IDX action_restr[8]; /* action restrictions */
-
- CLASS_IDX member_class[MAX_CLASS]; /* which classes are part of guild */
- RACE_IDX member_race[MAX_RACES]; /* which classes are part of guild */
- REALM_IDX member_realm[MAX_MAGIC+1]; /* which realms are part of guild */
-};
-
-
-/* Border */
-typedef struct border_type border_type;
-struct border_type
-{
- s16b north[MAX_WID];
- s16b south[MAX_WID];
- s16b east[MAX_HGT];
- s16b west[MAX_HGT];
- s16b north_west;
- s16b north_east;
- s16b south_west;
- s16b south_east;
-};
-
-
-/*
- * A structure describing a wilderness area
- * with a terrain or a town
- */
-typedef struct wilderness_type wilderness_type;
-struct wilderness_type
-{
- int terrain;
- TOWN_IDX town;
- int road;
- u32b seed;
- DEPTH level;
- byte entrance;
-};
-
-
-/*
* A structure describing a town with
* stores and buildings
*/
typedef int (*inven_func)(object_type *);
-/*
- * Semi-Portable High Score List Entry (128 bytes) -- BEN
- *
- * All fields listed below are null terminated ascii strings.
- *
- * In addition, the "number" fields are right justified, and
- * space padded, to the full available length (minus the "null").
- *
- * Note that "string comparisons" are thus valid on "pts".
- */
-
-typedef struct high_score high_score;
-
-struct high_score
-{
- GAME_TEXT what[8]; /* Version info (string) */
- GAME_TEXT pts[10]; /* Total Score (number) */
- GAME_TEXT gold[10]; /* Total Gold (number) */
- GAME_TEXT turns[10]; /* Turns Taken (number) */
- GAME_TEXT day[10]; /* Time stamp (string) */
- GAME_TEXT who[16]; /* Player Name (string) */
- GAME_TEXT uid[8]; /* Player UID (number) */
- GAME_TEXT sex[2]; /* Player Sex (string) */
- GAME_TEXT p_r[3]; /* Player Race (number) */
- GAME_TEXT p_c[3]; /* Player Class (number) */
- GAME_TEXT p_a[3]; /* Player Seikaku (number) */
-
- GAME_TEXT cur_lev[4]; /* Current Player Level (number) */
- GAME_TEXT cur_dun[4]; /* Current Dungeon Level (number) */
- GAME_TEXT max_lev[4]; /* Max Player Level (number) */
- GAME_TEXT max_dun[4]; /* Max Dungeon Level (number) */
-
- GAME_TEXT how[40]; /* Method of death (string) */
-};
-
-
typedef struct
{
FEAT_IDX feat; /* Feature tile */
feat_prob;
-/* A structure for the != dungeon types */
-typedef struct dungeon_type dungeon_type;
-struct dungeon_type {
-
- STR_OFFSET name; /* Name */
- STR_OFFSET text; /* Description */
-
- POSITION dy;
- POSITION dx;
-
- feat_prob floor[DUNGEON_FEAT_PROB_NUM]; /* Floor probability */
- feat_prob fill[DUNGEON_FEAT_PROB_NUM]; /* Cave wall probability */
- FEAT_IDX outer_wall; /* Outer wall tile */
- FEAT_IDX inner_wall; /* Inner wall tile */
- FEAT_IDX stream1; /* stream tile */
- FEAT_IDX stream2; /* stream tile */
-
- DEPTH mindepth; /* Minimal depth */
- DEPTH maxdepth; /* Maximal depth */
- PLAYER_LEVEL min_plev; /* Minimal plev needed to enter -- it's an anti-cheating mesure */
- BIT_FLAGS16 pit;
- BIT_FLAGS16 nest;
- BIT_FLAGS8 mode; /* Mode of combinaison of the monster flags */
-
- int min_m_alloc_level; /* Minimal number of monsters per level */
- int max_m_alloc_chance; /* There is a 1/max_m_alloc_chance chance per round of creating a new monster */
-
- BIT_FLAGS flags1; /* Flags 1 */
-
- BIT_FLAGS mflags1; /* The monster flags that are allowed */
- BIT_FLAGS mflags2;
- BIT_FLAGS mflags3;
- BIT_FLAGS mflags4;
- BIT_FLAGS mflags7;
- BIT_FLAGS mflags8;
- BIT_FLAGS mflags9;
- BIT_FLAGS mflagsr;
-
- BIT_FLAGS m_a_ability_flags1;
- BIT_FLAGS m_a_ability_flags2;
- BIT_FLAGS m_a_ability_flags3;
- BIT_FLAGS m_a_ability_flags4;
-
- char r_char[5]; /* Monster race allowed */
- KIND_OBJECT_IDX final_object; /* The object you'll find at the bottom */
- ARTIFACT_IDX final_artifact; /* The artifact you'll find at the bottom */
- MONRACE_IDX final_guardian; /* The artifact's guardian. If an artifact is specified, then it's NEEDED */
-
- PROB special_div; /* % of monsters affected by the flags/races allowed, to add some variety */
- int tunnel_percent;
- int obj_great;
- int obj_good;
-};
-
-
/*!
* @struct autopick_type
* @brief 自動拾い/破壊設定データの構造体 / A structure type for entry of auto-picker/destroyer
/*
- * A structure type for the saved floor
- */
-typedef struct
-{
- FLOOR_IDX floor_id; /* No recycle until 65536 IDs are all used */
- s16b savefile_id; /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */
- DEPTH dun_level;
- s32b last_visit; /* Time count of last visit. 0 for new floor. */
- u32b visit_mark; /* Older has always smaller mark. */
- FLOOR_IDX upper_floor_id; /* a floor connected with level teleportation */
- FLOOR_IDX lower_floor_id; /* a floor connected with level tel. and trap door */
-} saved_floor_type;
-
-
-/*
* A structure type for terrain template of saving dungeon floor
*/
typedef struct
} cave_template_type;
-/*!
- * @struct arena_type
- * @brief 闘技場のモンスターエントリー構造体 / A structure type for arena entry
- */
-typedef struct
-{
- MONRACE_IDX r_idx; /*!< 闘技場のモンスター種族ID(0ならば表彰式) / Monster (0 means victory prizing) */
- OBJECT_TYPE_VALUE tval; /*!< モンスター打倒後に得られるアイテムの大カテゴリID / tval of prize (0 means no prize) */
- OBJECT_SUBTYPE_VALUE sval; /*!< モンスター打倒後に得られるアイテムの小カテゴリID / sval of prize */
-} arena_type;
-
-
-
-
#ifdef TRAVEL
/*
* A structure type for travel command
#endif
typedef struct {
- concptr flag;
- byte index;
- byte level;
- s32b value;
- struct {
- int constant;
- DICE_NUMBER dice;
- } timeout;
- concptr desc;
-} activation_type;
-
-typedef struct {
int flag;
int type;
concptr name;
} dragonbreath_type;
-
-typedef struct {
- grid_type *grid_array[MAX_HGT];
- DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
- DEPTH base_level; /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
- DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
- DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
- POSITION width; /* Current dungeon width */
- POSITION height; /* Current dungeon height */
- MONSTER_NUMBER num_repro; /*!< Current reproducer count */
-
- object_type *o_list; /*!< The array of dungeon items [current_floor_ptr->max_o_idx] */
- OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
-
- monster_type *m_list; /*!< The array of dungeon monsters [current_floor_ptr->max_m_idx] */
- MONSTER_IDX max_m_idx; /*!< Maximum number of monsters in the level */
-
- s16b *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
- s16b mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
-
- POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
- POSITION lite_y[LITE_MAX];
- POSITION lite_x[LITE_MAX];
-
- POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
- POSITION mon_lite_y[MON_LITE_MAX];
- POSITION mon_lite_x[MON_LITE_MAX];
-
- POSITION_IDX view_n; //!< Array of grids viewable to the player (see "grid_array")
- POSITION view_y[VIEW_MAX];
- POSITION view_x[VIEW_MAX];
-
- POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating (see "current_floor_ptr->grid_array.c")
- POSITION redraw_y[REDRAW_MAX];
- POSITION redraw_x[REDRAW_MAX];
-
-} floor_type;
-
-typedef struct {
- /*
- * Maximum size of the wilderness
- */
- POSITION max_wild_x;
- POSITION max_wild_y;
- GAME_TURN game_turn; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
- GAME_TURN game_turn_limit; /*!< game_turnの最大値 / Limit of game_turn */
- GAME_TURN dungeon_turn; /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
- GAME_TURN dungeon_turn_limit; /*!< dungeon_turnの最大値 / Limit of game_turn in dungeon */
-
-} world_type;