OSDN Git Service

[Refactor] #38997 calc_bonuses() に player_type * 引数を追加.
[hengband/hengband.git] / src / player-status.h
index d6d089c..822908a 100644 (file)
 #define PY_MAX_GOLD     999999999L      /*!< プレイヤー所持金の最大値 / Maximum gold */
 #define PY_MAX_LEVEL    50              /*!< プレイヤーレベルの最大値 / Maximum level */
 
+#define GINOU_MAX      10
+#define MAX_MANE 16
+
 #define MAGIC_GLOVE_REDUCE_MANA 0x0001
 #define MAGIC_FAIL_5PERCENT     0x0002
 #define MAGIC_GAIN_EXP          0x0004
 
- /*
 * Magic-books for the realms
 */
+/*
+ * Magic-books for the realms
+ */
 #define REALM1_BOOK     (p_ptr->realm1 + TV_LIFE_BOOK - 1)
 #define REALM2_BOOK     (p_ptr->realm2 + TV_LIFE_BOOK - 1)
 
+/* no_flowed 判定対象となるスペル */
+#define SPELL_DD_S 27
+#define SPELL_DD_T 13
+#define SPELL_SW   22
+#define SPELL_KABE 20
+
+/* Empty hand status */
+#define EMPTY_HAND_NONE 0x0000 /* Both hands are used */
+#define EMPTY_HAND_LARM 0x0001 /* Left hand is empty */
+#define EMPTY_HAND_RARM 0x0002 /* Right hand is empty */
+
+/*
+ * Player sex constants (hard-coded by save-files, arrays, etc)
+ */
+#define SEX_FEMALE              0
+#define SEX_MALE                1
+#define MAX_SEXES        2 /*!< 性別の定義最大数 / Maximum number of player "sex" types (see "table.c", etc) */
+
+extern const byte adj_mag_study[];
+extern const byte adj_mag_mana[];
+extern const byte adj_mag_fail[];
+extern const byte adj_mag_stat[];
+extern const byte adj_chr_gold[];
+extern const byte adj_int_dev[];
+extern const byte adj_wis_sav[];
+extern const byte adj_dex_dis[];
+extern const byte adj_int_dis[];
+extern const byte adj_dex_ta[];
+extern const byte adj_str_td[];
+extern const byte adj_dex_th[];
+extern const byte adj_str_th[];
+extern const byte adj_str_wgt[];
+extern const byte adj_str_hold[];
+extern const byte adj_str_dig[];
+extern const byte adj_dex_safe[];
+extern const byte adj_con_fix[];
+extern const byte adj_con_mhp[];
+extern const byte adj_chr_chm[];
+
+
 extern const concptr stat_names[6];
 extern const concptr stat_names_reduced[6];
 
