OSDN Git Service

[Refactor] #38997 py_attack() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Tue, 3 Sep 2019 10:53:48 +0000 (19:53 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 3 Sep 2019 10:53:48 +0000 (19:53 +0900)
src/cmd/cmd-basic.c
src/cmd/cmd-pet.c
src/combat/melee.h
src/combat/melee1.c
src/mind.c
src/player-move.c
src/realm-hissatsu.c
src/spells1.c
src/spells2.c
src/spells3.c

index 793c344..e99ad92 100644 (file)
@@ -887,7 +887,7 @@ void do_cmd_open(player_type *creature_ptr)
                {
                        take_turn(creature_ptr, 100);
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
                else if (o_idx)
                {
@@ -1026,7 +1026,7 @@ void do_cmd_close(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
 
                /* Close the door */
@@ -1265,7 +1265,7 @@ void do_cmd_tunnel(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
 
                /* Try digging */
@@ -1614,7 +1614,7 @@ void do_cmd_disarm(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
 
                /* Disarm chest */
@@ -1795,7 +1795,7 @@ void do_cmd_bash(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
 
                /* Bash a closed door */
@@ -1868,7 +1868,7 @@ void do_cmd_alter(player_type *creature_ptr)
 
                if (g_ptr->m_idx)
                {
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
 
                /* Locked doors */
@@ -2002,7 +2002,7 @@ void do_cmd_spike(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
 
                /* Go for it */
index 5186c56..04395bc 100644 (file)
@@ -303,7 +303,7 @@ bool do_cmd_riding(player_type *creature_ptr, bool force)
 
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                        return FALSE;
                }
 
index 359781a..4833aa2 100644 (file)
@@ -1,5 +1,5 @@
 
-typedef int COMBAT_OPTION_IDX; // py_attack()用コンバットオプション型定義
+typedef int COMBAT_OPTION_IDX; // py_attack(p_ptr, )用コンバットオプション型定義
 
 
 #ifdef JP
@@ -154,7 +154,7 @@ extern bool test_hit_norm(HIT_RELIABILITY chance, ARMOUR_CLASS ac, bool visible)
 extern PERCENTAGE hit_chance(HIT_RELIABILITY chance, ARMOUR_CLASS ac);
 extern HIT_POINT tot_dam_aux(player_type *attacker_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown);
 extern HIT_POINT critical_norm(WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode);
-extern bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode);
+extern bool py_attack(player_type *attacker_ptr, POSITION y, POSITION x, COMBAT_OPTION_IDX mode);
 extern bool make_attack_normal(MONSTER_IDX m_idx);
 extern void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who);
 extern bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx);
index c761d07..507e122 100644 (file)
@@ -2166,7 +2166,7 @@ static void py_attack_aux(player_type *attacker_ptr, POSITION y, POSITION x, boo
 * @details
 * If no "weapon" is available, then "punch" the monster one time.
 */
-bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
+bool py_attack(player_type *attacker_ptr, POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
 {
        bool            fear = FALSE;
        bool            mdeath = FALSE;
@@ -2177,15 +2177,15 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
        GAME_TEXT m_name[MAX_NLEN];
 
-       disturb(p_ptr, FALSE, TRUE);
+       disturb(attacker_ptr, FALSE, TRUE);
 
-       take_turn(p_ptr, 100);
+       take_turn(attacker_ptr, 100);
 
-       if (!p_ptr->migite && !p_ptr->hidarite &&
-               !(p_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
+       if (!attacker_ptr->migite && !attacker_ptr->hidarite &&
+               !(attacker_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
        {
                msg_format(_("%s攻撃できない。", "You cannot do attacking."),
-                       (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE) ? _("両手がふさがって", "") : "");
+                       (empty_hands(attacker_ptr, FALSE) == EMPTY_HAND_NONE) ? _("両手がふさがって", "") : "");
                return FALSE;
        }
 
@@ -2194,22 +2194,22 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
        if (m_ptr->ml)
        {
                /* Auto-Recall if possible and visible */
-               if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
+               if (!attacker_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                health_track(g_ptr->m_idx);
        }
 
        if ((r_ptr->flags1 & RF1_FEMALE) &&
-               !(p_ptr->stun || p_ptr->confused || p_ptr->image || !m_ptr->ml))
+               !(attacker_ptr->stun || attacker_ptr->confused || attacker_ptr->image || !m_ptr->ml))
        {
-               if ((p_ptr->inventory_list[INVEN_RARM].name1 == ART_ZANTETSU) || (p_ptr->inventory_list[INVEN_LARM].name1 == ART_ZANTETSU))
+               if ((attacker_ptr->inventory_list[INVEN_RARM].name1 == ART_ZANTETSU) || (attacker_ptr->inventory_list[INVEN_LARM].name1 == ART_ZANTETSU))
                {
                        msg_print(_("拙者、おなごは斬れぬ!", "I can not attack women!"));
                        return FALSE;
                }
        }
 
-       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
+       if (d_info[attacker_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
        {
                msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
                return FALSE;
@@ -2217,27 +2217,27 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
 
        /* Stop if friendly */
        if (!is_hostile(m_ptr) &&
-               !(p_ptr->stun || p_ptr->confused || p_ptr->image ||
-                       p_ptr->shero || !m_ptr->ml))
+               !(attacker_ptr->stun || attacker_ptr->confused || attacker_ptr->image ||
+                       attacker_ptr->shero || !m_ptr->ml))
        {
-               if (p_ptr->inventory_list[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
-               if (p_ptr->inventory_list[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
+               if (attacker_ptr->inventory_list[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
+               if (attacker_ptr->inventory_list[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
                if (stormbringer)
                {
                        msg_format(_("黒い刃は強欲に%sを攻撃した!", "Your black blade greedily attacks %s!"), m_name);
-                       chg_virtue(p_ptr, V_INDIVIDUALISM, 1);
-                       chg_virtue(p_ptr, V_HONOUR, -1);
-                       chg_virtue(p_ptr, V_JUSTICE, -1);
-                       chg_virtue(p_ptr, V_COMPASSION, -1);
+                       chg_virtue(attacker_ptr, V_INDIVIDUALISM, 1);
+                       chg_virtue(attacker_ptr, V_HONOUR, -1);
+                       chg_virtue(attacker_ptr, V_JUSTICE, -1);
+                       chg_virtue(attacker_ptr, V_COMPASSION, -1);
                }
-               else if (p_ptr->pclass != CLASS_BERSERKER)
+               else if (attacker_ptr->pclass != CLASS_BERSERKER)
                {
                        if (get_check(_("本当に攻撃しますか?", "Really hit it? ")))
                        {
-                               chg_virtue(p_ptr, V_INDIVIDUALISM, 1);
-                               chg_virtue(p_ptr, V_HONOUR, -1);
-                               chg_virtue(p_ptr, V_JUSTICE, -1);
-                               chg_virtue(p_ptr, V_COMPASSION, -1);
+                               chg_virtue(attacker_ptr, V_INDIVIDUALISM, 1);
+                               chg_virtue(attacker_ptr, V_HONOUR, -1);
+                               chg_virtue(attacker_ptr, V_JUSTICE, -1);
+                               chg_virtue(attacker_ptr, V_COMPASSION, -1);
                        }
                        else
                        {
@@ -2249,7 +2249,7 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
 
 
        /* Handle player fear */
-       if (p_ptr->afraid)
+       if (attacker_ptr->afraid)
        {
                if (m_ptr->ml)
                        msg_format(_("恐くて%sを攻撃できない!", "You are too afraid to attack %s!"), m_name);
@@ -2264,35 +2264,35 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
 
        if (MON_CSLEEP(m_ptr)) /* It is not honorable etc to attack helpless victims */
        {
-               if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(p_ptr, V_COMPASSION, -1);
-               if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(p_ptr, V_HONOUR, -1);
+               if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(attacker_ptr, V_COMPASSION, -1);
+               if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(attacker_ptr, V_HONOUR, -1);
        }
 
-       if (p_ptr->migite && p_ptr->hidarite)
+       if (attacker_ptr->migite && attacker_ptr->hidarite)
        {
-               if ((p_ptr->skill_exp[GINOU_NITOURYU] < s_info[p_ptr->pclass].s_max[GINOU_NITOURYU]) && ((p_ptr->skill_exp[GINOU_NITOURYU] - 1000) / 200 < r_ptr->level))
+               if ((attacker_ptr->skill_exp[GINOU_NITOURYU] < s_info[attacker_ptr->pclass].s_max[GINOU_NITOURYU]) && ((attacker_ptr->skill_exp[GINOU_NITOURYU] - 1000) / 200 < r_ptr->level))
                {
-                       if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_BEGINNER)
-                               p_ptr->skill_exp[GINOU_NITOURYU] += 80;
-                       else if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_SKILLED)
-                               p_ptr->skill_exp[GINOU_NITOURYU] += 4;
-                       else if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_EXPERT)
-                               p_ptr->skill_exp[GINOU_NITOURYU] += 1;
-                       else if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_MASTER)
-                               if (one_in_(3)) p_ptr->skill_exp[GINOU_NITOURYU] += 1;
-                       p_ptr->update |= (PU_BONUS);
+                       if (attacker_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_BEGINNER)
+                               attacker_ptr->skill_exp[GINOU_NITOURYU] += 80;
+                       else if (attacker_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_SKILLED)
+                               attacker_ptr->skill_exp[GINOU_NITOURYU] += 4;
+                       else if (attacker_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_EXPERT)
+                               attacker_ptr->skill_exp[GINOU_NITOURYU] += 1;
+                       else if (attacker_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_MASTER)
+                               if (one_in_(3)) attacker_ptr->skill_exp[GINOU_NITOURYU] += 1;
+                       attacker_ptr->update |= (PU_BONUS);
                }
        }
 
        /* Gain riding experience */
-       if (p_ptr->riding)
+       if (attacker_ptr->riding)
        {
-               int cur = p_ptr->skill_exp[GINOU_RIDING];
-               int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
+               int cur = attacker_ptr->skill_exp[GINOU_RIDING];
+               int max = s_info[attacker_ptr->pclass].s_max[GINOU_RIDING];
 
                if (cur < max)
                {
-                       DEPTH ridinglevel = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level;
+                       DEPTH ridinglevel = r_info[current_floor_ptr->m_list[attacker_ptr->riding].r_idx].level;
                        DEPTH targetlevel = r_ptr->level;
                        int inc = 0;
 
@@ -2308,27 +2308,27 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
                                        inc += 1;
                        }
 
-                       p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
-                       p_ptr->update |= (PU_BONUS);
+                       attacker_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
+                       attacker_ptr->update |= (PU_BONUS);
                }
        }
 
-       p_ptr->riding_t_m_idx = g_ptr->m_idx;
-       if (p_ptr->migite) py_attack_aux(p_ptr, y, x, &fear, &mdeath, 0, mode);
-       if (p_ptr->hidarite && !mdeath) py_attack_aux(p_ptr, y, x, &fear, &mdeath, 1, mode);
+       attacker_ptr->riding_t_m_idx = g_ptr->m_idx;
+       if (attacker_ptr->migite) py_attack_aux(attacker_ptr, y, x, &fear, &mdeath, 0, mode);
+       if (attacker_ptr->hidarite && !mdeath) py_attack_aux(attacker_ptr, y, x, &fear, &mdeath, 1, mode);
 
        /* Mutations which yield extra 'natural' attacks */
        if (!mdeath)
        {
-               if ((p_ptr->muta2 & MUT2_HORNS) && !mdeath)
+               if ((attacker_ptr->muta2 & MUT2_HORNS) && !mdeath)
                        natural_attack(g_ptr->m_idx, MUT2_HORNS, &fear, &mdeath);
-               if ((p_ptr->muta2 & MUT2_BEAK) && !mdeath)
+               if ((attacker_ptr->muta2 & MUT2_BEAK) && !mdeath)
                        natural_attack(g_ptr->m_idx, MUT2_BEAK, &fear, &mdeath);
-               if ((p_ptr->muta2 & MUT2_SCOR_TAIL) && !mdeath)
+               if ((attacker_ptr->muta2 & MUT2_SCOR_TAIL) && !mdeath)
                        natural_attack(g_ptr->m_idx, MUT2_SCOR_TAIL, &fear, &mdeath);
-               if ((p_ptr->muta2 & MUT2_TRUNK) && !mdeath)
+               if ((attacker_ptr->muta2 & MUT2_TRUNK) && !mdeath)
                        natural_attack(g_ptr->m_idx, MUT2_TRUNK, &fear, &mdeath);
-               if ((p_ptr->muta2 & MUT2_TENTACLES) && !mdeath)
+               if ((attacker_ptr->muta2 & MUT2_TENTACLES) && !mdeath)
                        natural_attack(g_ptr->m_idx, MUT2_TENTACLES, &fear, &mdeath);
        }
 
@@ -2340,9 +2340,9 @@ bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
                msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
        }
 
-       if ((p_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath))
+       if ((attacker_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath))
        {
-               set_action(p_ptr, ACTION_NONE);
+               set_action(attacker_ptr, ACTION_NONE);
        }
 
        return mdeath;
@@ -2398,7 +2398,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
        if (p_ptr->special_defense & KATA_IAI)
        {
                msg_format(_("相手が襲いかかる前に素早く武器を振るった。", "You took sen, draw and cut in one motion before %s move."), m_name);
-               if (py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_IAI)) return TRUE;
+               if (py_attack(p_ptr, m_ptr->fy, m_ptr->fx, HISSATSU_IAI)) return TRUE;
        }
 
        if ((p_ptr->special_defense & NINJA_KAWARIMI) && (randint0(55) < (p_ptr->lev*3/5+20)))
@@ -4071,7 +4071,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
 
                p_ptr->csp -= 7;
                msg_format(_("%^sに反撃した!", "Your counterattack to %s!"), m_target_name);
-               py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
+               py_attack(p_ptr, m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
                fear = FALSE;
                p_ptr->redraw |= (PR_MANA);
        }
index 5a49bf3..f3c71be 100644 (file)
@@ -1493,7 +1493,7 @@ static bool cast_berserk_spell(int spell)
                        return FALSE;
                }
 
-               py_attack(y, x, 0);
+               py_attack(p_ptr, y, x, 0);
 
                if (!player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(current_floor_ptr->grid_array[y][x].feat))
                        break;
index fe02e31..0a6feed 100644 (file)
@@ -1027,7 +1027,7 @@ void move_player(player_type *creature_ptr, DIRECTION dir, bool do_pickup, bool
                        /* displace? */
                        if ((stormbringer && (randint1(1000) > 666)) || (creature_ptr->pclass == CLASS_BERSERKER))
                        {
-                               py_attack(y, x, 0);
+                               py_attack(p_ptr, y, x, 0);
                                oktomove = FALSE;
                        }
                        else if (monster_can_cross_terrain(current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0))
@@ -1045,7 +1045,7 @@ void move_player(player_type *creature_ptr, DIRECTION dir, bool do_pickup, bool
                }
                else
                {
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                        oktomove = FALSE;
                }
        }
index 4d24e6b..4f7a1cf 100644 (file)
@@ -73,21 +73,21 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        y = caster_ptr->y + ddy_cdd[cdir];
                        x = caster_ptr->x + ddx_cdd[cdir];
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, 0);
+                               py_attack(p_ptr, y, x, 0);
                        else
                                msg_print(_("攻撃は空を切った。", "You attack the empty air."));
 
                        y = caster_ptr->y + ddy_cdd[(cdir + 7) % 8];
                        x = caster_ptr->x + ddx_cdd[(cdir + 7) % 8];
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, 0);
+                               py_attack(p_ptr, y, x, 0);
                        else
                                msg_print(_("攻撃は空を切った。", "You attack the empty air."));
 
                        y = caster_ptr->y + ddy_cdd[(cdir + 1) % 8];
                        x = caster_ptr->x + ddx_cdd[(cdir + 1) % 8];
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, 0);
+                               py_attack(p_ptr, y, x, 0);
                        else
                                msg_print(_("攻撃は空を切った。", "You attack the empty air."));
                }
@@ -119,7 +119,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_FIRE);
+                               py_attack(p_ptr, y, x, HISSATSU_FIRE);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -153,7 +153,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_MINEUCHI);
+                               py_attack(p_ptr, y, x, HISSATSU_MINEUCHI);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -206,7 +206,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                                return NULL;
                        }
 
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
 
                        if (!player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(current_floor_ptr->grid_array[y][x].feat))
                                break;
@@ -237,7 +237,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_POISON);
+                               py_attack(p_ptr, y, x, HISSATSU_POISON);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -262,7 +262,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_ZANMA);
+                               py_attack(p_ptr, y, x, HISSATSU_ZANMA);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -286,7 +286,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, 0);
+                               py_attack(p_ptr, y, x, 0);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -370,7 +370,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_HAGAN);
+                               py_attack(p_ptr, y, x, HISSATSU_HAGAN);
 
                        if (!cave_have_flag_bold(y, x, FF_HURT_ROCK)) break;
 
@@ -396,7 +396,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_COLD);
+                               py_attack(p_ptr, y, x, HISSATSU_COLD);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -421,7 +421,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_KYUSHO);
+                               py_attack(p_ptr, y, x, HISSATSU_KYUSHO);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -446,7 +446,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_MAJIN);
+                               py_attack(p_ptr, y, x, HISSATSU_MAJIN);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -471,7 +471,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_SUTEMI);
+                               py_attack(p_ptr, y, x, HISSATSU_SUTEMI);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -497,7 +497,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_ELEC);
+                               py_attack(p_ptr, y, x, HISSATSU_ELEC);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -550,7 +550,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                                                monster_desc(m_name, m_ptr, 0);
                                                msg_format(_("%sには効果がない!", "%s is unharmed!"), m_name);
                                        }
