OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / spells2.c
index 97f1728..309c546 100644 (file)
@@ -14,6 +14,7 @@
 #include "angband.h"
 #include "grid.h"
 #include "trap.h"
+#include "monsterrace-hook.h"
 
 
 /*!
@@ -25,7 +26,7 @@
  */
 static bool detect_feat_flag(POSITION range, int flag, bool known)
 {
-       int x, y;
+       POSITION x, y;
        bool detect = FALSE;
        cave_type *c_ptr;
 
@@ -50,7 +51,6 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
 
                                        c_ptr->info &= ~(CAVE_UNSAFE);
 
-                                       /* Redraw */
                                        lite_spot(y, x);
                                }
                        }
@@ -64,7 +64,6 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
                                /* Hack -- Memorize */
                                c_ptr->info |= (CAVE_MARK);
 
-                               /* Redraw */
                                lite_spot(y, x);
 
                                detect = TRUE;
@@ -157,7 +156,8 @@ bool detect_treasure(POSITION range)
  */
 bool detect_objects_gold(POSITION range)
 {
-       int i, y, x;
+       OBJECT_IDX i;
+       POSITION y, x;
        POSITION range2 = range;
 
        bool detect = FALSE;
@@ -211,7 +211,8 @@ bool detect_objects_gold(POSITION range)
  */
 bool detect_objects_normal(POSITION range)
 {
-       int i, y, x;
+       OBJECT_IDX i;
+       POSITION y, x;
        POSITION range2 = range;
 
        bool detect = FALSE;
@@ -273,7 +274,9 @@ bool detect_objects_normal(POSITION range)
  */
 bool detect_objects_magic(POSITION range)
 {
-       int i, y, x, tv;
+       OBJECT_TYPE_VALUE tv;
+       OBJECT_IDX i;
+       POSITION y, x;
 
        bool detect = FALSE;
 
@@ -526,7 +529,6 @@ bool detect_monsters_nonliving(POSITION range)
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &m_list[i];
-               monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -538,7 +540,7 @@ bool detect_monsters_nonliving(POSITION range)
                if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
 
                /* Detect non-living monsters */
-               if (!monster_living(r_ptr))
+               if (!monster_living(m_ptr->r_idx))
                {
                        /* Update monster recall window */
                        if (p_ptr->monster_race_idx == m_ptr->r_idx)
@@ -572,7 +574,7 @@ bool detect_monsters_mind(POSITION range)
 {
        MONSTER_IDX i;
        POSITION y, x;
-       bool    flag = FALSE;
+       bool flag = FALSE;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
@@ -962,8 +964,7 @@ void aggravate_monsters(MONSTER_IDX who)
        /* Aggravate everyone nearby */
        for (i = 1; i < m_max; i++)
        {
-               monster_type    *m_ptr = &m_list[i];
-/*             monster_race    *r_ptr = &r_info[m_ptr->r_idx]; */
+               monster_type *m_ptr = &m_list[i];
 
                /* Paranoia -- Skip dead monsters */
                if (!m_ptr->r_idx) continue;
@@ -1077,7 +1078,6 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
        /* Visual feedback */
        move_cursor_relative(p_ptr->y, p_ptr->x);
 
-       /* Redraw */
        p_ptr->redraw |= (PR_HP);
        p_ptr->window |= (PW_PLAYER);
 
@@ -1476,8 +1476,6 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
                                {
                                        object_type *o_ptr;
-
-                                       /* Acquire object */
                                        o_ptr = &o_list[this_o_idx];
 
                                        /* Acquire next object */
@@ -1625,7 +1623,6 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 
                p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
-               /* Redraw map */
                p_ptr->redraw |= (PR_MAP);
 
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -2101,7 +2098,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        /* Update the health bar */
        p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -2250,8 +2246,6 @@ static void cave_temp_room_lite(void)
                                if (m_ptr->ml)
                                {
                                        char m_name[80];
-
-                                       /* Acquire the monster name */
                                        monster_desc(m_name, m_ptr, 0);
 
                                        /* Dump a message */
@@ -2263,7 +2257,6 @@ static void cave_temp_room_lite(void)
                /* Note */
                note_spot(y, x);
 
-               /* Redraw */
                lite_spot(y, x);
 
                update_local_illumination(y, x);
@@ -2346,7 +2339,6 @@ static void cave_temp_room_unlite(void)
                                update_monster(c_ptr->m_idx, FALSE);
                        }
 
-                       /* Redraw */
                        lite_spot(y, x);
 
                        update_local_illumination(y, x);
@@ -3333,7 +3325,6 @@ bool wall_stone(void)
 
        p_ptr->update |= (PU_FLOW);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
        return dummy;