OSDN Git Service

[Refactor] #38997 set_blessed() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Sat, 22 Jun 2019 02:46:59 +0000 (11:46 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 22 Jun 2019 02:46:59 +0000 (11:46 +0900)
src/cmd-activate.c
src/cmd-read.c
src/core.c
src/player-effects.c
src/player-effects.h
src/realm-crusade.c
src/realm-daemon.c
src/realm-life.c
src/spells-status.c
src/spells2.c

index 7a8641d..64cbf3d 100644 (file)
@@ -1037,7 +1037,7 @@ bool activate_artifact(object_type *o_ptr)
                (void)set_afraid(p_ptr, 0);
                (void)set_hero(randint1(50) + 50, FALSE);
                (void)hp_player(p_ptr, 10);
-               (void)set_blessed(randint1(50) + 50, FALSE);
+               (void)set_blessed(p_ptr, randint1(50) + 50, FALSE);
                (void)set_oppose_acid(randint1(50) + 50, FALSE);
                (void)set_oppose_elec(randint1(50) + 50, FALSE);
                (void)set_oppose_fire(randint1(50) + 50, FALSE);
@@ -1687,7 +1687,7 @@ bool activate_artifact(object_type *o_ptr)
                (void)set_afraid(p_ptr, 0);
                (void)set_hero(v, FALSE);
                (void)hp_player(p_ptr, 10);
-               (void)set_blessed(v, FALSE);
+               (void)set_blessed(p_ptr, v, FALSE);
                (void)set_oppose_acid(v, FALSE);
                (void)set_oppose_elec(v, FALSE);
                (void)set_oppose_fire(v, FALSE);
index a478e04..c333e32 100644 (file)
@@ -339,19 +339,19 @@ void exe_read(INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_BLESSING:
                {
-                       if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
+                       if (set_blessed(p_ptr, p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
                        break;
                }
 
                case SV_SCROLL_HOLY_CHANT:
                {
-                       if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
+                       if (set_blessed(p_ptr, p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
                        break;
                }
 
                case SV_SCROLL_HOLY_PRAYER:
                {
-                       if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
+                       if (set_blessed(p_ptr, p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
                        break;
                }
 
index 8b8aed7..667729b 100644 (file)
@@ -2013,7 +2013,7 @@ static void process_world_aux_timeout(void)
        /* Blessed */
        if (p_ptr->blessed)
        {
-               (void)set_blessed(p_ptr->blessed - 1, TRUE);
+               (void)set_blessed(p_ptr, p_ptr->blessed - 1, TRUE);
        }
 
        /* Shield */
index 67180b9..09bee03 100644 (file)
@@ -294,7 +294,7 @@ void dispel_player(void)
        (void)set_lightspeed(0, TRUE);
        (void)set_slow(p_ptr, 0, TRUE);
        (void)set_shield(p_ptr, 0, TRUE);
-       (void)set_blessed(0, TRUE);
+       (void)set_blessed(p_ptr, 0, TRUE);
        (void)set_tsuyoshi(0, TRUE);
        (void)set_hero(0, TRUE);
        (void)set_shero(0, TRUE);
@@ -1087,19 +1087,19 @@ bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_blessed(TIME_EFFECT v, bool do_dec)
+bool set_blessed(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->blessed && !do_dec)
+               if (creature_ptr->blessed && !do_dec)
                {
-                       if (p_ptr->blessed > v) return FALSE;
+                       if (creature_ptr->blessed > v) return FALSE;
                }
                else if (!IS_BLESSED())
                {
@@ -1111,7 +1111,7 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
+               if (creature_ptr->blessed && !music_singing(MUSIC_BLESS))
                {
                        msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
                        notice = TRUE;
@@ -1119,14 +1119,14 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->blessed = v;
-       p_ptr->redraw |= (PR_STATUS);
+       creature_ptr->blessed = v;
+       creature_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-       p_ptr->update |= (PU_BONUS);
+       creature_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
 }
index 82d14e3..890c40f 100644 (file)
@@ -26,7 +26,7 @@ extern bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-extern bool set_blessed(TIME_EFFECT v, bool do_dec);
+extern bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_hero(TIME_EFFECT v, bool do_dec);
 extern bool set_shero(TIME_EFFECT v, bool do_dec);
 extern bool set_protevil(TIME_EFFECT v, bool do_dec);
index 4a87205..1fa6630 100644 (file)
@@ -566,7 +566,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
                                }
                                set_hero(randint1(base) + base, FALSE);
-                               set_blessed(randint1(base) + base, FALSE);
+                               set_blessed(p_ptr, randint1(base) + base, FALSE);
                                set_fast(p_ptr, randint1(sp_sides) + sp_base, FALSE);
                                set_protevil(randint1(base) + base, FALSE);
                                set_afraid(p_ptr, 0);
index d8fb246..fa158a8 100644 (file)
@@ -78,7 +78,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               set_blessed(randint1(base) + base, FALSE);
+                               set_blessed(p_ptr, randint1(base) + base, FALSE);
                        }
                }
                break;
index 8ce0622..2fdb44f 100644 (file)
@@ -47,7 +47,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               set_blessed(randint1(base) + base, FALSE);
+                               set_blessed(p_ptr, randint1(base) + base, FALSE);
                        }
                }
                break;
index 2c8ef2a..bcb1b6b 100644 (file)
@@ -464,7 +464,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
        (void)set_tim_esp(creature_ptr->tim_esp + t, FALSE);
        (void)set_tim_regen(creature_ptr->tim_regen + t, FALSE);
        (void)set_hero(creature_ptr->hero + t, FALSE);
-       (void)set_blessed(creature_ptr->blessed + t, FALSE);
+       (void)set_blessed(p_ptr, creature_ptr->blessed + t, FALSE);
        (void)set_fast(p_ptr, creature_ptr->fast + t, FALSE);
        (void)set_shero(creature_ptr->shero + t, FALSE);
        if (creature_ptr->pclass == CLASS_FORCETRAINER)
index c063300..aed46b7 100644 (file)
@@ -3751,7 +3751,7 @@ void cast_shuffle(void)
        else if (die < 42)
        {
                msg_print(_("《正義》だ。", "It's Justice."));
-               set_blessed(p_ptr->lev, FALSE);
+               set_blessed(p_ptr, p_ptr->lev, FALSE);
        }
        else if (die < 47)
        {