-                                       else py_attack(y, x, HISSATSU_SEKIRYUKA);
+                                       else py_attack(p_ptr, y, x, HISSATSU_SEKIRYUKA);
                                }
                        }
                }
@@ -571,7 +571,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_QUAKE);
+                               py_attack(p_ptr, y, x, HISSATSU_QUAKE);
                        else
                                earthquake(caster_ptr->y, caster_ptr->x, 10, 0);
                }
@@ -655,7 +655,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                                g_ptr = &current_floor_ptr->grid_array[y][x];
 
                                if (g_ptr->m_idx)
-                                       py_attack(y, x, HISSATSU_3DAN);
+                                       py_attack(p_ptr, y, x, HISSATSU_3DAN);
                                else
                                {
                                        msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -728,7 +728,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_DRAIN);
+                               py_attack(p_ptr, y, x, HISSATSU_DRAIN);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -830,11 +830,11 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
                        {
-                               py_attack(y, x, 0);
+                               py_attack(p_ptr, y, x, 0);
                                if (current_floor_ptr->grid_array[y][x].m_idx)
                                {
                                        handle_stuff();
-                                       py_attack(y, x, 0);
+                                       py_attack(p_ptr, y, x, 0);
                                }
                        }
                        else
@@ -913,7 +913,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        x = caster_ptr->x + ddx[dir];
 
                        if (current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(y, x, HISSATSU_UNDEAD);
+                               py_attack(p_ptr, y, x, HISSATSU_UNDEAD);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
index 2e82767..9b95ff9 100644 (file)
@@ -3366,7 +3366,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
                        case GF_ATTACK:
                        {
                                /* Return this monster's death */
-                               return py_attack(y, x, dam);
+                               return py_attack(p_ptr, y, x, dam);
                        }
 
                        /* Sleep (Use "dam" as "power") */
index 04f58c9..9aea4a0 100644 (file)
@@ -3090,7 +3090,7 @@ bool rush_attack(bool *mdeath)
 
                if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
                moved = TRUE;
-               tmp_mdeath = py_attack(ny, nx, HISSATSU_NYUSIN);
+               tmp_mdeath = py_attack(p_ptr, ny, nx, HISSATSU_NYUSIN);
 
                break;
        }
