OSDN Git Service

[Refactor] #40416 Renamed py_attack() to do_cmd_attack()
authorHourier <hourier@users.sourceforge.jp>
Thu, 21 May 2020 08:56:22 +0000 (17:56 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 21 May 2020 08:56:22 +0000 (17:56 +0900)
src/cmd/cmd-basic.c
src/cmd/cmd-pet.c
src/combat/melee.c
src/combat/melee.h
src/effect/effect-monster-switcher.c
src/mind/mind.c
src/player/player-move.c
src/realm/realm-hissatsu.c
src/spell/spells2.c
src/spell/spells3.c

index 07048f9..38fd506 100644 (file)
@@ -853,7 +853,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(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                }
                else if (o_idx)
                {
@@ -996,7 +996,7 @@ void do_cmd_close(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                }
 
                /* Close the door */
@@ -1236,7 +1236,7 @@ void do_cmd_tunnel(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                }
 
                /* Try digging */
@@ -1587,7 +1587,7 @@ void do_cmd_disarm(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                }
 
                /* Disarm chest */
@@ -1769,7 +1769,7 @@ void do_cmd_bash(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                }
 
                /* Bash a closed door */
@@ -1842,7 +1842,7 @@ void do_cmd_alter(player_type *creature_ptr)
 
                if (g_ptr->m_idx)
                {
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                }
 
                /* Locked doors */
@@ -1974,7 +1974,7 @@ void do_cmd_spike(player_type *creature_ptr)
                msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                /* Attack */
-               py_attack(creature_ptr, y, x, 0);
+               do_cmd_attack(creature_ptr, y, x, 0);
        }
 
        /* Go for it */
index 504aff6..d3b63dd 100644 (file)
@@ -247,7 +247,7 @@ bool do_cmd_riding(player_type *creature_ptr, bool force)
 
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                        return FALSE;
                }
 
