OSDN Git Service

[Refactor] #38997 IS_TIM_STEALTH() の関数マクロを普通の関数 is_time_limit_stealth()に変更し、player_ty...
authorHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 09:23:09 +0000 (18:23 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 16:06:58 +0000 (01:06 +0900)
src/player-effects.c
src/player-status.c
src/player-status.h
src/view-mainwindow.c

index fa2b3ae..cde4c56 100644 (file)
@@ -1594,7 +1594,7 @@ bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                {
                        if (creature_ptr->tim_stealth > v) return FALSE;
                }
-               else if (!IS_TIM_STEALTH())
+               else if (!is_time_limit_stealth(creature_ptr))
                {
                        msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
                        notice = TRUE;
index 2c9b885..53701f7 100644 (file)
@@ -3659,7 +3659,7 @@ void calc_bonuses(player_type *creature_ptr)
        /* Affect Skill -- stealth (bonus one) */
        creature_ptr->skill_stl += 1;
 
-       if (IS_TIM_STEALTH()) creature_ptr->skill_stl += 99;
+       if (is_time_limit_stealth(creature_ptr)) creature_ptr->skill_stl += 99;
 
        /* Affect Skill -- disarming (DEX and INT) */
        creature_ptr->skill_dis += adj_dex_dis[creature_ptr->stat_ind[A_DEX]];
@@ -5931,42 +5931,56 @@ bool is_blessed(player_type *creature_ptr)
        return creature_ptr->blessed || music_singing(creature_ptr, MUSIC_BLESS) || hex_spelling(HEX_BLESS);
 }
 
+
 bool is_oppose_acid(player_type *creature_ptr)
 {
        return creature_ptr->oppose_acid || music_singing(creature_ptr, MUSIC_RESIST) || (creature_ptr->special_defense & KATA_MUSOU);
 }
 
+
 bool is_oppose_elec(player_type *creature_ptr)
 {
        return creature_ptr->oppose_elec || music_singing(creature_ptr, MUSIC_RESIST) || (creature_ptr->special_defense & KATA_MUSOU);
 }
 
+
 bool is_oppose_fire(player_type *creature_ptr)
 {
        return creature_ptr->oppose_fire || music_singing(creature_ptr, MUSIC_RESIST) || (creature_ptr->special_defense & KATA_MUSOU);
 }
 
+
 bool is_oppose_cold(player_type *creature_ptr)
 {
        return creature_ptr->oppose_cold || music_singing(creature_ptr, MUSIC_RESIST) || (creature_ptr->special_defense & KATA_MUSOU);
 }
 
+
 bool is_oppose_pois(player_type *creature_ptr)
 {
        return creature_ptr->oppose_pois || music_singing(creature_ptr, MUSIC_RESIST) || (creature_ptr->special_defense & KATA_MUSOU);
 }
 
+
 bool is_tim_esp(player_type *creature_ptr)
 {
        return creature_ptr->tim_esp || music_singing(creature_ptr, MUSIC_MIND) || (creature_ptr->concent >= CONCENT_TELE_THRESHOLD);
 }
 
+
 bool is_tim_stealth(player_type *creature_ptr)
 {
        return creature_ptr->tim_stealth || music_singing(creature_ptr, MUSIC_STEALTH);
 }
 
+
 bool is_time_limit_esp(player_type *creature_ptr)
 {
        return creature_ptr->tim_esp || music_singing(creature_ptr, MUSIC_MIND) || (creature_ptr->concent >= CONCENT_TELE_THRESHOLD);
-}
\ No newline at end of file
+}
+
+
+bool is_time_limit_stealth(player_type *creature_ptr)
+{
+       return creature_ptr->tim_stealth || music_singing(creature_ptr, MUSIC_STEALTH);
+}
index c8a9006..cc2c912 100644 (file)
@@ -802,7 +802,6 @@ 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_TIM_STEALTH() (p_ptr->tim_stealth || music_singing(p_ptr, MUSIC_STEALTH))
 
 #define P_PTR_KI (p_ptr->magic_num1[0])
 
@@ -813,6 +812,7 @@ 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);
 
 /*
  * Player "food" crucial values
@@ -835,5 +835,4 @@ extern bool is_time_limit_esp(player_type *creature_ptr);
 
 #define CAN_TWO_HANDS_WIELDING() (!p_ptr->riding || (p_ptr->pet_extra_flags & PF_RYOUTE))
 
-
 extern void cheat_death(player_type *creature_ptr);
index 87438f1..bab82e8 100644 (file)
@@ -643,7 +643,7 @@ static void prt_status(player_type *creature_ptr)
        if (creature_ptr->tim_sh_fire) ADD_FLG(BAR_SHFIRE);
 
        /* tim stealth */
-       if (IS_TIM_STEALTH()) ADD_FLG(BAR_STEALTH);
+       if (is_time_limit_stealth(creature_ptr)) ADD_FLG(BAR_STEALTH);
 
        if (creature_ptr->tim_sh_touki) ADD_FLG(BAR_TOUKI);