OSDN Git Service

[Refactor] #38997 set_blessed() に player_type * 引数を追加.
[hengband/hengband.git] / src / spells2.c
index 5e427e1..aed46b7 100644 (file)
@@ -915,9 +915,9 @@ bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
        if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
        int k = 3 * creature_ptr->lev;
        if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
-       if (set_poisoned(0)) ident = TRUE;
-       if (set_afraid(0)) ident = TRUE;
-       if (hp_player(50)) ident = TRUE;
+       if (set_poisoned(p_ptr, 0)) ident = TRUE;
+       if (set_afraid(p_ptr, 0)) ident = TRUE;
+       if (hp_player(p_ptr, 50)) ident = TRUE;
        if (set_stun(0)) ident = TRUE;
        if (set_cut(0)) ident = TRUE;
        return ident;
@@ -1033,7 +1033,7 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
        if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
        else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
        else if (m_idx == p_ptr->riding) resist = TRUE;
-       else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
+       else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE;
        else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
        else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
 
@@ -1112,7 +1112,7 @@ bool symbol_genocide(int power, bool player_cast)
        bool result = FALSE;
 
        /* Prevent genocide in quest levels */
-       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
        {
                msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
                return (FALSE);
@@ -1156,7 +1156,7 @@ bool mass_genocide(int power, bool player_cast)
        bool result = FALSE;
 
        /* Prevent mass genocide in quest levels */
-       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
        {
                return (FALSE);
        }
@@ -1196,7 +1196,7 @@ bool mass_genocide_undead(int power, bool player_cast)
        bool result = FALSE;
 
        /* Prevent mass genocide in quest levels */
-       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
+       if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
        {
                return (FALSE);
        }
@@ -2608,14 +2608,14 @@ bool activate_ty_curse(bool stop_ty, int *count)
                        {
                                msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
                                if (p_ptr->free_act)
-                                       set_paralyzed(p_ptr->paralyzed + randint1(3));
+                                       set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(3));
                                else
-                                       set_paralyzed(p_ptr->paralyzed + randint1(13));
+                                       set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(13));
                                stop_ty = TRUE;
                        }
                        if (!one_in_(6)) break;
                case 21: case 22: case 23:
-                       (void)do_dec_stat(randint0(6));
+                       (void)do_dec_stat(p_ptr, randint0(6));
                        if (!one_in_(6)) break;
                case 24:
                        msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
@@ -2637,7 +2637,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
                        {
                                do
                                {
-                                       (void)do_dec_stat(i);
+                                       (void)do_dec_stat(p_ptr, i);
                                }
                                while (one_in_(2));
 
@@ -3143,12 +3143,12 @@ void ring_of_power(DIRECTION dir)
                sound(SOUND_EVIL);
 
                /* Decrease all stats (permanently) */
-               (void)dec_stat(A_STR, 50, TRUE);
-               (void)dec_stat(A_INT, 50, TRUE);
-               (void)dec_stat(A_WIS, 50, TRUE);
-               (void)dec_stat(A_DEX, 50, TRUE);
-               (void)dec_stat(A_CON, 50, TRUE);
-               (void)dec_stat(A_CHR, 50, TRUE);
+               (void)dec_stat(p_ptr, A_STR, 50, TRUE);
+               (void)dec_stat(p_ptr, A_INT, 50, TRUE);
+               (void)dec_stat(p_ptr, A_WIS, 50, TRUE);
+               (void)dec_stat(p_ptr, A_DEX, 50, TRUE);
+               (void)dec_stat(p_ptr, A_CON, 50, TRUE);
+               (void)dec_stat(p_ptr, A_CHR, 50, TRUE);
 
                /* Lose some experience (permanently) */
                p_ptr->exp -= (p_ptr->exp / 4);
@@ -3507,7 +3507,7 @@ void cast_wonder(DIRECTION dir)
                dispel_monsters(150);
                slow_monsters(plev);
                sleep_monsters(plev);
-               hp_player(300);
+               hp_player(p_ptr, 300);
        }
 }
 
@@ -3556,14 +3556,14 @@ void cast_invoke_spirits(DIRECTION dir)
        {
                msg_print(_("名状し難い邪悪な存在があなたの心を通り過ぎて行った...", "An unnamable evil brushes against your mind..."));
 
-               set_afraid(p_ptr->afraid + randint1(4) + 4);
+               set_afraid(p_ptr, p_ptr->afraid + randint1(4) + 4);
        }
        else if (die < 26)
        {
                msg_print(_("あなたの頭に大量の幽霊たちの騒々しい声が押し寄せてきた...",
                        "Your head is invaded by a horde of gibbering spectral voices..."));
 
-               set_confused(p_ptr->confused + randint1(4) + 4);
+               set_confused(p_ptr, p_ptr->confused + randint1(4) + 4);
        }
        else if (die < 31)
        {
@@ -3651,7 +3651,7 @@ void cast_invoke_spirits(DIRECTION dir)
                dispel_monsters(150);
                slow_monsters(plev);
                sleep_monsters(plev);
-               hp_player(300);
+               hp_player(p_ptr, 300);
        }
 
        if (die < 31)
@@ -3725,8 +3725,8 @@ void cast_shuffle(void)
        else if (die < 26)
        {
                msg_print(_("《愚者》だ。", "It's the Fool."));
-               do_dec_stat(A_INT);
-               do_dec_stat(A_WIS);
+               do_dec_stat(p_ptr, A_INT);
+               do_dec_stat(p_ptr, A_WIS);
        }
        else if (die < 30)
        {
@@ -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)
        {
@@ -3883,7 +3883,7 @@ bool_hack vampirism(void)
        {
                if (p_ptr->food < PY_FOOD_FULL)
                        /* No heal if we are "full" */
-                       (void)hp_player(dummy);
+                       (void)hp_player(p_ptr, dummy);
                else
                        msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
 
@@ -3950,7 +3950,7 @@ bool psychometry(void)
        q = _("どのアイテムを調べますか?", "Meditate on which item? ");
        s = _("調べるアイテムがありません。", "You have nothing appropriate.");
 
-       o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
+       o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
        if (!o_ptr) return (FALSE);
 
        /* It is fully known, no information needed */
@@ -4292,7 +4292,7 @@ bool comvert_mp_to_hp(player_type *creature_ptr)
        if (creature_ptr->csp >= creature_ptr->lev / 5)
        {
                creature_ptr->csp -= creature_ptr->lev / 5;
-               hp_player(creature_ptr->lev);
+               hp_player(p_ptr, creature_ptr->lev);
        }
        else
        {
@@ -4401,7 +4401,7 @@ bool rodeo(player_type *creature_ptr)
        if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
        if (rlev > 60) rlev = 60 + (rlev - 60) / 2;
        if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev)
-               && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->inside_battle
+               && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->phase_out
                && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
                && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
        {