index 790e8b1..3fb2504 100644 (file)
@@ -1690,7 +1690,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(player_type *attacker_ptr, POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
+bool do_cmd_attack(player_type *attacker_ptr, POSITION y, POSITION x, COMBAT_OPTION_IDX mode)
 {
        grid_type       *g_ptr = &attacker_ptr->current_floor_ptr->grid_array[y][x];
        monster_type    *m_ptr = &attacker_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
@@ -1919,7 +1919,7 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
        if (target_ptr->special_defense & KATA_IAI)
        {
                msg_format(_("相手が襲いかかる前に素早く武器を振るった。", "You took sen, drew and cut in one motion before %s moved."), m_name);
-               if (py_attack(target_ptr, m_ptr->fy, m_ptr->fx, HISSATSU_IAI)) return TRUE;
+               if (do_cmd_attack(target_ptr, m_ptr->fy, m_ptr->fx, HISSATSU_IAI)) return TRUE;
        }
 
        if ((target_ptr->special_defense & NINJA_KAWARIMI) && (randint0(55) < (target_ptr->lev*3/5+20)))
@@ -3589,7 +3589,7 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
 
                target_ptr->csp -= 7;
                msg_format(_("%^sに反撃した!", "You counterattacked %s!"), m_target_name);
-               py_attack(target_ptr, m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
+               do_cmd_attack(target_ptr, m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
                fear = FALSE;
                target_ptr->redraw |= (PR_MANA);
        }
index b621bf9..f3e3a23 100644 (file)
@@ -1,5 +1,5 @@
 
-typedef int COMBAT_OPTION_IDX; // py_attack()用コンバットオプション型定義
+typedef int COMBAT_OPTION_IDX; // do_cmd_attack()用コンバットオプション型定義
 
 /*** Monster blow constants ***/
 
@@ -110,7 +110,7 @@ extern bool test_hit_norm(player_type *attacker_ptr, HIT_RELIABILITY chance, ARM
 extern PERCENTAGE hit_chance(player_type *attacker_ptr, 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(player_type *attacker_ptr, WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode);
-extern bool py_attack(player_type *attacker_ptr, POSITION y, POSITION x, COMBAT_OPTION_IDX mode);
+extern bool do_cmd_attack(player_type *attacker_ptr, POSITION y, POSITION x, COMBAT_OPTION_IDX mode);
 extern bool make_attack_normal(player_type *targer_ptr, MONSTER_IDX m_idx);
 extern void mon_take_hit_mon(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who);
 extern bool monst_attack_monst(player_type *subject_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
index a28f977..4621370 100644 (file)
@@ -433,7 +433,7 @@ gf_switch_result switch_effects_monster(player_type *caster_ptr, effect_monster_
        case GF_CAPTURE:
                return effect_monster_capture(caster_ptr, em_ptr);
        case GF_ATTACK:
-               return (gf_switch_result)py_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
+               return (gf_switch_result)do_cmd_attack(caster_ptr, em_ptr->y, em_ptr->x, em_ptr->dam);
        case GF_ENGETSU:
                return effect_monster_engetsu(caster_ptr, em_ptr);
        case GF_GENOCIDE:
index 505ad31..c0b4198 100644 (file)
@@ -1501,7 +1501,7 @@ static bool cast_berserk_spell(player_type *caster_ptr, int spell)
                        return FALSE;
                }
 
-               py_attack(caster_ptr, y, x, 0);
+               do_cmd_attack(caster_ptr, y, x, 0);
 
                if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
                        break;
index fdec6ec..93847c0 100644 (file)
@@ -997,7 +997,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(creature_ptr, y, x, 0);
+                               do_cmd_attack(creature_ptr, y, x, 0);
                                can_move = FALSE;
                        }
                        else if (monster_can_cross_terrain(creature_ptr, floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0))
@@ -1015,7 +1015,7 @@ void move_player(player_type *creature_ptr, DIRECTION dir, bool do_pickup, bool
                }
                else
                {
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                        can_move = FALSE;
                }
        }
index c3dc135..4fab59e 100644 (file)
@@ -82,21 +82,21 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        y = caster_ptr->y + ddy_cdd[cdir];
                        x = caster_ptr->x + ddx_cdd[cdir];
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, 0);
+                               do_cmd_attack(caster_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 (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, 0);
+                               do_cmd_attack(caster_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 (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, 0);
+                               do_cmd_attack(caster_ptr, y, x, 0);
                        else
                                msg_print(_("攻撃は空を切った。", "You attack the empty air."));
                }
@@ -128,7 +128,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_FIRE);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_FIRE);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -162,7 +162,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_MINEUCHI);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_MINEUCHI);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -215,7 +215,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                                return NULL;
                        }
 
-                       py_attack(caster_ptr, y, x, 0);
+                       do_cmd_attack(caster_ptr, y, x, 0);
 
                        if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
                                break;
@@ -246,7 +246,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_POISON);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_POISON);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -271,7 +271,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_ZANMA);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_ZANMA);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -295,7 +295,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, 0);
+                               do_cmd_attack(caster_ptr, y, x, 0);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -379,7 +379,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_HAGAN);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_HAGAN);
 
                        if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_HURT_ROCK)) break;
 
@@ -405,7 +405,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_COLD);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_COLD);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -430,7 +430,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_KYUSHO);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_KYUSHO);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -455,7 +455,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_MAJIN);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_MAJIN);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -480,7 +480,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_SUTEMI);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_SUTEMI);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -506,7 +506,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_ELEC);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_ELEC);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -559,7 +559,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                                                monster_desc(caster_ptr, m_name, m_ptr, 0);
                                                msg_format(_("%sには効果がない!", "%s is unharmed!"), m_name);
                                        }
-                                       else py_attack(caster_ptr, y, x, HISSATSU_SEKIRYUKA);
+                                       else do_cmd_attack(caster_ptr, y, x, HISSATSU_SEKIRYUKA);
                                }
                        }
                }
