X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Ftypes.h;h=24eeab2341ab4f7ed873da3d69fe5cb7105f7efc;hb=68872c332294a5d3fd8c89b8c1814023059380c2;hp=4085ae0c363be50c8fbc14899143dd3a618cf2a9;hpb=474b189da7c5db33313853912f3e9155f7f3f2de;p=hengband%2Fhengband.git diff --git a/src/types.h b/src/types.h index 4085ae0c3..24eeab234 100644 --- a/src/types.h +++ b/src/types.h @@ -1,21 +1,19 @@ -/* File: types.h */ - -/* +/*! + * @file types.h + * @brief ã°ãã¼ãã«ãªæ§é ä½ã®å®ç¾© / global type declarations + * @date 2014/08/10 + * @author + *
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke - * * This software may be copied and distributed for educational, research, * and not for profit purposes provided that this copyright and statement * are included in all such copies. Other copyrights may also apply. - */ - -/* Purpose: global type declarations */ - - -/* + *+ * @details + *
+ * ãã®ãã¡ã¤ã«ã¯angband.hã§ã®ã¿ã¤ã³ã¯ã«ã¼ããããã¨ã * This file should ONLY be included by "angband.h" - */ - -/* + * * Note that "char" may or may not be signed, and that "signed char" * may or may not work on all machines. So always use "s16b" or "s32b" * for signed values. Also, note that unsigned values cause math problems @@ -42,61 +40,61 @@ * in "header_type", and the "m_idx" and "o_idx" fields in "cave_type". All * of these could be removed, but this would, in general, slow down the game * and increase the complexity of the code. + **/ - - - -/* - * Feature state structure - * - * - Action (FF_*) - * - Result (FEAT_*) +/*! + * @struct feature_state + * @brief å°å½¢ç¶æ å¤åæå®æ§é ä½ / Feature state structure */ typedef struct feature_state feature_state; struct feature_state { - byte action; - s16b result; + byte action; /*!< å¤åæ¡ä»¶ãFF_*ã®IDã§æå® / Action (FF_*) */ + s16b result; /*!< å¤åå ID / Result (f_info ID) */ }; -/* - * Information about terrain "features" +/*! + * @struct feature_type + * @brief å°å½¢æ å ±ã®æ§é ä½ / Information about terrain "features" */ typedef struct feature_type feature_type; struct feature_type { - u32b name; /* Name (offset) */ - u32b text; /* Text (offset) */ - s16b tag; /* Tag (offset) */ + STR_OFFSET name; /*!< å°å½¢ååç §ã®ããã®ãã¼ã ãããã¡ãªãã»ããå¤ / Name (offset) */ + STR_OFFSET text; /*!< å°å½¢èª¬æåç §ã®ããã®ãã¼ã ãããã¡ãªãã»ããå¤ / Text (offset) */ + STR_OFFSET tag; /*!< å°å½¢ç¹æ§ã¿ã°åç §ã®ããã®ãã¼ã ãããã¡ãªãã»ããå¤ / Tag (offset) */ - s16b mimic; /* Feature to mimic */ + IDX mimic; /*!< æªç¢ºå®æã®å¤å½¢å°å½¢ID / Feature to mimic */ - u32b flags[FF_FLAG_SIZE]; /* Flags */ + BIT_FLAGS flags[FF_FLAG_SIZE]; /*!< å°å½¢ã®åºæ¬ç¹æ§ãããé å / Flags */ - u16b priority; /* Map priority */ - s16b destroyed; /* Default destroyed state */ + u16b priority; /*!< 縮å°è¡¨ç¤ºã§çç¥ããéã®è¡¨ç¤ºåªå 度 / Map priority */ + IDX destroyed; /*!< *ç ´å£*ã«å·»ãè¾¼ã¾ããæã®å°å½¢ç§»è¡å (æªå®è£ ï¼) / Default destroyed state */ - feature_state state[MAX_FEAT_STATES]; + feature_state state[MAX_FEAT_STATES]; /*!< feature_state ãã¼ãã« */ - byte power; + byte subtype; /*!< å¯ç¹æ§å¤ */ + byte power; /*!< å°å½¢å¼·åº¦ */ - byte d_attr[F_LIT_MAX]; /* Default feature attribute */ - byte d_char[F_LIT_MAX]; /* Default feature character */ + SYMBOL_COLOR d_attr[F_LIT_MAX]; /*!< ããã©ã«ãã®å°å½¢ã·ã³ãã«ã«ã©ã¼ / Default feature attribute */ + SYMBOL_CODE d_char[F_LIT_MAX]; /*!< ããã©ã«ãã®å°å½¢ã·ã³ãã«ã¢ã«ãã¡ããã / Default feature character */ - byte x_attr[F_LIT_MAX]; /* Desired feature attribute */ - byte x_char[F_LIT_MAX]; /* Desired feature character */ + SYMBOL_COLOR x_attr[F_LIT_MAX]; /*!< è¨å®å¤æ´å¾ã®å°å½¢ã·ã³ãã«ã«ã©ã¼ / Desired feature attribute */ + SYMBOL_CODE x_char[F_LIT_MAX]; /*!< è¨å®å¤æ´å¾ã®å°å½¢ã·ã³ãã«ã¢ã«ãã¡ããã / Desired feature character */ }; -/* - * Information about object "kinds", including player knowledge. - * +/*! + * @struct object_kind + * @brief ãã¼ã¹ã¢ã¤ãã æ å ±ã®æ§é ä½ / Information about object "kinds", including player knowledge. + * @details + * ã²ã¼ã é²è¡ç¨ã®ã»ã¼ããã¡ã¤ã«ä¸ã§ã¯ aware 㨠tried ã®ã¿ä¿å対象ã¨ãããã¨ãã¨è±æã§ã¯ãããå®éã¯ãã£ã¨ããæ§åã§ããã / * Only "aware" and "tried" are saved in the savefile */ @@ -104,101 +102,103 @@ typedef struct object_kind object_kind; struct object_kind { - u32b name; /* Name (offset) */ - u32b text; /* Text (offset) */ - u32b flavor_name; /* Flavor name (offset) */ - - byte tval; /* Object type */ - byte sval; /* Object sub type */ - - s16b pval; /* Object extra info */ - - s16b to_h; /* Bonus to hit */ - s16b to_d; /* Bonus to damage */ - s16b to_a; /* Bonus to armor */ + STR_OFFSET name; /*!< ãã¼ã¹ã¢ã¤ãã ååç §ã®ããã®ãã¼ã ãããã¡ãªãã»ããå¤ / Name (offset) */ + STR_OFFSET text; /*!< 解説ããã¹ãåç §ã®ããã®ãã¼ã ãããã¡ãªãã»ããå¤ / Text (offset) */ + STR_OFFSET flavor_name; /*!< æªç¢ºå®ååç §ã®ããã®ãã¼ã ãããã¡ãªãã»ããå¤ / Flavor name (offset) */ - s16b ac; /* Base armor */ + OBJECT_TYPE_VALUE tval; /*!< ãã¼ã¹ã¢ã¤ãã 種å¥ã®å¤§é ç®å¤ Object type */ + OBJECT_SUBTYPE_VALUE sval; /*!< ãã¼ã¹ã¢ã¤ãã 種å¥ã®å°é ç®å¤ Object sub type */ - byte dd, ds; /* Damage dice/sides */ + PARAMETER_VALUE pval; /*!< ãã¼ã¹ã¢ã¤ãã ã®pvalï¼è½åä¿®æ£å ±éå¤ï¼ Object extra info */ - s16b weight; /* Weight */ + HIT_PROB to_h; /*!< ãã¼ã¹ã¢ã¤ãã ã®å½ä¸ä¿®æ£å¤ / Bonus to hit */ + HIT_POINT to_d; /*!< ãã¼ã¹ã¢ã¤ãã ã®ãã¡ã¼ã¸ä¿®æ£å¤ / Bonus to damage */ + ARMOUR_CLASS to_a; /*!< ãã¼ã¹ã¢ã¤ãã ã®ACä¿®æ£å¤ / Bonus to armor */ - s32b cost; /* Object "base cost" */ + ARMOUR_CLASS ac; /*!< ãã¼ã¹ã¢ã¤ãã ã®ACåºæ¬å¤ / Base armor */ - u32b flags[TR_FLAG_SIZE]; /* Flags */ + DICE_NUMBER dd; + DICE_SID ds; /*!< ãã¡ã¼ã¸ãã¤ã¹ã®æ°ã¨å¤§ãã / Damage dice/sides */ - u32b gen_flags; /* flags for generate */ + WEIGHT weight; /*!< ãã¼ã¹ã¢ã¤ãã ã®éé / Weight */ - byte locale[4]; /* Allocation level(s) */ - byte chance[4]; /* Allocation chance(s) */ + PRICE cost; /*!< ãã¼ã¹ã¢ã¤ãã ã®åºæ¬ä¾¡å¤ / Object "base cost" */ - byte level; /* Level */ - byte extra; /* Something */ + BIT_FLAGS flags[TR_FLAG_SIZE]; /*!< ãã¼ã¹ã¢ã¤ãã ã®åºæ¬ç¹æ§ãããé å / Flags */ + BIT_FLAGS gen_flags; /*!< ãã¼ã¹ã¢ã¤ãã ã®çæç¹æ§ãããé å / flags for generate */ - byte d_attr; /* Default object attribute */ - byte d_char; /* Default object character */ + DEPTH locale[4]; /*!< ãã¼ã¹ã¢ã¤ãã ã®çæéãã¼ãã« / Allocation level(s) */ + byte chance[4]; /*!< ãã¼ã¹ã¢ã¤ãã ã®çæ確çãã¼ãã« / Allocation chance(s) */ + DEPTH level; /*!< ãã¼ã¹ã¢ã¤ãã ã®åºæ¬çæé / Level */ + byte extra; /*!< ãã®ä»è²ã ã®ããããã©ã°é å / Something */ - byte x_attr; /* Desired object attribute */ - byte x_char; /* Desired object character */ + SYMBOL_COLOR d_attr; /*!< ããã©ã«ãã®ã¢ã¤ãã ã·ã³ãã«ã«ã©ã¼ / Default object attribute */ + SYMBOL_CODE d_char; /*!< ããã©ã«ãã®ã¢ã¤ãã ã·ã³ãã«ã¢ã«ãã¡ããã / Default object character */ + SYMBOL_COLOR x_attr; /*!< è¨å®å¤æ´å¾ã®ã¢ã¤ãã ã·ã³ãã«ã«ã©ã¼ / Desired object attribute */ + SYMBOL_CODE x_char; /*!< è¨å®å¤æ´å¾ã®ã¢ã¤ãã ã·ã³ãã«ã¢ã«ãã¡ããã / Desired object character */ - s16b flavor; /* Special object flavor (or zero) */ + s16b flavor; /*!< 調æ»ä¸(TODO) / Special object flavor (or zero) */ - bool easy_know; /* This object is always known (if aware) */ + bool easy_know; /*!< ãã¼ã¹ã¢ã¤ãã ãåæãããã¼ã¹åãå¤æå¯è½ãã©ãã / This object is always known (if aware) */ + bool aware; /*!< ãã¼ã¹ã¢ã¤ãã ãéå®æ¸ãã©ãã / The player is "aware" of the item's effects */ - bool aware; /* The player is "aware" of the item's effects */ + bool tried; /*!< ãã¼ã¹ã¢ã¤ãã ãæªéå®ã®ã¾ã¾è©¦ãããã¨ãããã / The player has "tried" one of the items */ - bool tried; /* The player has "tried" one of the items */ + IDX act_idx; /*!< çºåè½åã®ID / Activative ability index */ }; -/* - * Information about "artifacts". - * - * Note that the save-file only writes "cur_num" to the savefile. - * - * Note that "max_num" is always "1" (if that artifact "exists") - */ - 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 { - u32b name; /* Name (offset) */ - u32b text; /* Text (offset) */ + STR_OFFSET name; /*!< ã¢ã¼ãã£ãã¡ã¯ãå(headerãªãã»ããåç §) / Name (offset) */ + STR_OFFSET text; /*!< ã¢ã¼ãã£ãã¡ã¯ã解説(headerãªãã»ããåç §) / Text (offset) */ - byte tval; /* Artifact type */ - byte sval; /* Artifact sub type */ + OBJECT_TYPE_VALUE tval; /*!< ãã¼ã¹ã¢ã¤ãã 大é ç®ID / Artifact type */ + OBJECT_SUBTYPE_VALUE sval; /*!< ãã¼ã¹ã¢ã¤ãã å°é ç®ID / Artifact sub type */ - s16b pval; /* Artifact extra info */ + PARAMETER_VALUE pval; /*!< pvalä¿®æ£å¤ / Artifact extra info */ - s16b to_h; /* Bonus to hit */ - s16b to_d; /* Bonus to damage */ - s16b to_a; /* Bonus to armor */ + HIT_PROB to_h; /*!< å½ä¸ãã¼ãã¹å¤ / Bonus to hit */ + HIT_POINT to_d; /*!< ãã¡ã¼ã¸ãã¼ãã¹å¤ / Bonus to damage */ + ARMOUR_CLASS to_a; /*!< ACãã¼ãã¹å¤ / Bonus to armor */ - s16b ac; /* Base armor */ + ARMOUR_CLASS ac; /*!< ä¸æ¸ããã¼ã¹ACå¤ / Base armor */ - byte dd, ds; /* Damage when hits */ + DICE_NUMBER dd; + DICE_SID ds; /*!< ãã¤ã¹å¤ / Damage when hits */ - s16b weight; /* Weight */ + WEIGHT weight; /*!< éé / Weight */ - s32b cost; /* Artifact "cost" */ + PRICE cost; /*!< åºæ¬ä¾¡æ ¼ / Artifact "cost" */ - u32b flags[TR_FLAG_SIZE]; /* Artifact Flags */ + BIT_FLAGS flags[TR_FLAG_SIZE]; /*! ã¢ã¤ãã ãã©ã° / Artifact Flags */ - u32b gen_flags; /* flags for generate */ + BIT_FLAGS gen_flags; /*! ã¢ã¤ãã çæãã©ã° / flags for generate */ - byte level; /* Artifact level */ - byte rarity; /* Artifact rarity */ + DEPTH level; /*! åºæ¬çæé / Artifact level */ + RARITY rarity; /*! ã¬ã¢ãªã㣠/ Artifact rarity */ - byte cur_num; /* Number created (0 or 1) */ - byte max_num; /* Unused (should be "1") */ + byte cur_num; /*! ç¾å¨ã®çææ° / Number created (0 or 1) */ + byte max_num; /*! (æªä½¿ç¨)æ大çææ° / Unused (should be "1") */ - s16b floor_id; /* Leaved on this location last time */ + s16b floor_id; /*! ã¢ã¤ãã ãè½ã¨ããããã¢ã®ID / Leaved on this location last time */ + + byte act_idx; /*! çºåè½åID / Activative ability index */ }; @@ -210,26 +210,27 @@ typedef struct ego_item_type ego_item_type; struct ego_item_type { - u32b name; /* Name (offset) */ - u32b text; /* Text (offset) */ + STR_OFFSET name; /* Name (offset) */ + STR_OFFSET text; /* Text (offset) */ byte slot; /* Standard slot value */ byte rating; /* Rating boost */ - byte level; /* Minimum level */ - byte rarity; /* Object rarity */ + DEPTH level; /* Minimum level */ + RARITY rarity; /* Object rarity */ - byte max_to_h; /* Maximum to-hit bonus */ - byte max_to_d; /* Maximum to-dam bonus */ - byte max_to_a; /* Maximum to-ac bonus */ + HIT_PROB max_to_h; /* Maximum to-hit bonus */ + HIT_POINT max_to_d; /* Maximum to-dam bonus */ + ARMOUR_CLASS max_to_a; /* Maximum to-ac bonus */ - byte max_pval; /* Maximum pval */ + PARAMETER_VALUE max_pval; /* Maximum pval */ - s32b cost; /* Ego-item "cost" */ + PRICE cost; /* Ego-item "cost" */ - u32b flags[TR_FLAG_SIZE]; /* Ego-Item Flags */ + BIT_FLAGS flags[TR_FLAG_SIZE]; /* Ego-Item Flags */ + BIT_FLAGS gen_flags; /* flags for generate */ - u32b gen_flags; /* flags for generate */ + IDX act_idx; /* Activative ability index */ }; @@ -289,66 +290,79 @@ typedef struct monster_race monster_race; struct monster_race { - u32b name; /* Name (offset) */ + STR_OFFSET name; /*!< ååãã¼ã¿ã®ãªãã»ãã(æ¥æ¬èª) / Name offset(Japanese) */ #ifdef JP - u32b E_name; /* ±Ñ¸ì̾ (offset) */ + STR_OFFSET E_name; /*!< ååãã¼ã¿ã®ãªãã»ãã(è±èª) / Name offset(English) */ #endif - u32b text; /* Text (offset) */ + STR_OFFSET text; /*!< æãåºããã¹ãã®ãªãã»ãã / Lore text offset */ + + DICE_NUMBER hdice; /*!< HPã®ãã¤ã¹æ° / Creatures hit dice count */ + DICE_SID hside; /*!< HPã®ãã¤ã¹é¢æ° / Creatures hit dice sides */ - byte hdice; /* Creatures hit dice count */ - byte hside; /* Creatures hit dice sides */ + ARMOUR_CLASS ac; /*!< ã¢ã¼ãã¼ã¯ã©ã¹ / Armour Class */ - s16b ac; /* Armour Class */ + s16b sleep; /*!< ç¡ç å¤ / Inactive counter (base) */ + byte aaf; /*!< æç¥ç¯å²(1-100ã¹ã¯ã¨ã¢) / Area affect radius (1-100) */ + SPEED speed; /*!< å é(110ã§+0) / Speed (normally 110) */ - s16b sleep; /* Inactive counter (base) */ - byte aaf; /* Area affect radius (1-100) */ - byte speed; /* Speed (normally 110) */ + EXP mexp; /*!< 殺害æåºæ¬çµé¨å¤ / Exp value for kill */ - s32b mexp; /* Exp value for kill */ + s16b extra; /*!< æªä½¿ç¨ / Unused (for now) */ - s16b extra; /* Unused (for now) */ + byte freq_spell; /*!< éæ³ï¼ç¹æ®è½åä»æ§é »åº¦(1/n) / Spell frequency */ - byte freq_spell; /* 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) */ - u32b flags1; /* Flags 1 (general) */ - u32b flags2; /* Flags 2 (abilities) */ - u32b flags3; /* Flags 3 (race/resist) */ - u32b flags4; /* Flags 4 (inate/breath) */ - u32b flags5; /* Flags 5 (normal spells) */ - u32b flags6; /* Flags 6 (special spells) */ - u32b flags7; /* Flags 7 (movement related abilities) */ - u32b flags8; /* Flags 8 (wilderness info) */ - u32b flags9; /* Flags 9 (drops info) */ - u32b 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]; - s16b next_r_idx; - u32b next_exp; + ARTIFACT_IDX artifact_id[4]; /* ç¹å®ã¢ã¼ãã£ãã¡ã¯ãããããID */ + RARITY artifact_rarity[4]; /* ç¹å®ã¢ã¼ãã£ãã¡ã¯ãã¬ã¢åº¦ */ + PERCENTAGE artifact_percent[4]; /* ç¹å®ã¢ã¼ãã£ãã¡ã¯ãããããç */ - byte level; /* Level of creature */ - byte rarity; /* Rarity of creature */ + PERCENTAGE arena_ratio; /* ã¢ãªã¼ãã®è©ä¾¡ä¿®æ£å¤(%åºæº / 0=100%) / Arena */ + MONRACE_IDX next_r_idx; + EXP next_exp; - byte d_attr; /* Default monster attribute */ - byte d_char; /* Default monster character */ + DEPTH level; /* Level of creature */ + RARITY rarity; /* Rarity of creature */ - byte x_attr; /* Desired monster attribute */ - byte x_char; /* Desired monster character */ + SYMBOL_COLOR d_attr; /* Default monster attribute */ + SYMBOL_CODE d_char; /* Default monster character */ + + + SYMBOL_COLOR x_attr; /* Desired monster attribute */ + SYMBOL_CODE x_char; /* Desired monster character */ byte max_num; /* Maximum population allowed per level */ byte cur_num; /* Monster population on current level */ - s16b floor_id; /* Location of unique monster */ + s16b floor_id; /* Location of unique monster */ s16b r_sights; /* Count sightings of this monster */ s16b r_deaths; /* Count deaths from this monster */ - s16b r_pkills; /* Count monsters killed in this life */ + s16b r_pkills; /* Count visible monsters killed in this life */ + s16b r_akills; /* Count all monsters killed in this life */ s16b r_tkills; /* Count monsters killed in all lives */ byte r_wake; /* Number of times woken up (?) */ @@ -370,7 +384,7 @@ struct monster_race 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_flags7; */ /* Observed racial flags */ u32b r_flagsr; /* Observed racial resistance flags */ }; @@ -384,15 +398,13 @@ typedef struct vault_type vault_type; struct vault_type { - u32b name; /* Name (offset) */ - u32b text; /* Text (offset) */ + STR_OFFSET name; /* Name (offset) */ + STR_OFFSET text; /* Text (offset) */ byte typ; /* Vault type */ - byte rat; /* Vault rating */ - - byte hgt; /* Vault height */ - byte wid; /* Vault width */ + POSITION hgt; /* Vault height */ + POSITION wid; /* Vault width */ }; @@ -404,10 +416,10 @@ typedef struct skill_table skill_table; struct skill_table { - s16b w_start[5][64]; /* start weapon exp */ - s16b w_max[5][64]; /* max weapon exp */ - s16b s_start[10]; /* start skill */ - s16b s_max[10]; /* max skill */ + 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 */ }; @@ -443,11 +455,9 @@ struct cave_type { u16b info; /* Hack -- cave flags */ - s16b feat; /* Hack -- feature type */ - - s16b o_idx; /* Object in this grid */ - - s16b m_idx; /* Monster in this grid */ + IDX feat; /* Hack -- feature type */ + IDX o_idx; /* Object in this grid */ + MONSTER_IDX m_idx; /* Monster in this grid */ s16b special; /* Special cave info */ @@ -467,8 +477,8 @@ typedef struct coord coord; struct coord { - byte y; - byte x; + POSITION y; + POSITION x; }; @@ -505,40 +515,41 @@ typedef struct object_type object_type; struct object_type { - s16b k_idx; /* Kind index (zero if "dead") */ + IDX k_idx; /* Kind index (zero if "dead") */ - byte iy; /* Y-position on map, or zero */ - byte ix; /* X-position on map, or zero */ + POSITION iy; /* Y-position on map, or zero */ + POSITION ix; /* X-position on map, or zero */ - byte tval; /* Item type (from kind) */ - byte sval; /* Item sub-type (from kind) */ + OBJECT_TYPE_VALUE tval; /* Item type (from kind) */ + OBJECT_SUBTYPE_VALUE sval; /* Item sub-type (from kind) */ - s16b pval; /* Item extra-parameter */ + PARAMETER_VALUE pval; /* Item extra-parameter */ - byte discount; /* Discount (if any) */ + DISCOUNT_RATE discount; /* Discount (if any) */ - byte number; /* Number of items */ + ITEM_NUMBER number; /* Number of items */ - s16b weight; /* Item weight */ + WEIGHT weight; /* Item weight */ - byte name1; /* Artifact type, if any */ - byte name2; /* Ego-Item type, if any */ + IDX name1; /* Artifact type, if any */ + IDX name2; /* Ego-Item type, if any */ - byte xtra1; /* Extra info type (now unused) */ - byte xtra2; /* Extra info index */ - byte xtra3; /* Extra info */ - s16b xtra4; /* Extra info */ - s16b xtra5; /* Extra info */ + XTRA8 xtra1; /* Extra info type (now unused) */ + XTRA8 xtra2; /* Extra info activation index */ + XTRA8 xtra3; /* Extra info for weaponsmith */ + XTRA16 xtra4; /* Extra info fuel or captured monster's current HP */ + XTRA16 xtra5; /* Extra info captured monster's max HP */ - s16b to_h; /* Plusses to hit */ - s16b to_d; /* Plusses to damage */ - s16b to_a; /* Plusses to AC */ + HIT_PROB to_h; /* Plusses to hit */ + HIT_POINT to_d; /* Plusses to damage */ + ARMOUR_CLASS to_a; /* Plusses to AC */ - s16b ac; /* Normal AC */ + ARMOUR_CLASS ac; /* Normal AC */ - byte dd, ds; /* Damage dice/sides */ + DICE_NUMBER dd; + DICE_SID ds; /* Damage dice/sides */ - s16b timeout; /* Timeout Counter */ + TIME_EFFECT timeout; /* Timeout Counter */ byte ident; /* Special flags */ @@ -549,13 +560,11 @@ struct object_type byte feeling; /* Game generated inscription number (eg, pseudo-id) */ - u32b art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */ - - u32b curse_flags; /* Flags for curse */ + BIT_FLAGS art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */ + BIT_FLAGS curse_flags; /* Flags for curse */ - s16b next_o_idx; /* Next object in stack (if any) */ - - s16b held_m_idx; /* Monster holding us (if any) */ + IDX next_o_idx; /* Next object in stack (if any) */ + IDX held_m_idx; /* Monster holding us (if any) */ }; @@ -573,50 +582,42 @@ typedef struct monster_type monster_type; struct monster_type { - s16b r_idx; /* Monster race index */ - s16b ap_r_idx; /* Monster race appearance index */ + MONRACE_IDX r_idx; /* Monster race index */ + IDX ap_r_idx; /* Monster race appearance index */ byte sub_align; /* Sub-alignment for a neutral monster */ - byte fy; /* Y location on map */ - byte fx; /* X location on map */ - - s16b hp; /* Current Hit points */ - s16b maxhp; /* Max Hit points */ - s16b max_maxhp; /* Max Max Hit points */ + POSITION fy; /* Y location on map */ + POSITION fx; /* X location on map */ - s16b csleep; /* Inactive counter */ + HIT_POINT hp; /* Current Hit points */ + HIT_POINT maxhp; /* Max Hit points */ + HIT_POINT max_maxhp; /* Max Max Hit points */ + u32b dealt_damage; /* Sum of damages dealt by player */ - byte mspeed; /* Monster "speed" */ - s16b energy_need; /* Monster "energy" */ + TIME_EFFECT mtimed[MAX_MTIMED]; /* Timed status counter */ - byte fast; /* Monster is stunned */ - byte slow; /* Monster is stunned */ - byte stunned; /* Monster is stunned */ - byte confused; /* Monster is confused */ - byte monfear; /* Monster is afraid */ - byte invulner; /* Monster is temporarily invulnerable */ + SPEED mspeed; /* Monster "speed" */ + ACTION_ENERGY energy_need; /* Monster "energy" */ - byte cdis; /* Current dis from player */ + POSITION cdis; /* Current dis from player */ - byte mflag; /* Extra monster flags */ - byte mflag2; /* Extra monster flags */ + BIT_FLAGS8 mflag; /* Extra monster flags */ + BIT_FLAGS8 mflag2; /* Extra monster flags */ bool ml; /* Monster is "visible" */ - s16b hold_o_idx; /* Object being held (if any) */ + OBJECT_IDX hold_o_idx; /* Object being held (if any) */ - s16b target_y; /* Can attack !los player */ - s16b target_x; /* Can attack !los player */ + POSITION target_y; /* Can attack !los player */ + POSITION target_x; /* Can attack !los player */ - u16b nickname; /* Monster's Nickname */ + STR_OFFSET nickname; /* Monster's Nickname */ - u32b exp; + EXP exp; - u32b smart; /* Field for "smart_learn" */ + BIT_FLAGS smart; /* Field for "smart_learn" */ - s16b parent_m_idx; - - s16b mproc_idx; + MONSTER_IDX parent_m_idx; }; @@ -634,12 +635,12 @@ typedef struct alloc_entry alloc_entry; struct alloc_entry { - s16b index; /* The actual index */ + IDX index; /* The actual index */ - byte level; /* Base dungeon level */ - byte prob1; /* Probability, pass 1 */ - byte prob2; /* Probability, pass 2 */ - byte prob3; /* Probability, pass 3 */ + DEPTH level; /* Base dungeon level */ + PROB prob1; /* Probability, pass 1 */ + PROB prob2; /* Probability, pass 2 */ + PROB prob3; /* Probability, pass 3 */ u16b total; /* Unused for now */ }; @@ -680,31 +681,34 @@ struct option_type }; -/* - * Structure for the "quests" - */ typedef struct quest_type quest_type; +/*! + * @struct quest_type + * @brief ã¯ã¨ã¹ãæ å ±ã®æ§é ä½ / Structure for the "quests". + */ + struct quest_type { - s16b status; /* Is the quest taken, completed, finished? */ - - s16b type; /* The quest type */ + s16b status; /*!< ã¯ã¨ã¹ãã®é²è¡ã¹ãã¼ã¿ã¹ / Is the quest taken, completed, finished? */ - char name[60]; /* Quest name */ - s16b level; /* Dungeon level */ - s16b r_idx; /* Monster race */ + s16b type; /*!< ã¯ã¨ã¹ãã®ç¨®å¥ / The quest type */ - s16b cur_num; /* Number killed */ - s16b max_num; /* Number required */ + char name[60]; /*!< ã¯ã¨ã¹ãå / Quest name */ + DEPTH level; /*!< å¦çé層 / Dungeon level */ + MONRACE_IDX r_idx; /*!< ã¯ã¨ã¹ã対象ã®ã¢ã³ã¹ã¿ã¼ID / Monster race */ + + s16b cur_num; /*!< æç ´ããã¢ã³ã¹ã¿ã¼ã®æ° / Number killed */ + s16b max_num; /*!< æ±ããããã¢ã³ã¹ã¿ã¼ã®æç ´æ° / Number required */ - s16b k_idx; /* object index */ - s16b num_mon; /* number of monsters on level */ + IDX k_idx; /*!< ã¯ã¨ã¹ã対象ã®ã¢ã¤ãã ID / object index */ + s16b num_mon; /*!< QUEST_TYPE_KILL_NUMBERæã®ç®æ¨æç ´æ° number of monsters on level */ - byte flags; /* quest flags */ - byte dungeon; /* quest dungeon */ + byte flags; /*!< ã¯ã¨ã¹ãã«é¢ãããã©ã°ããã / quest flags */ + byte dungeon; /*!< ã¯ã¨ã¹ã対象ã®ãã³ã¸ã§ã³ID / quest dungeon */ - byte complev; /* player level (complete) */ + byte complev; /*!< ã¯ãªã¢æãã¬ã¤ã¤ã¼ã¬ãã« / player level (complete) */ + u32b comptime; /*!< ã¯ãªã¢æã²ã¼ã æé / quest clear time*/ }; @@ -717,7 +721,7 @@ struct owner_type { cptr owner_name; /* Name */ - s16b max_cost; /* Purse limit */ + s32b max_cost; /* Purse limit */ byte max_inflate; /* Inflation (max) */ byte min_inflate; /* Inflation (min) */ @@ -772,10 +776,10 @@ typedef struct magic_type magic_type; struct magic_type { - byte slevel; /* Required level (to learn) */ - byte smana; /* Required mana (to cast) */ - byte sfail; /* Minimum chance of failure */ - byte sexp; /* Encoded experience bonus */ + PLAYER_LEVEL slevel; /* Required level (to learn) */ + MANA_POINT smana; /* Required mana (to cast) */ + PERCENTAGE sfail; /* Minimum chance of failure */ + EXP sexp; /* Encoded experience bonus */ }; @@ -789,7 +793,7 @@ typedef struct player_magic player_magic; struct player_magic { - int spell_book; /* Tval of spell books (if any) */ + 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) */ @@ -814,8 +818,8 @@ struct player_sex cptr title; /* Type of sex */ cptr winner; /* Name of winner */ #ifdef JP - cptr E_title; /* ±Ñ¸ìÀÊÌ */ - cptr E_winner; /* ±Ñ¸ìÀÊÌ */ + cptr E_title; /* è±èªæ§å¥ */ + cptr E_winner; /* è±èªæ§å¥ */ #endif }; @@ -831,7 +835,7 @@ struct player_race cptr title; /* Type of race */ #ifdef JP - cptr E_title; /* ±Ñ¸ì¼ï² */ + cptr E_title; /* è±èªç¨®æ */ #endif s16b r_adj[6]; /* Racial stat bonuses */ @@ -878,7 +882,7 @@ struct player_class cptr title; /* Type of class */ #ifdef JP - cptr E_title; /* ±Ñ¸ì¿¦¶È */ + cptr E_title; /* è±èªè·æ¥ */ #endif s16b c_adj[6]; /* Class stat modifier */ @@ -913,7 +917,7 @@ struct player_seikaku cptr title; /* Type of seikaku */ #ifdef JP - cptr E_title; /* ±Ñ¸ìÀ³Ê */ + cptr E_title; /* è±èªæ§æ ¼ */ #endif s16b a_adj[6]; /* seikaku stat bonuses */ @@ -929,7 +933,7 @@ struct player_seikaku s16b a_mhp; /* Race hit-dice modifier */ - byte no; /* ¤Î */ + byte no; /* ã® */ byte sex; /* seibetu seigen */ }; @@ -953,18 +957,18 @@ typedef struct player_type player_type; struct player_type { - s16b oldpy; /* Previous player location -KMW- */ - s16b oldpx; /* Previous player location -KMW- */ - - byte psex; /* Sex index */ - byte prace; /* Race index */ - byte pclass; /* Class index */ - byte pseikaku; /* Seikaku index */ - byte realm1; /* First magic realm */ - byte realm2; /* Second magic realm */ - byte oops; /* Unused */ - - byte hitdie; /* Hit dice (sides) */ + POSITION oldpy; /* Previous player location -KMW- */ + POSITION oldpx; /* Previous player location -KMW- */ + + CHARACTER_IDX psex; /* Sex index */ + CHARACTER_IDX prace; /* Race index */ + CHARACTER_IDX pclass; /* Class index */ + CHARACTER_IDX pseikaku; /* Seikaku index */ + REALM_IDX realm1; /* First magic realm */ + REALM_IDX realm2; /* Second magic realm */ + CHARACTER_IDX oops; /* Unused */ + + DICE_SID hitdie; /* Hit dice (sides) */ u16b expfact; /* Experience factor * Note: was byte, causing overflow for Amberite * characters (such as Amberite Paladins) @@ -975,141 +979,142 @@ struct player_type s16b wt; /* Weight */ s16b sc; /* Social Class */ + PRICE au; /* Current Gold */ - s32b au; /* Current Gold */ - - s32b max_max_exp; /* Max max experience (only to calculate score) */ - s32b max_exp; /* Max experience */ - s32b exp; /* Cur experience */ + EXP max_max_exp; /* Max max experience (only to calculate score) */ + EXP max_exp; /* Max experience */ + EXP exp; /* Cur experience */ u32b exp_frac; /* Cur exp frac (times 2^16) */ - s16b lev; /* Level */ + PLAYER_LEVEL lev; /* Level */ s16b town_num; /* Current town number */ s16b arena_number; /* monster number in arena -KMW- */ bool inside_arena; /* Is character inside arena? */ - s16b inside_quest; /* Inside quest level */ + QUEST_IDX inside_quest; /* Inside quest level */ bool inside_battle; /* Is character inside tougijou? */ - s32b wilderness_x; /* Coordinates in the wilderness */ - s32b wilderness_y; + POSITION wilderness_x; /* Coordinates in the wilderness */ + POSITION wilderness_y; bool wild_mode; - s32b mhp; /* Max hit pts */ - s32b chp; /* Cur hit pts */ + HIT_POINT mhp; /* Max hit pts */ + HIT_POINT chp; /* Cur hit pts */ u32b chp_frac; /* Cur hit frac (times 2^16) */ - s32b msp; /* Max mana pts */ - s32b csp; /* Cur mana pts */ + MANA_POINT msp; /* Max mana pts */ + MANA_POINT csp; /* Cur mana pts */ u32b csp_frac; /* Cur mana frac (times 2^16) */ s16b max_plv; /* Max Player Level */ - s16b stat_max[6]; /* Current "maximal" stat values */ - s16b stat_max_max[6]; /* Maximal "maximal" stat values */ - s16b stat_cur[6]; /* Current "natural" stat values */ + BASE_STATUS stat_max[6]; /* Current "maximal" stat values */ + BASE_STATUS stat_max_max[6]; /* Maximal "maximal" stat values */ + BASE_STATUS stat_cur[6]; /* Current "natural" stat values */ s16b learned_spells; s16b add_spells; u32b count; - s16b fast; /* Timed -- Fast */ - s16b slow; /* Timed -- Slow */ - s16b blind; /* Timed -- Blindness */ - s16b paralyzed; /* Timed -- Paralysis */ - s16b confused; /* Timed -- Confusion */ - s16b afraid; /* Timed -- Fear */ - s16b image; /* Timed -- Hallucination */ - s16b poisoned; /* Timed -- Poisoned */ - s16b cut; /* Timed -- Cut */ - s16b stun; /* Timed -- Stun */ - - s16b protevil; /* Timed -- Protection */ - s16b invuln; /* Timed -- Invulnerable */ - s16b ult_res; /* Timed -- Ultimate Resistance */ - s16b hero; /* Timed -- Heroism */ - s16b shero; /* Timed -- Super Heroism */ - s16b shield; /* Timed -- Shield Spell */ - s16b blessed; /* Timed -- Blessed */ - s16b tim_invis; /* Timed -- See Invisible */ - s16b tim_infra; /* Timed -- Infra Vision */ - s16b tsuyoshi; /* Timed -- Tsuyoshi Special */ - s16b ele_attack; /* Timed -- Elemental Attack */ - s16b ele_immune; /* Timed -- Elemental Immune */ - - s16b oppose_acid; /* Timed -- oppose acid */ - s16b oppose_elec; /* Timed -- oppose lightning */ - s16b oppose_fire; /* Timed -- oppose heat */ - s16b oppose_cold; /* Timed -- oppose cold */ - s16b oppose_pois; /* Timed -- oppose poison */ - - - s16b tim_esp; /* Timed ESP */ - s16b wraith_form; /* Timed wraithform */ - - s16b resist_magic; /* Timed Resist Magic (later) */ - s16b tim_regen; - s16b kabenuke; - s16b tim_stealth; - s16b tim_levitation; - s16b tim_sh_touki; - s16b lightspeed; - s16b tsubureru; - s16b magicdef; - s16b tim_res_nether; /* Timed -- Nether resistance */ - s16b tim_res_time; /* Timed -- Time resistance */ - byte mimic_form; - s16b tim_mimic; - s16b tim_sh_fire; - s16b tim_sh_holy; - s16b tim_eyeeye; + TIME_EFFECT fast; /* Timed -- Fast */ + TIME_EFFECT slow; /* Timed -- Slow */ + TIME_EFFECT blind; /* Timed -- Blindness */ + TIME_EFFECT paralyzed; /* Timed -- Paralysis */ + TIME_EFFECT confused; /* Timed -- Confusion */ + TIME_EFFECT afraid; /* Timed -- Fear */ + TIME_EFFECT image; /* Timed -- Hallucination */ + TIME_EFFECT poisoned; /* Timed -- Poisoned */ + TIME_EFFECT cut; /* Timed -- Cut */ + TIME_EFFECT stun; /* Timed -- Stun */ + + TIME_EFFECT protevil; /* Timed -- Protection */ + TIME_EFFECT invuln; /* Timed -- Invulnerable */ + TIME_EFFECT ult_res; /* Timed -- Ultimate Resistance */ + TIME_EFFECT hero; /* Timed -- Heroism */ + TIME_EFFECT shero; /* Timed -- Super Heroism */ + TIME_EFFECT shield; /* Timed -- Shield Spell */ + TIME_EFFECT blessed; /* Timed -- Blessed */ + TIME_EFFECT tim_invis; /* Timed -- See Invisible */ + TIME_EFFECT tim_infra; /* Timed -- Infra Vision */ + TIME_EFFECT tsuyoshi; /* Timed -- Tsuyoshi Special */ + TIME_EFFECT ele_attack; /* Timed -- Elemental Attack */ + TIME_EFFECT ele_immune; /* Timed -- Elemental Immune */ + + TIME_EFFECT oppose_acid; /* Timed -- oppose acid */ + TIME_EFFECT oppose_elec; /* Timed -- oppose lightning */ + TIME_EFFECT oppose_fire; /* Timed -- oppose heat */ + TIME_EFFECT oppose_cold; /* Timed -- oppose cold */ + TIME_EFFECT oppose_pois; /* Timed -- oppose poison */ + + TIME_EFFECT tim_esp; /* Timed ESP */ + TIME_EFFECT wraith_form; /* Timed wraithform */ + + TIME_EFFECT resist_magic; /* Timed Resist Magic (later) */ + TIME_EFFECT tim_regen; + TIME_EFFECT kabenuke; + TIME_EFFECT tim_stealth; + TIME_EFFECT tim_levitation; + TIME_EFFECT tim_sh_touki; + TIME_EFFECT lightspeed; + TIME_EFFECT tsubureru; + TIME_EFFECT magicdef; + TIME_EFFECT tim_res_nether; /* Timed -- Nether resistance */ + TIME_EFFECT tim_res_time; /* Timed -- Time resistance */ + IDX mimic_form; + TIME_EFFECT tim_mimic; + TIME_EFFECT tim_sh_fire; + TIME_EFFECT tim_sh_holy; + TIME_EFFECT tim_eyeeye; /* for mirror master */ - s16b tim_reflect; /* Timed -- Reflect */ - s16b multishadow; /* Timed -- Multi-shadow */ - s16b dustrobe; /* Timed -- Robe of dust */ + TIME_EFFECT tim_reflect; /* Timed -- Reflect */ + TIME_EFFECT multishadow; /* Timed -- Multi-shadow */ + TIME_EFFECT dustrobe; /* Timed -- Robe of dust */ s16b chaos_patron; - u32b muta1; - u32b muta2; - u32b muta3; + BIT_FLAGS muta1; + BIT_FLAGS muta2; + BIT_FLAGS muta3; s16b virtues[8]; s16b vir_types[8]; - s16b word_recall; /* Word of recall counter */ - s16b alter_reality; /* Alter reality counter */ - byte recall_dungeon; /* Dungeon set to be recalled */ + TIME_EFFECT word_recall; /* Word of recall counter */ + TIME_EFFECT alter_reality; /* Alter reality counter */ + DUNGEON_IDX recall_dungeon; /* Dungeon set to be recalled */ - s16b energy_need; /* Energy needed for next move */ + ENERGY energy_need; /* Energy needed for next move */ + ENERGY enchant_energy_need; /* Energy needed for next upkeep effect */ - s16b food; /* Current nutrition */ + FEED food; /* Current nutrition */ - u32b special_attack; /* Special attack capacity -LM- */ - u32b special_defense; /* Special block capacity -LM- */ + BIT_FLAGS special_attack; /* Special attack capacity -LM- */ + BIT_FLAGS special_defense; /* Special block capacity -LM- */ byte action; /* Currently action */ - u32b spell_learned1; /* bit mask of spells learned */ - u32b spell_learned2; /* bit mask of spells learned */ - u32b spell_worked1; /* bit mask of spells tried and worked */ - u32b spell_worked2; /* bit mask of spells tried and worked */ - u32b spell_forgotten1; /* bit mask of spells learned but forgotten */ - u32b spell_forgotten2; /* bit mask of spells learned but forgotten */ - byte spell_order[64]; /* order spells learned/remembered/forgotten */ + BIT_FLAGS spell_learned1; /* bit mask of spells learned */ + BIT_FLAGS spell_learned2; /* bit mask of spells learned */ + BIT_FLAGS spell_worked1; /* bit mask of spells tried and worked */ + BIT_FLAGS spell_worked2; /* bit mask of spells tried and worked */ + BIT_FLAGS spell_forgotten1; /* bit mask of spells learned but forgotten */ + BIT_FLAGS spell_forgotten2; /* bit mask of spells learned but forgotten */ + SPELL_IDX spell_order[64]; /* order spells learned/remembered/forgotten */ - s16b spell_exp[64]; /* Proficiency of spells */ - s16b weapon_exp[5][64]; /* Proficiency of weapons */ - s16b skill_exp[10]; /* Proficiency of misc. skill */ + SUB_EXP spell_exp[64]; /* Proficiency of spells */ + SUB_EXP weapon_exp[5][64]; /* Proficiency of weapons */ + SUB_EXP skill_exp[GINOU_MAX]; /* Proficiency of misc. skill */ - s32b magic_num1[108]; /* Array for non-spellbook type magic */ - byte magic_num2[108]; /* Flags for non-spellbook type magics */ + MAGIC_NUM1 magic_num1[108]; /*!< Array for non-spellbook type magic */ + MAGIC_NUM2 magic_num2[108]; /*!< Flags for non-spellbook type magics */ - s16b mane_spell[MAX_MANE]; - s16b mane_dam[MAX_MANE]; + SPELL_IDX mane_spell[MAX_MANE]; + HIT_POINT mane_dam[MAX_MANE]; s16b mane_num; - s16b player_hp[PY_MAX_LEVEL]; + s16b concent; /* Sniper's concentration level */ + + HIT_POINT player_hp[PY_MAX_LEVEL]; char died_from[80]; /* What killed the player */ cptr last_message; /* Last message on death or retirement */ char history[4][60]; /* Textual "history" for the Player */ @@ -1124,13 +1129,13 @@ struct player_type bool wizard; /* Player is in wizard mode */ - s16b riding; /* Riding on a monster of this index */ + MONSTER_IDX riding; /* Riding on a monster of this index */ byte knowledge; /* Knowledge about yourself */ - s32b visit; /* Visited towns */ + BIT_FLAGS visit; /* Visited towns */ byte start_race; /* Race at birth */ - s32b old_race1; /* Record of race changes */ - s32b old_race2; /* Record of race changes */ + BIT_FLAGS old_race1; /* Record of race changes */ + BIT_FLAGS old_race2; /* Record of race changes */ s16b old_realm; /* Record of realm changes */ s16b pet_follow_distance; /* Length of the imaginary "leash" for pets */ @@ -1158,11 +1163,11 @@ struct player_type bool teleport_town; bool enter_dungeon; /* Just enter the dungeon */ - s16b health_who; /* Health bar trackee */ + IDX health_who; /* Health bar trackee */ - s16b monster_race_idx; /* Monster race trackee */ + IDX monster_race_idx; /* Monster race trackee */ - s16b object_kind_idx; /* Object kind trackee */ + IDX object_kind_idx; /* Object kind trackee */ s16b new_spells; /* Number of spells available */ s16b old_spells; @@ -1204,8 +1209,8 @@ struct player_type bool counter; s32b align; /* Good/evil/neutral */ - s16b run_py; - s16b run_px; + POSITION run_py; + POSITION run_px; /*** Extracted fields ***/ @@ -1262,7 +1267,7 @@ struct player_type bool free_act; /* Never paralyzed */ bool see_inv; /* Can see invisible */ bool regenerate; /* Regenerate hit pts */ - bool hold_life; /* Resist life draining */ + bool hold_exp; /* Resist exp draining */ bool telepathy; /* Telepathy */ bool esp_animal; @@ -1338,6 +1343,12 @@ struct player_type byte tval_ammo; /* Correct ammo tval */ byte pspeed; /* Current speed */ + + s16b energy_use; /* Energy use this turn */ + + POSITION y; /* Player location in dungeon */ + POSITION x; /* Player location in dungeon */ + char name[32]; /* Current player's character name */ }; @@ -1352,8 +1363,8 @@ struct birther byte prace; /* Race index */ byte pclass; /* Class index */ byte pseikaku; /* Seikaku index */ - byte realm1; /* First magic realm */ - byte realm2; /* Second magic realm */ + REALM_IDX realm1; /* First magic realm */ + REALM_IDX realm2; /* Second magic realm */ s16b age; s16b ht; @@ -1362,9 +1373,9 @@ struct birther s32b au; - s16b stat_max[6]; /* Current "maximal" stat values */ - s16b stat_max_max[6]; /* Maximal "maximal" stat values */ - s16b player_hp[PY_MAX_LEVEL]; + BASE_STATUS stat_max[6]; /* Current "maximal" stat values */ + BASE_STATUS stat_max_max[6]; /* Maximal "maximal" stat values */ + HIT_POINT player_hp[PY_MAX_LEVEL]; s16b chaos_patron; @@ -1517,10 +1528,10 @@ typedef struct tag_type tag_type; struct tag_type { int tag; - void *pointer; + int index; }; -typedef bool (*monster_hook_type)(int r_idx); +typedef bool (*monster_hook_type)(MONRACE_IDX r_idx); /* @@ -1574,8 +1585,8 @@ struct high_score typedef struct { - s16b feat; /* Feature tile */ - byte percent; /* Chance of type */ + FEAT_IDX feat; /* Feature tile */ + PERCENTAGE percent; /* Chance of type */ } feat_prob; @@ -1583,11 +1594,11 @@ feat_prob; /* A structure for the != dungeon types */ typedef struct dungeon_info_type dungeon_info_type; struct dungeon_info_type { - u32b name; /* Name */ - u32b text; /* Description */ + STR_OFFSET name; /* Name */ + STR_OFFSET text; /* Description */ - byte dy; - byte dx; + POSITION dy; + POSITION dx; feat_prob floor[DUNGEON_FEAT_PROB_NUM]; /* Floor probability */ feat_prob fill[DUNGEON_FEAT_PROB_NUM]; /* Cave wall probability */ @@ -1612,13 +1623,16 @@ struct dungeon_info_type { u32b mflags2; u32b mflags3; u32b mflags4; - u32b mflags5; - u32b mflags6; u32b mflags7; u32b mflags8; u32b mflags9; u32b mflagsr; + u32b m_a_ability_flags1; + u32b m_a_ability_flags2; + u32b m_a_ability_flags3; + u32b m_a_ability_flags4; + char r_char[5]; /* Monster race allowed */ int final_object; /* The object you'll find at the bottom */ int final_artifact; /* The artifact you'll find at the bottom */ @@ -1631,16 +1645,17 @@ struct dungeon_info_type { }; -/* - * A structure type for entry of auto-picker/destroyer +/*! + * @struct autopick_type + * @brief èªåæ¾ã/ç ´å£è¨å®ãã¼ã¿ã®æ§é ä½ / A structure type for entry of auto-picker/destroyer */ typedef struct { - cptr name; /* Items which have 'name' as part of its name match */ - cptr insc; /* Items will be auto-inscribed as 'insc' */ - u32b flag[2]; /* Misc. keyword to be matched */ - byte action; /* Auto-pickup or Destroy or Leave items */ - byte dice; /* Weapons which have more than 'dice' dice match */ - byte bonus; /* Items which have more than 'bonus' magical bonus match */ + cptr name; /*!< èªåæ¾ã/ç ´å£å®ç¾©ã®å称ä¸è´åºæº / Items which have 'name' as part of its name match */ + cptr insc; /*!< 対象ã¨ãªã£ãã¢ã¤ãã ã«èªåã§å»ãå 容 / Items will be auto-inscribed as 'insc' */ + u32b flag[2]; /*!< ãã¼ã¯ã¼ãã«é¢ããæ±ç¨çãªæ¡ä»¶ãã©ã° / Misc. keyword to be matched */ + byte action; /*!< 対象ã®ã¢ã¤ãã ãæ¾ã/ç ´å£/æ¾ç½®ãããã®æå®ãã©ã° / Auto-pickup or Destroy or Leave items */ + byte dice; /*!< æ¦å¨ã®ãã¤ã¹å¤åºæºå¤ / Weapons which have more than 'dice' dice match */ + byte bonus; /*!< ã¢ã¤ãã ã®ãã¼ãã¹åºæºå¤ / Items which have more than 'bonus' magical bonus match */ } autopick_type; @@ -1651,7 +1666,7 @@ typedef struct { s16b floor_id; /* No recycle until 65536 IDs are all used */ byte savefile_id; /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */ - s16b dun_level; + DEPTH dun_level; s32b last_visit; /* Time count of last visit. 0 for new floor. */ u32b visit_mark; /* Older has always smaller mark. */ s16b upper_floor_id; /* a floor connected with level teleportation */ @@ -1672,12 +1687,60 @@ typedef struct } cave_template_type; -/* - * A structure type for arena entry +/*! + * @struct arena_type + * @brief éæå ´ã®ã¢ã³ã¹ã¿ã¼ã¨ã³ããªã¼æ§é ä½ / A structure type for arena entry */ typedef struct { - s16b r_idx; /* Monster (0 means victory prizing) */ - byte tval; /* tval of prize (0 means no prize) */ - byte sval; /* sval of prize */ + s16b r_idx; /*!< éæå ´ã®ã¢ã³ã¹ã¿ã¼ç¨®æID(0ãªãã°è¡¨å½°å¼) / Monster (0 means victory prizing) */ + byte tval; /*!< ã¢ã³ã¹ã¿ã¼æåå¾ã«å¾ãããã¢ã¤ãã ã®å¤§ã«ãã´ãªID / tval of prize (0 means no prize) */ + byte sval; /*!< ã¢ã³ã¹ã¿ã¼æåå¾ã«å¾ãããã¢ã¤ãã ã®å°ã«ãã´ãªID / sval of prize */ } arena_type; + + +/* + * A structure type for doors + */ +typedef struct +{ + FEAT_IDX open; + FEAT_IDX broken; + FEAT_IDX closed; + FEAT_IDX locked[MAX_LJ_DOORS]; + FEAT_IDX num_locked; + FEAT_IDX jammed[MAX_LJ_DOORS]; + FEAT_IDX num_jammed; +} door_type; + + +#ifdef TRAVEL +/* + * A structure type for travel command + */ +typedef struct { + int run; /* Remaining grid number */ + int cost[MAX_HGT][MAX_WID]; + int x; /* Target X */ + int y; /* Target Y */ + int dir; /* Running direction */ +} travel_type; +#endif + +typedef struct { + cptr flag; + byte index; + byte level; + s32b value; + struct { + int constant; + int dice; + } timeout; + cptr desc; +} activation_type; + +typedef struct { + int flag; + int type; + cptr name; +} dragonbreath_type;