OSDN Git Service

[Refactor] #38997 set_oppose_cold() に player_type * 引数を追加.
[hengband/hengband.git] / src / player-effects.c
index cd443dd..7f968f9 100644 (file)
@@ -324,7 +324,7 @@ void dispel_player(void)
        (void)set_oppose_acid(p_ptr, 0, TRUE);
        (void)set_oppose_elec(p_ptr, 0, TRUE);
        (void)set_oppose_fire(p_ptr, 0, TRUE);
-       (void)set_oppose_cold(0, TRUE);
+       (void)set_oppose_cold(p_ptr, 0, TRUE);
        (void)set_oppose_pois(0, TRUE);
        (void)set_ultimate_res(0, TRUE);
        (void)set_mimic(p_ptr, 0, 0, TRUE);
@@ -2578,19 +2578,19 @@ bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
+bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
-       if (p_ptr->is_dead) return FALSE;
+       if (creature_ptr->is_dead) return FALSE;
 
        /* Open */
        if (v)
        {
-               if (p_ptr->oppose_cold && !do_dec)
+               if (creature_ptr->oppose_cold && !do_dec)
                {
-                       if (p_ptr->oppose_cold > v) return FALSE;
+                       if (creature_ptr->oppose_cold > v) return FALSE;
                }
                else if (!IS_OPPOSE_COLD())
                {
@@ -2602,7 +2602,7 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
+               if (creature_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
                {
                        msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
                        notice = TRUE;
@@ -2610,11 +2610,11 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->oppose_cold = v;
+       creature_ptr->oppose_cold = v;
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->redraw |= (PR_STATUS);
 
        if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();