@@ -39,6 +82,10 @@ typedef struct player_type player_type;
 
 struct player_type
 {
+       int player_uid;
+       int player_euid;
+       int player_egid;
+
        POSITION oldpy;         /* Previous player location -KMW- */
        POSITION oldpx;         /* Previous player location -KMW- */
 
@@ -74,7 +121,7 @@ struct player_type
        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? */
+       bool phase_out;         /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */
 
        DUNGEON_IDX dungeon_idx; /* current dungeon index */
        POSITION wilderness_x;  /* Coordinates in the wilderness */
@@ -164,6 +211,9 @@ struct player_type
        TIME_EFFECT dustrobe;          /* Timed -- Robe of dust */
 
        bool timewalk;
+
+#define COMMAND_ARG_REST_UNTIL_DONE -2   /*!<休憩コマンド引数 … 必要な分だけ回復 */
+#define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */
        GAME_TURN resting;      /* Current counter for resting, if any */
 
        PATRON_IDX chaos_patron;
@@ -356,7 +406,10 @@ struct player_type
        SPELL_IDX mane_spell[MAX_MANE];
        HIT_POINT mane_dam[MAX_MANE];
        s16b mane_num;
+       bool new_mane;
 
+       #define CONCENT_RADAR_THRESHOLD 2
+       #define CONCENT_TELE_THRESHOLD  5
        s16b concent;      /* Sniper's concentration level */
 
        HIT_POINT player_hp[PY_MAX_LEVEL];
@@ -373,13 +426,17 @@ struct player_type
        bool is_dead;             /* Player is dead */
        bool now_damaged;
        bool ambush_flag;
+       BIT_FLAGS change_floor_mode;  /*!<フロア移行処理に関するフラグ / Mode flags for changing floor */
 
        bool reset_concent;   /* Concentration reset flag */
 
        bool wizard;              /* Player is in wizard mode */
 
        MONSTER_IDX riding;              /* Riding on a monster of this index */
-       byte knowledge;           /* Knowledge about yourself */
+
+       #define KNOW_STAT   0x01
+       #define KNOW_HPRATE 0x02
+       BIT_FLAGS8 knowledge;           /* Knowledge about yourself */
        BIT_FLAGS visit;               /* Visited towns */
 
        RACE_IDX start_race;          /* Race at birth */
@@ -400,10 +457,16 @@ struct player_type
        byte feeling;           /* Most recent dungeon feeling */
        s32b feeling_turn;      /* The turn of the last dungeon feeling */
 
-
        /*
+        * Maximum number of "normal" pack slots, and the index of the "overflow"
+        * slot, which can hold an item, but only temporarily, since it causes the
+        * pack to "overflow", dropping the "last" item onto the ground.  Since this
+        * value is used as an actual slot, it must be less than "INVEN_RARM" (below).
+        * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
+        * by the fact that the screen can only show 23 items plus a one-line prompt.
         * Indexes used for various "equipment" slots (hard-coded by savefiles, etc).
         */
+       #define INVEN_PACK      23 /*!< アイテムスロット…所持品(0~) */
        #define INVEN_RARM      24 /*!< アイテムスロット…右手 */
        #define INVEN_LARM      25 /*!< アイテムスロット…左手 */
        #define INVEN_BOW       26 /*!< アイテムスロット…射撃 */
@@ -423,7 +486,7 @@ struct player_type
        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 */
@@ -504,6 +567,8 @@ struct player_type
        POSITION run_px;
        DIRECTION fishing_dir;
 
+       MONSTER_IDX pet_t_m_idx;
+       MONSTER_IDX riding_t_m_idx;
 
        /*** Extracted fields ***/
 
@@ -658,31 +723,32 @@ struct player_type
        char base_name[32]; /*!< Stripped version of "player_name" */
 
 };
+extern player_type *p_ptr;
 
-extern concptr your_alignment(void);
+extern concptr your_alignment(player_type *creature_ptr);
 extern int weapon_exp_level(int weapon_exp);
 extern int riding_exp_level(int riding_exp);
 extern int spell_exp_level(int spell_exp);
 
-extern s16b calc_num_fire(object_type *o_ptr);
-extern void calc_bonuses(void);
-extern WEIGHT weight_limit(void);
-extern bool has_melee_weapon(int i);
-extern bool is_heavy_shoot(object_type *o_ptr);
+extern s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
+extern void calc_bonuses(player_type *creature_ptr);
+extern WEIGHT weight_limit(player_type *creature_ptr);
+extern bool has_melee_weapon(player_type *creature_ptr, int i);
+extern bool is_heavy_shoot(player_type *creature_ptr, object_type *o_ptr);
 
-extern bool heavy_armor(void);
+extern bool heavy_armor(player_type *creature_ptr);
 extern void update_creature(player_type *creature_ptr);
-extern BIT_FLAGS16 empty_hands(bool riding_control);
-extern bool player_has_no_spellbooks(void);
+extern BIT_FLAGS16 empty_hands(player_type *creature_ptr, bool riding_control);
+extern bool player_has_no_spellbooks(player_type *creature_ptr);
 
 extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
 extern void free_turn(player_type *creature_ptr);
 
-extern bool player_place(POSITION y, POSITION x);
-extern void sanity_blast(monster_type *m_ptr, bool necro);
+extern bool player_place(player_type *creature_ptr, POSITION y, POSITION x);
+extern void sanity_blast(player_type *creature_ptr, monster_type *m_ptr, bool necro);
 
-extern void check_experience(void);
-extern void wreck_the_pattern(void);
+extern void check_experience(player_type *creature_ptr);
+extern void wreck_the_pattern(player_type *creature_ptr);
 extern void cnv_stat(int val, char *out_val);
 extern s16b modify_stat_value(int value, int amount);
 extern long calc_score(void);