OSDN Git Service

[Refactor] #37353 cave_type 構造体を grid_type に改名。 / Rename cave_type structure to grid_...
[hengband/hengband.git] / src / realm-hissatsu.c
index 9abe687..4b3f843 100644 (file)
@@ -2,6 +2,9 @@
 #include "cmd-spell.h"
 #include "melee.h"
 #include "monsterrace-hook.h"
+#include "projection.h"
+#include "artifact.h"
+#include "player-status.h"
 
 /*!
 * @brief 剣術の各処理を行う
@@ -199,8 +202,6 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx)
                        {
                                msg_print(NULL);
-
-                               /* Move the player */
                                (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
                        }
                }
@@ -276,7 +277,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
                                return NULL;
                        }
-                       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+                       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
                        {
                                return "";
                        }
@@ -511,7 +512,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        POSITION y = 0, x = 0;
 
-                       cave_type       *c_ptr;
+                       grid_type       *c_ptr;
                        monster_type    *m_ptr;
 
                        if (p_ptr->cut < 300)
@@ -524,8 +525,6 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                y = p_ptr->y + ddy_ddd[dir];
                                x = p_ptr->x + ddx_ddd[dir];
                                c_ptr = &cave[y][x];
-
-                               /* Get the monster */
                                m_ptr = &m_list[c_ptr->m_idx];
 
                                /* Hack -- attack monsters */
@@ -580,7 +579,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                int damage;
 
-                               if (!buki_motteruka(INVEN_RARM + i)) break;
+                               if (!has_melee_weapon(INVEN_RARM + i)) break;
                                o_ptr = &inventory[INVEN_RARM + i];
                                basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
                                damage = o_ptr->to_d * 100;
@@ -635,7 +634,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                POSITION y, x;
                                POSITION ny, nx;
                                MONSTER_IDX m_idx;
-                               cave_type *c_ptr;
+                               grid_type *c_ptr;
                                monster_type *m_ptr;
 
                                y = p_ptr->y + ddy[dir];
@@ -650,7 +649,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        return NULL;
                                }
 
-                               if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+                               if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
                                {
                                        return "";
                                }
@@ -687,7 +686,6 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                /* Player can move forward? */
                                if (player_can_enter(c_ptr->feat, 0))
                                {
-                                       /* Move the player */
                                        if (!move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP)) break;
                                }
                                else
@@ -851,7 +849,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        y = p_ptr->y + ddy[dir];
                        x = p_ptr->x + ddx[dir];
 
-                       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+                       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
                        {
                                msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
                                return "";
@@ -860,7 +858,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        for (i = 0; i < 2; i++)
                        {
                                int damage;
-                               if (!buki_motteruka(INVEN_RARM + i)) break;
+                               if (!has_melee_weapon(INVEN_RARM + i)) break;
                                o_ptr = &inventory[INVEN_RARM + i];
                                basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
                                damage = o_ptr->to_d * 100;