OSDN Git Service

[Refactor] #38997 set_slow() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Sat, 22 Jun 2019 02:05:24 +0000 (11:05 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 22 Jun 2019 02:05:24 +0000 (11:05 +0900)
src/cmd-basic.c
src/cmd-quaff.c
src/cmd-usestaff.c
src/core.c
src/melee1.c
src/mspells4.c
src/player-effects.c
src/player-effects.h
src/spells1.c
src/trap.c

index 2eea63f..8cf821f 100644 (file)
@@ -2308,7 +2308,7 @@ void do_cmd_fire(SPELL_IDX snipe_type)
        if (snipe_type == SP_FINAL)
        {
                msg_print(_("射撃の反動が体を襲った。", "A reactionary of shooting attacked you. "));
-               (void)set_slow(p_ptr->slow + randint0(7) + 7, FALSE);
+               (void)set_slow(p_ptr, p_ptr->slow + randint0(7) + 7, FALSE);
                (void)set_stun(p_ptr->stun + randint1(25));
        }
 }
index 8c95f07..4eff4cb 100644 (file)
@@ -128,7 +128,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
                        break;
 
                case SV_POTION_SLOWNESS:
-                       if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
+                       if (set_slow(p_ptr, randint1(25) + 15, FALSE)) ident = TRUE;
                        break;
 
                case SV_POTION_SALT_WATER:
index 6ceddcd..73b2ec8 100644 (file)
@@ -49,7 +49,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
 
                case SV_STAFF_SLOWNESS:
                {
-                       if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
+                       if (set_slow(p_ptr, p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
                        break;
                }
 
index c38320a..966fe1c 100644 (file)
@@ -1977,7 +1977,7 @@ static void process_world_aux_timeout(void)
        /* Slow */
        if (p_ptr->slow)
        {
-               (void)set_slow(p_ptr->slow - dec_count, TRUE);
+               (void)set_slow(p_ptr, p_ptr->slow - dec_count, TRUE);
        }
 
        /* Protection from evil */
@@ -2282,7 +2282,7 @@ static void process_world_aux_mutation(void)
                        }
                        else
                        {
-                               set_slow(randint1(30) + 10, FALSE);
+                               set_slow(p_ptr, randint1(30) + 10, FALSE);
                        }
                }
                else
@@ -2291,7 +2291,7 @@ static void process_world_aux_mutation(void)
 
                        if (p_ptr->slow > 0)
                        {
-                               set_slow(0, TRUE);
+                               set_slow(p_ptr, 0, TRUE);
                        }
                        else
                        {
index c7c8793..9cf4f19 100644 (file)
@@ -3633,7 +3633,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                        }
                                        else
                                        {
-                                               if (set_slow((p_ptr->slow + 4 + randint0(rlev / 10)), FALSE))
+                                               if (set_slow(p_ptr, (p_ptr->slow + 4 + randint0(rlev / 10)), FALSE))
                                                {
                                                        obvious = TRUE;
                                                }
index 6f55fcc..3c81e9c 100644 (file)
@@ -1618,7 +1618,7 @@ void spell_RF5_SLOW(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
 
                if (!resist && !saving_throw)
                {
-                       (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
+                       (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
                }
                learn_spell(MS_SLOW);
                update_smart_learn(m_idx, DRS_FREE);
index c901181..1a95527 100644 (file)
@@ -292,7 +292,7 @@ void dispel_player(void)
 {
        (void)set_fast(p_ptr, 0, TRUE);
        (void)set_lightspeed(0, TRUE);
-       (void)set_slow(0, TRUE);
+       (void)set_slow(p_ptr, 0, TRUE);
        (void)set_shield(0, TRUE);
        (void)set_blessed(0, TRUE);
        (void)set_tsuyoshi(0, TRUE);
@@ -885,21 +885,21 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_slow(TIME_EFFECT v, bool do_dec)
+bool set_slow(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->slow && !do_dec)
+               if (creature_ptr->slow && !do_dec)
                {
-                       if (p_ptr->slow > v) return FALSE;
+                       if (creature_ptr->slow > v) return FALSE;
                }
-               else if (!p_ptr->slow)
+               else if (!creature_ptr->slow)
                {
                        msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
                        notice = TRUE;
@@ -909,7 +909,7 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
        /* Shut */
        else
        {
-               if (p_ptr->slow)
+               if (creature_ptr->slow)
                {
                        msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
                        notice = TRUE;
@@ -917,13 +917,13 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
        }
 
        /* Use the value */
-       p_ptr->slow = v;
+       creature_ptr->slow = v;
 
        /* 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 00a081b..4f0bf63 100644 (file)
@@ -22,7 +22,7 @@ extern bool set_afraid(player_type *creature_ptr, TIME_EFFECT v);
 extern bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v);
 extern bool set_image(player_type *creature_ptr, TIME_EFFECT v);
 extern bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-extern bool set_slow(TIME_EFFECT v, bool do_dec);
+extern bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
 extern bool set_shield(TIME_EFFECT v, bool do_dec);
 extern bool set_tsubureru(TIME_EFFECT v, bool do_dec);
 extern bool set_magicdef(TIME_EFFECT v, bool do_dec);
index 1708679..cf19deb 100644 (file)
@@ -4498,7 +4498,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                case GF_INERTIAL:
                {
                        if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
-                       if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
+                       if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
                        get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
                        break;
                }
@@ -4634,7 +4634,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                        {
                                teleport_player(5, TELEPORT_PASSIVE);
                                if (!p_ptr->levitation)
-                                       (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
+                                       (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
                                if (!(p_ptr->resist_sound || p_ptr->levitation))
                                {
                                        int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
@@ -4684,7 +4684,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                case GF_OLD_SLOW:
                {
                        if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
-                       (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
+                       (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
                        break;
                }
 
@@ -4936,7 +4936,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                                        {
                                                (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4);
                                        }
-                                       (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
+                                       (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
 
                                        while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
                                                (void)do_dec_stat(p_ptr, A_INT);
index b08ecfd..701ae96 100644 (file)
@@ -366,7 +366,7 @@ static void hit_trap_slow(void)
 {
        if (hit_trap_dart())
        {
-               set_slow(p_ptr->slow + randint0(20) + 20, FALSE);
+               set_slow(p_ptr, p_ptr->slow + randint0(20) + 20, FALSE);
        }
 }