OSDN Git Service

[Refactor] #37353 Changed nemo struct to named struct: player_type
[hengband/hengband.git] / src / player-status.h
index 7d1aba9..8e9160c 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once 
-
-#include "floor.h"
+#include "market/building.h"
+struct floor_type;
+typedef struct floor_type floor_type;
 
 /*
  * Most of the "player" information goes here.
@@ -82,10 +83,9 @@ extern const byte adj_chr_chm[];
 extern const concptr stat_names[6];
 extern const concptr stat_names_reduced[6];
 
-typedef struct player_type player_type;
 struct floor_type;
 
-struct player_type
+typedef struct player_type
 {
        int player_uid;
        int player_euid;
@@ -594,8 +594,6 @@ struct player_type
 #define PW_OBJECT       0x00000200L     /*!<サブウィンドウ描画フラグ: アイテムの知識 / Display object recall */
 #define PW_DUNGEON      0x00000400L     /*!<サブウィンドウ描画フラグ: ダンジョンの地形 / Display dungeon view */
 #define PW_SNAPSHOT     0x00000800L     /*!<サブウィンドウ描画フラグ: 記念写真 / Display snap-shot */
-#define PW_BORG_1       0x00004000L     /*!<サブウィンドウ描画フラグ: ボーグメッセージ / Display borg messages */
-#define PW_BORG_2       0x00008000L     /*!<サブウィンドウ描画フラグ: ボーグステータス / Display borg status */
 
        s16b stat_use[A_MAX];   /* Current modified stats */
        s16b stat_top[A_MAX];   /* Maximal modified stats */
@@ -762,8 +760,8 @@ struct player_type
        POSITION x;     /* Player location in dungeon */
        GAME_TEXT name[32]; /*!< 現在のプレイヤー名 / Current player's character name */
        char base_name[32]; /*!< Stripped version of "player_name" */
+} player_type;
 
-};
 extern player_type *p_ptr;
 
 extern concptr your_alignment(player_type *creature_ptr);
@@ -802,17 +800,20 @@ extern const s32b player_exp_a[PY_MAX_LEVEL];
 #define IS_FAST(C) (C->fast || music_singing(C, MUSIC_SPEED) || music_singing(C, MUSIC_SHERO))
 #define IS_INVULN(C) (C->invuln || music_singing(C, MUSIC_INVULN))
 #define IS_HERO(C) (C->hero || music_singing(C, MUSIC_HERO) || music_singing(C, MUSIC_SHERO))
-#define IS_OPPOSE_ACID() (p_ptr->oppose_acid || music_singing(p_ptr, MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
-#define IS_OPPOSE_ELEC() (p_ptr->oppose_elec || music_singing(p_ptr, MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
-#define IS_OPPOSE_FIRE() (p_ptr->oppose_fire || music_singing(p_ptr, MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
-#define IS_OPPOSE_COLD() (p_ptr->oppose_cold || music_singing(p_ptr, MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
-#define IS_OPPOSE_POIS() (p_ptr->oppose_pois || music_singing(p_ptr, MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
-#define IS_TIM_ESP() (p_ptr->tim_esp || music_singing(p_ptr, MUSIC_MIND) || (p_ptr->concent >= CONCENT_TELE_THRESHOLD))
-#define IS_TIM_STEALTH() (p_ptr->tim_stealth || music_singing(p_ptr, MUSIC_STEALTH))
+
+#define IS_ECHIZEN(C) (((C)->pseikaku == SEIKAKU_COMBAT) || ((C)->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
 
 #define P_PTR_KI (p_ptr->magic_num1[0])
 
-extern bool is_blessed(player_type *player_ptr);
+extern bool is_blessed(player_type *creature_ptr);
+extern bool is_oppose_acid(player_type *creature_ptr);
+extern bool is_oppose_elec(player_type *creature_ptr);
+extern bool is_oppose_fire(player_type *creature_ptr);
+extern bool is_oppose_cold(player_type *creature_ptr);
+extern bool is_oppose_pois(player_type *creature_ptr);
+extern bool is_time_limit_esp(player_type *creature_ptr);
+extern bool is_time_limit_stealth(player_type *creature_ptr);
+extern bool can_two_hands_wielding(player_type *creature_ptr);
 
 /*
  * Player "food" crucial values
@@ -833,7 +834,15 @@ extern bool is_blessed(player_type *player_ptr);
 #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);
 
+extern void stop_singing(player_type *creature_ptr);
+extern void stop_mouth(player_type *caster_ptr);
+extern PERCENTAGE calculate_upkeep(player_type *creature_ptr);
+extern bool music_singing(player_type *caster_ptr, int music_songs);
 
-extern void cheat_death(player_type *creature_ptr);
+#define SINGING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[0])
+#define INTERUPTING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[1])
+#define SINGING_COUNT(P_PTR) ((P_PTR)->magic_num1[2])
+#define SINGING_SONG_ID(P_PTR) ((P_PTR)->magic_num2[0])
+#define music_singing_any(CREATURE_PTR) (((CREATURE_PTR)->pclass == CLASS_BARD) && (CREATURE_PTR)->magic_num1[0])