OSDN Git Service

[Refactor] #37353 演算整理。 / Refactor calculation.
[hengband/hengband.git] / src / realm-hissatsu.c
index ca0d25e..b1c6307 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 剣術の各処理を行う
@@ -9,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;
@@ -287,7 +290,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);
 
@@ -533,7 +536,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                {
                                        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);
@@ -580,7 +583,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;
@@ -860,7 +863,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;