OSDN Git Service

[Refactor] #38997 calc_bonuses() に player_type * 引数を追加.
[hengband/hengband.git] / src / player-status.h
index 54c5cab..822908a 100644 (file)
  * whenever anything important changes.
  */
 
+/*
+ * Player constants
+ */
+#define PY_MAX_EXP      99999999L       /*!< プレイヤー経験値の最大値 / Maximum exp */
+#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
+ */
+#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];
 
@@ -22,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- */
 
@@ -57,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 */
@@ -75,6 +139,13 @@ struct player_type
 
        s16b max_plv;           /* Max Player Level */
 
+       #define A_STR 0
+       #define A_INT 1
+       #define A_WIS 2
+       #define A_DEX 3
+       #define A_CON 4
+       #define A_CHR 5
+       #define A_MAX 6
        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 */
@@ -140,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;
@@ -332,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];
@@ -349,11 +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 */
@@ -374,11 +457,36 @@ 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 /*!< アイテムスロット…射撃 */
+       #define INVEN_RIGHT     27 /*!< アイテムスロット…右手指 */
+       #define INVEN_LEFT      28 /*!< アイテムスロット…左手指 */
+       #define INVEN_NECK      29 /*!< アイテムスロット…首 */
+       #define INVEN_LITE      30 /*!< アイテムスロット…光源 */
+       #define INVEN_BODY      31 /*!< アイテムスロット…体 */
+       #define INVEN_OUTER     32 /*!< アイテムスロット…体の上 */
+       #define INVEN_HEAD      33 /*!< アイテムスロット…頭部 */
+       #define INVEN_HANDS     34 /*!< アイテムスロット…腕部 */
+       #define INVEN_FEET      35 /*!< アイテムスロット…脚部 */
+       #define INVEN_AMMO      23 /*!< used for get_random_ego()  */
+       #define INVEN_TOTAL     36 /*!< Total number of inventory_list slots (hard-coded). */
+       #define INVEN_FORCE     1111 /*!< inventory_list slot for selecting force (hard-coded). */
        object_type *inventory_list; /* The player's inventory */
        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 */
@@ -459,9 +567,14 @@ struct player_type
        POSITION run_px;
        DIRECTION fishing_dir;
 
+       MONSTER_IDX pet_t_m_idx;
+       MONSTER_IDX riding_t_m_idx;
 
        /*** Extracted fields ***/
 
+       s16b running;                   /* Current counter for running, if any */
+       bool suppress_multi_reward; /*!< 複数レベルアップ時のパトロンからの報酬多重受け取りを防止 */
+
        WEIGHT total_weight;    /*!< 所持品と装備品の計算総重量 / Total weight being carried */
 
        s16b stat_add[A_MAX];   /* Modifiers to stat values */
@@ -469,6 +582,7 @@ struct player_type
 
        bool hack_mutation;
        bool is_fired;
+       bool level_up_message;
 
        bool immune_acid;       /* Immunity to acid */
        bool immune_elec;       /* Immunity to lightning */
@@ -606,32 +720,35 @@ struct player_type
        POSITION y;     /* Player location in dungeon */
        POSITION x;     /* Player location in dungeon */
        GAME_TEXT name[32]; /*!< 現在のプレイヤー名 / Current player's character name */
+       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);
@@ -674,4 +791,7 @@ extern const s32b player_exp_a[PY_MAX_LEVEL];
 #define PY_REGEN_HPBASE         1442    /* Min amount hp regen*2^16 */
 #define PY_REGEN_MNBASE         524     /* Min amount mana regen*2^16 */
 
+#define CAN_TWO_HANDS_WIELDING() (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))
+
+
 extern void cheat_death(player_type *creature_ptr);