OSDN Git Service

[Refactor] #37353 monster1~monster-hook間整理。 / Refactor between monster1 and monster...
[hengband/hengband.git] / src / monster-process.c
index 178e95b..ab1f74c 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "angband.h"
 #include "cmd-pet.h"
+#include "monster-hook.h"
 
 
 /*!
@@ -212,7 +213,6 @@ void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note, I
                if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
        }
 
-       /* Wake it up */
        (void)set_monster_csleep(m_idx, 0);
 
        if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
@@ -1508,7 +1508,6 @@ static bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
                /* Monster hits */
                if (!effect || check_hit2(power, rlev, ac, MON_STUNNED(m_ptr)))
                {
-                       /* Wake it up */
                        (void)set_monster_csleep(t_idx, 0);
 
                        if (t_ptr->ml)
@@ -1962,7 +1961,6 @@ static bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
                        case RBM_ENGULF:
                        case RBM_CHARGE:
                                {
-                                       /* Wake it up */
                                        (void)set_monster_csleep(t_idx, 0);
 
                                        /* Visible monsters */
@@ -3055,7 +3053,7 @@ void process_monster(MONSTER_IDX m_idx)
                                        y_ptr->fx = ox;
 
                                        /* Update the old monster */
-                                       update_mon(c_ptr->m_idx, TRUE);
+                                       update_monster(c_ptr->m_idx, TRUE);
                                }
 
                                /* Hack -- Update the new location */
@@ -3064,9 +3062,7 @@ void process_monster(MONSTER_IDX m_idx)
                                /* Move the monster */
                                m_ptr->fy = ny;
                                m_ptr->fx = nx;
-
-                               /* Update the monster */
-                               update_mon(m_idx, TRUE);
+                               update_monster(m_idx, TRUE);
 
                                /* Redraw the old grid */
                                lite_spot(oy, ox);
@@ -3104,8 +3100,6 @@ void process_monster(MONSTER_IDX m_idx)
                                {
                                        BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
                                        char m_name[80], o_name[MAX_NLEN];
-
-                                       /* Acquire object */
                                        object_type *o_ptr = &o_list[this_o_idx];
 
                                        /* Acquire next object */
@@ -3223,7 +3217,6 @@ void process_monster(MONSTER_IDX m_idx)
                                                        msg_format(_("%^sが%sを破壊した。", "%^s destroys %s."), m_name, o_name);
                                                }
 
-                                               /* Delete the object */
                                                delete_object_idx(this_o_idx);
                                        }
                                }
@@ -3363,24 +3356,24 @@ void process_monsters(void)
        monster_type    *m_ptr;
        monster_race    *r_ptr;
 
-       int             old_monster_race_idx;
+       MONRACE_IDX old_monster_race_idx;
 
-       u32b    old_r_flags1 = 0L;
-       u32b    old_r_flags2 = 0L;
-       u32b    old_r_flags3 = 0L;
-       u32b    old_r_flags4 = 0L;
-       u32b    old_r_flags5 = 0L;
-       u32b    old_r_flags6 = 0L;
-       u32b    old_r_flagsr = 0L;
+       BIT_FLAGS old_r_flags1 = 0L;
+       BIT_FLAGS old_r_flags2 = 0L;
+       BIT_FLAGS old_r_flags3 = 0L;
+       BIT_FLAGS old_r_flags4 = 0L;
+       BIT_FLAGS old_r_flags5 = 0L;
+       BIT_FLAGS old_r_flags6 = 0L;
+       BIT_FLAGS old_r_flagsr = 0L;
 
-       byte    old_r_blows0 = 0;
-       byte    old_r_blows1 = 0;
-       byte    old_r_blows2 = 0;
-       byte    old_r_blows3 = 0;
+       byte old_r_blows0 = 0;
+       byte old_r_blows1 = 0;
+       byte old_r_blows2 = 0;
+       byte old_r_blows3 = 0;
 
-       byte    old_r_cast_spell = 0;
+       byte old_r_cast_spell = 0;
 
-       int speed;
+       SPEED speed;
 
        /* Clear monster fighting indicator */
        mon_fight = FALSE;