OSDN Git Service

[Refactor] #37353 cave_type 構造体を grid_type に改名。 / Rename cave_type structure to grid_...
[hengband/hengband.git] / src / realm-hissatsu.c
index 01ca7e1..4b3f843 100644 (file)
@@ -1,6 +1,10 @@
 #include "angband.h"
 #include "cmd-spell.h"
-#include "monster-hook.h"
+#include "melee.h"
+#include "monsterrace-hook.h"
+#include "projection.h"
+#include "artifact.h"
+#include "player-status.h"
 
 /*!
 * @brief 剣術の各処理を行う
@@ -8,7 +12,7 @@
 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_CAST)
 * @return SPELL_NAME / SPELL_DESC 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
 */
-cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -198,8 +202,6 @@ cptr 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);
                        }
                }
@@ -275,7 +277,7 @@ cptr 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 "";
                        }
@@ -286,7 +288,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                POSITION oy = y, ox = x;
                                MONSTER_IDX m_idx = cave[y][x].m_idx;
                                monster_type *m_ptr = &m_list[m_idx];
-                               char m_name[80];
+                               GAME_TEXT m_name[MAX_NLEN];
 
                                monster_desc(m_name, m_ptr, 0);
 
@@ -510,7 +512,7 @@ cptr 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)
@@ -523,16 +525,14 @@ cptr 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 */
                                if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
                                {
-                                       if (!monster_living(&r_info[m_ptr->r_idx]))
+                                       if (!monster_living(m_ptr->r_idx))
                                        {
-                                               char m_name[80];
+                                               GAME_TEXT m_name[MAX_NLEN];
 
                                                monster_desc(m_name, m_ptr, 0);
                                                msg_format(_("%sには効果がない!", "%s is unharmed!"), m_name);
@@ -579,7 +579,7 @@ cptr 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;
@@ -613,7 +613,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (cast)
                {
                        msg_print(_("雄叫びをあげた!", "You roar out!"));
-                       project_hack(GF_SOUND, randint1(plev * 3));
+                       project_all_los(GF_SOUND, randint1(plev * 3));
                        aggravate_monsters(0);
                }
                break;
@@ -634,7 +634,7 @@ cptr 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];
@@ -649,7 +649,7 @@ cptr 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 "";
                                }
@@ -686,7 +686,6 @@ cptr 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
@@ -732,9 +731,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (cast)
                {
                        msg_print(_("武器を不規則に揺らした...", "You irregularly wave your weapon..."));
-                       project_hack(GF_ENGETSU, plev * 4);
-                       project_hack(GF_ENGETSU, plev * 4);
-                       project_hack(GF_ENGETSU, plev * 4);
+                       project_all_los(GF_ENGETSU, plev * 4);
+                       project_all_los(GF_ENGETSU, plev * 4);
+                       project_all_los(GF_ENGETSU, plev * 4);
                }
                break;
 
@@ -850,7 +849,7 @@ cptr 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 "";
@@ -859,7 +858,7 @@ cptr 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;