@@ -580,7 +580,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_QUAKE);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_QUAKE);
                        else
                                earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 10, 0);
                }
@@ -664,7 +664,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                                g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
 
                                if (g_ptr->m_idx)
-                                       py_attack(caster_ptr, y, x, HISSATSU_3DAN);
+                                       do_cmd_attack(caster_ptr, y, x, HISSATSU_3DAN);
                                else
                                {
                                        msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -737,7 +737,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_DRAIN);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_DRAIN);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -839,11 +839,11 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
                        {
-                               py_attack(caster_ptr, y, x, 0);
+                               do_cmd_attack(caster_ptr, y, x, 0);
                                if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
                                {
                                        handle_stuff(caster_ptr);
-                                       py_attack(caster_ptr, y, x, 0);
+                                       do_cmd_attack(caster_ptr, y, x, 0);
                                }
                        }
                        else
@@ -922,7 +922,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type m
                        x = caster_ptr->x + ddx[dir];
 
                        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-                               py_attack(caster_ptr, y, x, HISSATSU_UNDEAD);
+                               do_cmd_attack(caster_ptr, y, x, HISSATSU_UNDEAD);
                        else
                        {
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
index 236308c..3c9b24f 100644 (file)
@@ -2311,7 +2311,7 @@ bool rush_attack(player_type *attacker_ptr, bool *mdeath)
 
                if (!player_bold(attacker_ptr, ty, tx)) teleport_player_to(attacker_ptr, ty, tx, TELEPORT_NONMAGICAL);
                moved = TRUE;
-               tmp_mdeath = py_attack(attacker_ptr, ny, nx, HISSATSU_NYUSIN);
+               tmp_mdeath = do_cmd_attack(attacker_ptr, ny, nx, HISSATSU_NYUSIN);
 
                break;
        }
@@ -3253,7 +3253,7 @@ bool hit_and_away(player_type *caster_ptr)
        POSITION x = caster_ptr->x + ddx[dir];
        if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
        {
-               py_attack(caster_ptr, y, x, 0);
+               do_cmd_attack(caster_ptr, y, x, 0);
                if (randint0(caster_ptr->skill_dis) < 7)
                        msg_print(_("うまく逃げられなかった。", "You failed to run away."));
                else
@@ -3600,11 +3600,11 @@ bool double_attack(player_type *creature_ptr)
                msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
                        "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
 
-       py_attack(creature_ptr, y, x, 0);
+       do_cmd_attack(creature_ptr, y, x, 0);
        if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
        {
                handle_stuff(creature_ptr);
-               py_attack(creature_ptr, y, x, 0);
+               do_cmd_attack(creature_ptr, y, x, 0);
        }
 
        creature_ptr->energy_need += ENERGY_NEED();
@@ -3715,7 +3715,7 @@ bool sword_dancing(player_type *creature_ptr)
 
                /* Hack -- attack monsters */
                if (g_ptr->m_idx)
-                       py_attack(creature_ptr, y, x, 0);
+                       do_cmd_attack(creature_ptr, y, x, 0);
                else
                {
                        msg_print(_("攻撃が空をきった。", "You attack the empty air."));
index 5afee7a..f866fd1 100644 (file)
@@ -2771,7 +2771,7 @@ void massacre(player_type *caster_ptr)
                g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
                m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
                if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)))
-                       py_attack(caster_ptr, y, x, 0);
+                       do_cmd_attack(caster_ptr, y, x, 0);
        }
 }
 
@@ -2807,7 +2807,7 @@ bool eat_rock(player_type *caster_ptr)
                monster_type *m_ptr = &caster_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(caster_ptr, y, x, 0);
+               if (!m_ptr->ml || !is_pet(m_ptr)) do_cmd_attack(caster_ptr, y, x, 0);
        }
        else if (have_flag(f_ptr->flags, FF_TREE))
        {