OSDN Git Service

[Refactor] #37353 monster1~monster-hook間整理。 / Refactor between monster1 and monster...
[hengband/hengband.git] / src / realm-hissatsu.c
index 7308a45..01ca7e1 100644 (file)
@@ -1,5 +1,6 @@
 #include "angband.h"
 #include "cmd-spell.h"
+#include "monster-hook.h"
 
 /*!
 * @brief 剣術の各処理を行う
@@ -14,7 +15,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
        bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
 
        DIRECTION dir;
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
        switch (spell)
        {
@@ -37,10 +38,10 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int cdir;
-                       int y, x;
+                       DIRECTION cdir;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        for (cdir = 0; cdir < 8; cdir++)
@@ -90,9 +91,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -124,9 +125,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -174,7 +175,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                return NULL;
                        }
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
 
                        if (dir == 5) return NULL;
                        y = p_ptr->y + ddy[dir];
@@ -210,9 +211,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -235,9 +236,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -259,9 +260,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -308,7 +309,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        m_ptr->fy = ty;
                                        m_ptr->fx = tx;
 
-                                       update_mon(m_idx, TRUE);
+                                       update_monster(m_idx, TRUE);
                                        lite_spot(oy, ox);
                                        lite_spot(ty, tx);
 
@@ -343,9 +344,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -371,9 +372,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -396,9 +397,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -421,9 +422,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -446,9 +447,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -472,9 +473,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -507,7 +508,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y = 0, x = 0;
+                       POSITION y = 0, x = 0;
 
                        cave_type       *c_ptr;
                        monster_type    *m_ptr;
@@ -548,9 +549,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -570,7 +571,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (cast)
                {
                        int total_damage = 0, basedam, i;
-                       u32b flgs[TR_FLAG_SIZE];
+                       BIT_FLAGS flgs[TR_FLAG_SIZE];
                        object_type *o_ptr;
                        if (!get_aim_dir(&dir)) return NULL;
                        msg_print(_("武器を大きく振り下ろした。", "You swing your weapon downward."));
@@ -625,7 +626,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        int i;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        for (i = 0; i < 3; i++)
@@ -674,7 +675,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                m_ptr->fy = ny;
                                m_ptr->fx = nx;
 
-                               update_mon(m_idx, TRUE);
+                               update_monster(m_idx, TRUE);
 
                                /* Redraw the old spot */
                                lite_spot(y, x);
@@ -706,9 +707,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -839,11 +840,11 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (cast)
                {
                        int total_damage = 0, basedam, i;
-                       int y, x;
-                       u32b flgs[TR_FLAG_SIZE];
+                       POSITION y, x;
+                       BIT_FLAGS flgs[TR_FLAG_SIZE];
                        object_type *o_ptr;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];
@@ -891,9 +892,9 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 
                if (cast)
                {
-                       int y, x;
+                       POSITION y, x;
 
-                       if (!get_rep_dir2(&dir)) return NULL;
+                       if (!get_direction(&dir, FALSE, FALSE)) return NULL;
                        if (dir == 5) return NULL;
 
                        y = p_ptr->y + ddy[dir];