X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Ftypes.h;h=c92f065593aa903b79abadf6ae86274d31cdd3b4;hb=ad951098494c9de50a330832bbd93a3e508989a8;hp=4a72eecd3a26b1a9f1b3cecdae36761b2d615b00;hpb=6b1e8da9a54d4ef5642f2647b1155d3c8eecbf8e;p=hengband%2Fhengband.git diff --git a/src/types.h b/src/types.h index 4a72eecd3..c92f06559 100644 --- a/src/types.h +++ b/src/types.h @@ -37,7 +37,7 @@ * * Certain data is saved in multiple places for efficient access, currently, * this includes the tval/sval/weight fields in "object_type", various fields - * in "header_type", and the "m_idx" and "o_idx" fields in "cave_type". All + * in "header_type", and the "m_idx" and "o_idx" fields in "grid_type". All * of these could be removed, but this would, in general, slow down the game * and increase the complexity of the code. * @@ -200,7 +200,7 @@ struct artifact_type byte cur_num; /*! 現在の生成数 / Number created (0 or 1) */ byte max_num; /*! (未使用)最大生成数 / Unused (should be "1") */ - s16b floor_id; /*! アイテムを落としたフロアのID / Leaved on this location last time */ + FLOOR_IDX floor_id; /*! アイテムを落としたフロアのID / Leaved on this location last time */ byte act_idx; /*! 発動能力ID / Activative ability index */ }; @@ -427,13 +427,13 @@ struct skill_table /* * A single "grid" in a Cave * - * Note that several aspects of the code restrict the actual 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 cave grid. The easiest way to + * 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 @@ -450,17 +450,17 @@ struct skill_table * Note the special fields for the "MONSTER_FLOW" code. */ -typedef struct cave_type cave_type; +typedef struct grid_type grid_type; -struct cave_type +struct grid_type { - BIT_FLAGS info; /* Hack -- cave flags */ + 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 cave info + /*! 地形の特別な情報を保存する / Special current_floor_ptr->grid_array info * 具体的な使用一覧はクエスト行き階段の移行先クエストID、 * 各ダンジョン入口の移行先ダンジョンID、 * @@ -503,7 +503,7 @@ struct coord * Note that "object flags" must now be derived from the object kind, * the artifact and ego-item indexes, and the two "xtra" fields. * - * Each cave grid points to one (or zero) objects via the "o_idx" + * 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. @@ -537,8 +537,8 @@ struct object_type WEIGHT weight; /* Item weight */ - IDX name1; /* Artifact type, if any */ - IDX name2; /* Ego-Item type, if any */ + 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 */ @@ -558,7 +558,6 @@ struct object_type TIME_EFFECT timeout; /* Timeout Counter */ byte ident; /* Special flags */ - byte marked; /* Object is marked */ u16b inscription; /* Inscription index */ @@ -569,8 +568,8 @@ struct object_type BIT_FLAGS art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */ BIT_FLAGS curse_flags; /* Flags for curse */ - IDX next_o_idx; /* Next object in stack (if any) */ - IDX held_m_idx; /* Monster holding us (if any) */ + 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 */ }; @@ -579,9 +578,7 @@ struct object_type /* * 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). */ @@ -623,7 +620,40 @@ struct monster_type EXP exp; - BIT_FLAGS smart; /* Field for "smart_learn" */ + /* 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; }; @@ -684,8 +714,8 @@ struct option_type byte o_set; byte o_bit; - cptr o_text; - cptr o_desc; + concptr o_text; + concptr o_desc; }; @@ -701,7 +731,7 @@ struct quest_type QUEST_STATUS status; /*!< クエストの進行ステータス / Is the quest taken, completed, finished? */ QUEST_TYPE type; /*!< クエストの種別 / The quest type */ - char name[60]; /*!< クエスト名 / Quest name */ + GAME_TEXT name[60]; /*!< クエスト名 / Quest name */ DEPTH level; /*!< 処理階層 / Dungeon level */ MONRACE_IDX r_idx; /*!< クエスト対象のモンスターID / Monster race */ @@ -726,17 +756,12 @@ typedef struct owner_type owner_type; struct owner_type { - cptr owner_name; /* Name */ - + 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 */ }; @@ -822,11 +847,11 @@ typedef struct player_sex player_sex; struct player_sex { - cptr title; /* Type of sex */ - cptr winner; /* Name of winner */ + concptr title; /* Type of sex */ + concptr winner; /* Name of winner */ #ifdef JP - cptr E_title; /* 英語性別 */ - cptr E_winner; /* 英語性別 */ + concptr E_title; /* 英語性別 */ + concptr E_winner; /* 英語性別 */ #endif }; @@ -839,10 +864,10 @@ typedef struct player_race player_race; struct player_race { - cptr title; /* Type of race */ + concptr title; /* Type of race */ #ifdef JP - cptr E_title; /* 英語種族 */ + concptr E_title; /* 英語種族 */ #endif s16b r_adj[6]; /* Racial stat bonuses */ @@ -886,10 +911,10 @@ typedef struct player_class player_class; struct player_class { - cptr title; /* Type of class */ + concptr title; /* Type of class */ #ifdef JP - cptr E_title; /* 英語職業 */ + concptr E_title; /* 英語職業 */ #endif s16b c_adj[6]; /* Class stat modifier */ @@ -921,10 +946,10 @@ struct player_class typedef struct player_seikaku player_seikaku; struct player_seikaku { - cptr title; /* Type of seikaku */ + concptr title; /* Type of seikaku */ #ifdef JP - cptr E_title; /* 英語性格 */ + concptr E_title; /* 英語性格 */ #endif s16b a_adj[6]; /* seikaku stat bonuses */ @@ -967,19 +992,19 @@ struct player_type 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 */ + SEX_IDX psex; /* Sex index */ + RACE_IDX prace; /* Race index */ + CLASS_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) - */ + DICE_SID hitdie; /* Hit dice (sides) */ + u16b expfact; /* Experience factor + * Note: was byte, causing overflow for Amberite + * characters (such as Amberite Paladins) + */ s16b age; /* Characters age */ s16b ht; /* Height */ @@ -995,12 +1020,13 @@ struct player_type PLAYER_LEVEL lev; /* Level */ - s16b town_num; /* Current town number */ + TOWN_IDX town_num; /* Current town number */ s16b arena_number; /* monster number in arena -KMW- */ bool inside_arena; /* Is character inside arena? */ QUEST_IDX inside_quest; /* Inside quest level */ bool inside_battle; /* Is character inside tougijou? */ + DUNGEON_IDX dungeon_idx; /* current dungeon index */ POSITION wilderness_x; /* Coordinates in the wilderness */ POSITION wilderness_y; bool wild_mode; @@ -1079,10 +1105,112 @@ struct player_type TIME_EFFECT multishadow; /* Timed -- Multi-shadow */ TIME_EFFECT dustrobe; /* Timed -- Robe of dust */ + bool timewalk; + + PATRON_IDX chaos_patron; - BIT_FLAGS muta1; - BIT_FLAGS muta2; - BIT_FLAGS muta3; + + BIT_FLAGS muta1; /*!< レイシャル型の変異 / "Activatable" mutations must be in MUT1_* */ + #define MUT1_SPIT_ACID 0x00000001L /*!< 突然変異: 酸の唾 */ + #define MUT1_BR_FIRE 0x00000002L /*!< 突然変異: 炎のブレス */ + #define MUT1_HYPN_GAZE 0x00000004L /*!< 突然変異: 催眠睨み */ + #define MUT1_TELEKINES 0x00000008L /*!< 突然変異: 念動力 */ + #define MUT1_VTELEPORT 0x00000010L /*!< 突然変異: テレポート / Voluntary teleport */ + #define MUT1_MIND_BLST 0x00000020L /*!< 突然変異: 精神攻撃 */ + #define MUT1_RADIATION 0x00000040L /*!< 突然変異: 放射能 */ + #define MUT1_VAMPIRISM 0x00000080L /*!< 突然変異: 吸血 */ + #define MUT1_SMELL_MET 0x00000100L /*!< 突然変異: 金属嗅覚 */ + #define MUT1_SMELL_MON 0x00000200L /*!< 突然変異: 敵臭嗅覚 */ + #define MUT1_BLINK 0x00000400L /*!< 突然変異: ショート・テレポート */ + #define MUT1_EAT_ROCK 0x00000800L /*!< 突然変異: 岩喰い */ + #define MUT1_SWAP_POS 0x00001000L /*!< 突然変異: 位置交換 */ + #define MUT1_SHRIEK 0x00002000L /*!< 突然変異: 叫び */ + #define MUT1_ILLUMINE 0x00004000L /*!< 突然変異: 照明 */ + #define MUT1_DET_CURSE 0x00008000L /*!< 突然変異: 呪い感知 */ + #define MUT1_BERSERK 0x00010000L /*!< 突然変異: 狂戦士化 */ + #define MUT1_POLYMORPH 0x00020000L /*!< 突然変異: 変身 */ + #define MUT1_MIDAS_TCH 0x00040000L /*!< 突然変異: ミダスの手 */ + #define MUT1_GROW_MOLD 0x00080000L /*!< 突然変異: カビ発生 */ + #define MUT1_RESIST 0x00100000L /*!< 突然変異: エレメント耐性 */ + #define MUT1_EARTHQUAKE 0x00200000L /*!< 突然変異: 地震 */ + #define MUT1_EAT_MAGIC 0x00400000L /*!< 突然変異: 魔力喰い */ + #define MUT1_WEIGH_MAG 0x00800000L /*!< 突然変異: 魔力感知 */ + #define MUT1_STERILITY 0x01000000L /*!< 突然変異: 増殖阻止 */ + #define MUT1_PANIC_HIT 0x02000000L /*!< 突然変異: ヒットアンドアウェイ */ + #define MUT1_DAZZLE 0x04000000L /*!< 突然変異: 眩惑 */ + #define MUT1_LASER_EYE 0x08000000L /*!< 突然変異: レーザー・アイ */ + #define MUT1_RECALL 0x10000000L /*!< 突然変異: 帰還 */ + #define MUT1_BANISH 0x20000000L /*!< 突然変異: 邪悪消滅 */ + #define MUT1_COLD_TOUCH 0x40000000L /*!< 突然変異: 凍結の手 */ + #define MUT1_LAUNCHER 0x80000000L /*!< 突然変異: アイテム投げ */ + + BIT_FLAGS muta2; /*!< 常時効果つきの変異1 / Randomly activating mutations must be MUT2_* */ + #define MUT2_BERS_RAGE 0x00000001L /*!< 突然変異: 狂戦士化の発作 */ + #define MUT2_COWARDICE 0x00000002L /*!< 突然変異: 臆病 */ + #define MUT2_RTELEPORT 0x00000004L /*!< 突然変異: ランダムテレポート / Random teleport, instability */ + #define MUT2_ALCOHOL 0x00000008L /*!< 突然変異: アルコール分泌 */ + #define MUT2_HALLU 0x00000010L /*!< 突然変異: 幻覚を引き起こす精神錯乱 */ + #define MUT2_FLATULENT 0x00000020L /*!< 突然変異: 猛烈な屁 */ + #define MUT2_SCOR_TAIL 0x00000040L /*!< 突然変異: サソリの尻尾 */ + #define MUT2_HORNS 0x00000080L /*!< 突然変異: ツノ */ + #define MUT2_BEAK 0x00000100L /*!< 突然変異: クチバシ */ + #define MUT2_ATT_DEMON 0x00000200L /*!< 突然変異: デーモンを引き付ける */ + #define MUT2_PROD_MANA 0x00000400L /*!< 突然変異: 制御できない魔力のエネルギー */ + #define MUT2_SPEED_FLUX 0x00000800L /*!< 突然変異: ランダムな加減速 */ + #define MUT2_BANISH_ALL 0x00001000L /*!< 突然変異: ランダムなモンスター消滅 */ + #define MUT2_EAT_LIGHT 0x00002000L /*!< 突然変異: 光源喰い */ + #define MUT2_TRUNK 0x00004000L /*!< 突然変異: 象の鼻 */ + #define MUT2_ATT_ANIMAL 0x00008000L /*!< 突然変異: 動物を引き寄せる */ + #define MUT2_TENTACLES 0x00010000L /*!< 突然変異: 邪悪な触手 */ + #define MUT2_RAW_CHAOS 0x00020000L /*!< 突然変異: 純カオス */ + #define MUT2_NORMALITY 0x00040000L /*!< 突然変異: ランダムな変異の消滅 */ + #define MUT2_WRAITH 0x00080000L /*!< 突然変異: ランダムな幽体化 */ + #define MUT2_POLY_WOUND 0x00100000L /*!< 突然変異: ランダムな傷の変化 */ + #define MUT2_WASTING 0x00200000L /*!< 突然変異: 衰弱 */ + #define MUT2_ATT_DRAGON 0x00400000L /*!< 突然変異: ドラゴンを引き寄せる */ + #define MUT2_WEIRD_MIND 0x00800000L /*!< 突然変異: ランダムなテレパシー */ + #define MUT2_NAUSEA 0x01000000L /*!< 突然変異: 落ち着きの無い胃 */ + #define MUT2_CHAOS_GIFT 0x02000000L /*!< 突然変異: カオスパトロン */ + #define MUT2_WALK_SHAD 0x04000000L /*!< 突然変異: ランダムな現実変容 */ + #define MUT2_WARNING 0x08000000L /*!< 突然変異: 警告 */ + #define MUT2_INVULN 0x10000000L /*!< 突然変異: ランダムな無敵化 */ + #define MUT2_SP_TO_HP 0x20000000L /*!< 突然変異: ランダムなMPからHPへの変換 */ + #define MUT2_HP_TO_SP 0x40000000L /*!< 突然変異: ランダムなHPからMPへの変換 */ + #define MUT2_DISARM 0x80000000L /*!< 突然変異: ランダムな武器落とし */ + + BIT_FLAGS muta3; /*!< 常時効果つきの変異2 / Other mutations will be mainly in MUT3_* */ + #define MUT3_HYPER_STR 0x00000001L /*!< 突然変異: 超人的な力 */ + #define MUT3_PUNY 0x00000002L /*!< 突然変異: 虚弱 */ + #define MUT3_HYPER_INT 0x00000004L /*!< 突然変異: 生体コンピュータ */ + #define MUT3_MORONIC 0x00000008L /*!< 突然変異: 精神薄弱 */ + #define MUT3_RESILIENT 0x00000010L /*!< 突然変異: 弾力のある体 */ + #define MUT3_XTRA_FAT 0x00000020L /*!< 突然変異: 異常な肥満 */ + #define MUT3_ALBINO 0x00000040L /*!< 突然変異: アルビノ */ + #define MUT3_FLESH_ROT 0x00000080L /*!< 突然変異: 腐敗した肉体 */ + #define MUT3_SILLY_VOI 0x00000100L /*!< 突然変異: 間抜けなキーキー声 */ + #define MUT3_BLANK_FAC 0x00000200L /*!< 突然変異: のっぺらぼう */ + #define MUT3_ILL_NORM 0x00000400L /*!< 突然変異: 幻影に覆われた体 */ + #define MUT3_XTRA_EYES 0x00000800L /*!< 突然変異: 第三の目 */ + #define MUT3_MAGIC_RES 0x00001000L /*!< 突然変異: 魔法防御 */ + #define MUT3_XTRA_NOIS 0x00002000L /*!< 突然変異: 騒音 */ + #define MUT3_INFRAVIS 0x00004000L /*!< 突然変異: 赤外線視力 */ + #define MUT3_XTRA_LEGS 0x00008000L /*!< 突然変異: 追加の脚 */ + #define MUT3_SHORT_LEG 0x00010000L /*!< 突然変異: 短い脚 */ + #define MUT3_ELEC_TOUC 0x00020000L /*!< 突然変異: 電撃オーラ */ + #define MUT3_FIRE_BODY 0x00040000L /*!< 突然変異: 火炎オーラ */ + #define MUT3_WART_SKIN 0x00080000L /*!< 突然変異: イボ肌 */ + #define MUT3_SCALES 0x00100000L /*!< 突然変異: 鱗肌 */ + #define MUT3_IRON_SKIN 0x00200000L /*!< 突然変異: 鉄の肌 */ + #define MUT3_WINGS 0x00400000L /*!< 突然変異: 翼 */ + #define MUT3_FEARLESS 0x00800000L /*!< 突然変異: 恐れ知らず */ + #define MUT3_REGEN 0x01000000L /*!< 突然変異: 急回復 */ + #define MUT3_ESP 0x02000000L /*!< 突然変異: テレパシー */ + #define MUT3_LIMBER 0x04000000L /*!< 突然変異: しなやかな肉体 */ + #define MUT3_ARTHRITIS 0x08000000L /*!< 突然変異: 関節の痛み */ + #define MUT3_BAD_LUCK 0x10000000L /*!< 突然変異: 黒いオーラ(不運) */ + #define MUT3_VULN_ELEM 0x20000000L /*!< 突然変異: 元素攻撃弱点 */ + #define MUT3_MOTION 0x40000000L /*!< 突然変異: 正確で力強い動作 */ + #define MUT3_GOOD_LUCK 0x80000000L /*!< 突然変異: 白いオーラ(幸運) */ s16b virtues[8]; s16b vir_types[8]; @@ -1123,7 +1251,7 @@ struct player_type HIT_POINT player_hp[PY_MAX_LEVEL]; char died_from[80]; /* What killed the player */ - cptr last_message; /* Last message on death or retirement */ + concptr last_message; /* Last message on death or retirement */ char history[4][60]; /* Textual "history" for the Player */ u16b total_winner; /* Total winner */ @@ -1140,7 +1268,7 @@ struct player_type byte knowledge; /* Knowledge about yourself */ BIT_FLAGS visit; /* Visited towns */ - byte start_race; /* Race at birth */ + RACE_IDX start_race; /* Race at birth */ BIT_FLAGS old_race1; /* Record of race changes */ BIT_FLAGS old_race2; /* Record of race changes */ s16b old_realm; /* Record of realm changes */ @@ -1151,7 +1279,7 @@ struct player_type s16b today_mon; /* Wanted monster */ bool dtrap; /* Whether you are on trap-safe grids */ - s16b floor_id; /* Current floor location */ + FLOOR_IDX floor_id; /* Current floor location */ bool autopick_autoregister; /* auto register is in-use or not */ @@ -1172,9 +1300,9 @@ struct player_type IDX health_who; /* Health bar trackee */ - IDX monster_race_idx; /* Monster race trackee */ + MONRACE_IDX monster_race_idx; /* Monster race trackee */ - IDX object_kind_idx; /* Object kind trackee */ + KIND_OBJECT_IDX object_kind_idx; /* Object kind trackee */ s16b new_spells; /* Number of spells available */ s16b old_spells; @@ -1203,11 +1331,27 @@ struct player_type s16b cur_lite; /* Radius of lite (if any) */ - - u32b notice; /* Special Updates (bit flags) */ - u32b update; /* Pending Updates (bit flags) */ - u32b redraw; /* Normal Redraws (bit flags) */ - u32b window; /* Window Redraws (bit flags) */ + BIT_FLAGS update; /* Pending Updates */ + #define PU_BONUS 0x00000001L /*!< ステータス更新フラグ: 能力値修正 / Calculate bonuses */ + #define PU_TORCH 0x00000002L /*!< ステータス更新フラグ: 光源半径 / Calculate torch radius */ + #define PU_HP 0x00000010L /*!< ステータス更新フラグ: HP / Calculate chp and mhp */ + #define PU_MANA 0x00000020L /*!< ステータス更新フラグ: MP / Calculate csp and msp */ + #define PU_SPELLS 0x00000040L /*!< ステータス更新フラグ: 魔法学習数 / Calculate spells */ + #define PU_COMBINE 0x00000100L /*!< アイテム処理フラグ: アイテムの結合を要する / Combine the pack */ + #define PU_REORDER 0x00000200L /*!< アイテム処理フラグ: アイテムの並び替えを要する / Reorder the pack */ + #define PU_AUTODESTROY 0x00000400L /*!< アイテム処理フラグ: アイテムの自動破壊を要する / Auto-destroy marked item */ + #define PU_UN_VIEW 0x00010000L /*!< ステータス更新フラグ: 地形の視界外化 / Forget view */ + #define PU_UN_LITE 0x00020000L /*!< ステータス更新フラグ: 明暗範囲の視界外化 / Forget lite */ + #define PU_VIEW 0x00100000L /*!< ステータス更新フラグ: 視界 / Update view */ + #define PU_LITE 0x00200000L /*!< ステータス更新フラグ: 明暗範囲 / Update lite */ + #define PU_MON_LITE 0x00400000L /*!< ステータス更新フラグ: モンスターの光源範囲 / Monster illumination */ + #define PU_DELAY_VIS 0x00800000L /*!< ステータス更新フラグ: 視界の追加更新 / Mega-Hack -- Delayed visual update */ + #define PU_MONSTERS 0x01000000L /*!< ステータス更新フラグ: モンスターのステータス / Update monsters */ + #define PU_DISTANCE 0x02000000L /*!< ステータス更新フラグ: プレイヤーとモンスターの距離 / Update distances */ + #define PU_FLOW 0x10000000L /*!< ステータス更新フラグ: プレイヤーから各マスへの到達距離 / Update flow */ + + BIT_FLAGS redraw; /* Normal Redraws */ + BIT_FLAGS window; /* Window Redraws */ s16b stat_use[6]; /* Current modified stats */ s16b stat_top[6]; /* Maximal modified stats */ @@ -1215,9 +1359,10 @@ struct player_type bool sutemi; bool counter; - ALIGNMENT align; /* Good/evil/neutral */ + ALIGNMENT align; /* Good/evil/neutral */ POSITION run_py; POSITION run_px; + DIRECTION fishing_dir; /*** Extracted fields ***/ @@ -1250,6 +1395,7 @@ struct player_type bool resist_neth; /* Resist nether */ bool resist_fear; /* Resist fear */ bool resist_time; /* Resist time */ + bool resist_water; /* Resist water */ bool reflect; /* Reflect 'bolt' attacks */ bool sh_fire; /* Fiery 'immolation' effect */ @@ -1342,7 +1488,6 @@ struct player_type */ ACTION_SKILL_POWER skill_srh; - ACTION_SKILL_POWER skill_fos; /*!< 行動技能値:探索 / Skill: Searching frequency */ ACTION_SKILL_POWER skill_thn; /*!< 行動技能値:打撃命中能力 / Skill: To hit (normal) */ ACTION_SKILL_POWER skill_thb; /*!< 行動技能値:射撃命中能力 / Skill: To hit (shooting) */ @@ -1361,7 +1506,7 @@ struct player_type POSITION y; /* Player location in dungeon */ POSITION x; /* Player location in dungeon */ - char name[32]; /*!< 現在のプレイヤー名 / Current player's character name */ + GAME_TEXT name[32]; /*!< 現在のプレイヤー名 / Current player's character name */ }; @@ -1372,12 +1517,12 @@ typedef struct birther birther; struct birther { - byte psex; /* Sex index */ - byte prace; /* Race index */ - byte pclass; /* Class index */ - byte pseikaku; /* Seikaku index */ - REALM_IDX realm1; /* First magic realm */ - REALM_IDX realm2; /* Second magic realm */ + SEX_IDX psex; /* Sex index */ + RACE_IDX prace; /* Race index */ + CLASS_IDX pclass; /* Class index */ + CHARACTER_IDX pseikaku; /* Seikaku index */ + REALM_IDX realm1; /* First magic realm */ + REALM_IDX realm2; /* Second magic realm */ s16b age; s16b ht; @@ -1406,31 +1551,31 @@ typedef struct martial_arts martial_arts; struct martial_arts { - cptr desc; /* A verbose attack description */ - int min_level; /* Minimum level to use */ - int chance; /* Chance of 'success' */ - int dd; /* Damage dice */ - int ds; /* Damage sides */ - int effect; /* Special effects */ + concptr desc; /* A verbose attack description */ + PLAYER_LEVEL min_level; /* Minimum level to use */ + int chance; /* Chance of 'success' */ + int dd; /* Damage dice */ + int ds; /* Damage sides */ + int effect; /* Special effects */ }; typedef struct kamae kamae; struct kamae { - cptr desc; /* A verbose kamae description */ - int min_level; /* Minimum level to use */ - cptr info; + concptr desc; /* A verbose kamae description */ + PLAYER_LEVEL min_level; /* Minimum level to use */ + concptr info; }; /* Mindcrafters */ typedef struct mind_type mind_type; struct mind_type { - int min_lev; - int mana_cost; - int fail; - cptr name; + PLAYER_LEVEL min_lev; + MANA_POINT mana_cost; + PERCENTAGE fail; + concptr name; }; typedef struct mind_power mind_power; @@ -1450,7 +1595,7 @@ struct monster_power int manedam; int manefail; int use_stat; - cptr name; + concptr name; }; @@ -1462,11 +1607,11 @@ typedef struct building_type building_type; struct building_type { - char name[20]; /* proprietor name */ - char owner_name[20]; /* proprietor name */ - char owner_race[20]; /* proprietor race */ + GAME_TEXT name[20]; /* proprietor name */ + GAME_TEXT owner_name[20]; /* proprietor name */ + GAME_TEXT owner_race[20]; /* proprietor race */ - char act_names[8][30]; /* action names */ + 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 */ @@ -1501,12 +1646,12 @@ struct border_type typedef struct wilderness_type wilderness_type; struct wilderness_type { - int terrain; - int town; - int road; - u32b seed; - DEPTH level; - byte entrance; + int terrain; + TOWN_IDX town; + int road; + u32b seed; + DEPTH level; + byte entrance; }; @@ -1517,20 +1662,10 @@ struct wilderness_type typedef struct town_type town_type; struct town_type { - char name[32]; - u32b seed; /* Seed for RNG */ - store_type *store; /* The stores [MAX_STORES] */ - byte numstores; -}; - -/* Dungeons */ -typedef struct dun_type dun_type; -struct dun_type -{ - byte min_level; /* Minimum level in the dungeon */ - byte max_level; /* Maximum dungeon level allowed */ - - cptr name; /* The name of the dungeon */ + GAME_TEXT name[32]; + u32b seed; /* Seed for RNG */ + store_type *store; /* The stores [MAX_STORES] */ + byte numstores; }; /* @@ -1540,11 +1675,11 @@ typedef struct tag_type tag_type; struct tag_type { - int tag; - int index; + int tag; + int index; }; -typedef bool (*monster_hook_type)(MONRACE_IDX r_idx); +typedef bool (*monsterrace_hook_type)(MONRACE_IDX r_idx); /* @@ -1568,31 +1703,24 @@ typedef struct high_score high_score; struct high_score { - char what[8]; /* Version info (string) */ - - char pts[10]; /* Total Score (number) */ - - char gold[10]; /* Total Gold (number) */ - - char turns[10]; /* Turns Taken (number) */ - - char day[10]; /* Time stamp (string) */ - - char who[16]; /* Player Name (string) */ - - char uid[8]; /* Player UID (number) */ - - char sex[2]; /* Player Sex (string) */ - char p_r[3]; /* Player Race (number) */ - char p_c[3]; /* Player Class (number) */ - char p_a[3]; /* Player Seikaku (number) */ - - char cur_lev[4]; /* Current Player Level (number) */ - char cur_dun[4]; /* Current Dungeon Level (number) */ - char max_lev[4]; /* Max Player Level (number) */ - char max_dun[4]; /* Max Dungeon Level (number) */ - - char how[40]; /* Method of death (string) */ + 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) */ }; @@ -1605,10 +1733,11 @@ feat_prob; /* A structure for the != dungeon types */ -typedef struct dungeon_info_type dungeon_info_type; -struct dungeon_info_type { - STR_OFFSET name; /* Name */ - STR_OFFSET text; /* Description */ +typedef struct dungeon_type dungeon_type; +struct dungeon_type { + + STR_OFFSET name; /* Name */ + STR_OFFSET text; /* Description */ POSITION dy; POSITION dx; @@ -1663,9 +1792,9 @@ struct dungeon_info_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 */ + concptr name; /*!< 自動拾い/破壊定義の名称一致基準 / Items which have 'name' as part of its name match */ + concptr insc; /*!< 対象となったアイテムに自動で刻む内容 / Items will be auto-inscribed as 'insc' */ + BIT_FLAGS 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 */ @@ -1677,13 +1806,13 @@ typedef struct { */ typedef struct { - s16b floor_id; /* No recycle until 65536 IDs are all used */ + 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. */ - s16b upper_floor_id; /* a floor connected with level teleportation */ - s16b lower_floor_id; /* a floor connected with level tel. and trap door */ + 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; @@ -1694,7 +1823,7 @@ typedef struct { BIT_FLAGS info; FEAT_IDX feat; - s16b mimic; + FEAT_IDX mimic; s16b special; u16b occurrence; } cave_template_type; @@ -1712,19 +1841,6 @@ typedef struct } 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 @@ -1734,14 +1850,14 @@ typedef struct typedef struct { int run; /* Remaining grid number */ int cost[MAX_HGT][MAX_WID]; - int x; /* Target X */ - int y; /* Target Y */ + POSITION x; /* Target X */ + POSITION y; /* Target Y */ DIRECTION dir; /* Running direction */ } travel_type; #endif typedef struct { - cptr flag; + concptr flag; byte index; byte level; s32b value; @@ -1749,11 +1865,19 @@ typedef struct { int constant; DICE_NUMBER dice; } timeout; - cptr desc; + concptr desc; } activation_type; typedef struct { int flag; int type; - cptr name; + concptr name; } dragonbreath_type; + +typedef struct { + grid_type *grid_array[MAX_HGT]; + DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */ + DEPTH base_level; + POSITION width; /* Current dungeon width */ + POSITION height; /* Current dungeon height */ +} floor_type; \ No newline at end of file