OSDN Git Service

[Refactor] #38997 IS_TIM_ESP() の関数マクロを普通の関数 is_time_limit_esp()に変更し、player_type ...
authorHourier <hourier@users.sourceforge.jp>
Sun, 12 Jan 2020 09:12:05 +0000 (18:12 +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 7a3e42b..fa2b3ae 100644 (file)
@@ -1396,13 +1396,12 @@ bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                {
                        if (creature_ptr->tim_esp > v) return FALSE;
                }
-               else if (!IS_TIM_ESP())
+               else if (!is_time_limit_esp(creature_ptr))
                {
                        msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
                        notice = TRUE;
                }
        }
-
        else
        {
                if (creature_ptr->tim_esp && !music_singing(creature_ptr, MUSIC_MIND))
@@ -4221,4 +4220,3 @@ bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
        screen_load();
        return TRUE;
 }
-
index ca51932..2c9b885 100644 (file)
@@ -2921,7 +2921,7 @@ void calc_bonuses(player_type *creature_ptr)
        }
 
        /* Temporary "telepathy" */
-       if (IS_TIM_ESP())
+       if (is_time_limit_esp(creature_ptr))
        {
                creature_ptr->telepathy = TRUE;
        }
@@ -5965,3 +5965,8 @@ 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
index e0d8ff6..c8a9006 100644 (file)
@@ -802,17 +802,17 @@ 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_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 P_PTR_KI (p_ptr->magic_num1[0])
 
-extern bool is_blessed(player_type *player_ptr);
-extern bool is_oppose_acid(player_type *player_ptr);
-extern bool is_oppose_elec(player_type *player_ptr);
-extern bool is_oppose_fire(player_type *player_ptr);
-extern bool is_oppose_cold(player_type *player_ptr);
-extern bool is_oppose_pois(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);
 
 /*
  * Player "food" crucial values
index d7fbe26..87438f1 100644 (file)
@@ -544,7 +544,7 @@ static void prt_status(player_type *creature_ptr)
        if (creature_ptr->tim_invis) ADD_FLG(BAR_SENSEUNSEEN);
 
        /* Timed esp */
-       if (IS_TIM_ESP()) ADD_FLG(BAR_TELEPATHY);
+       if (is_time_limit_esp(creature_ptr)) ADD_FLG(BAR_TELEPATHY);
 
        /* Timed regenerate */
        if (creature_ptr->tim_regen) ADD_FLG(BAR_REGENERATION);