@@ -3911,7 +3911,7 @@ bool panic_hit(void)
        x = p_ptr->x + ddx[dir];
        if (current_floor_ptr->grid_array[y][x].m_idx)
        {
-               py_attack(y, x, 0);
+               py_attack(p_ptr, y, x, 0);
                if (randint0(p_ptr->skill_dis) < 7)
                        msg_print(_("うまく逃げられなかった。", "You failed to run away."));
                else
@@ -4252,11 +4252,11 @@ bool double_attack(player_type *creature_ptr)
                        msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
                                "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
 
-               py_attack(y, x, 0);
+               py_attack(p_ptr, y, x, 0);
                if (current_floor_ptr->grid_array[y][x].m_idx)
                {
                        handle_stuff();
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                }
                creature_ptr->energy_need += ENERGY_NEED();
        }
@@ -4356,7 +4356,7 @@ bool sword_dancing(player_type *creature_ptr)
 
                /* Hack -- attack monsters */
                if (g_ptr->m_idx)
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
                else
                {
                        msg_print(_("攻撃が空をきった。", "You attack the empty air."));
index 8aa4135..9e66f77 100644 (file)
@@ -3297,7 +3297,7 @@ void massacre(void)
 
                /* Hack -- attack monsters */
                if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
-                       py_attack(y, x, 0);
+                       py_attack(p_ptr, y, x, 0);
        }
 }
 
@@ -3330,7 +3330,7 @@ bool eat_lock(void)
                monster_type *m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
                msg_print(_("何かが邪魔しています!", "There's something in the way!"));
 
-               if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(y, x, 0);
+               if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(p_ptr, y, x, 0);
        }
        else if (have_flag(f_ptr->flags, FF_TREE))
        {