OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / cmd1.c
index bca51c5..65800e5 100644 (file)
@@ -358,8 +358,6 @@ static void discover_hidden_things(POSITION y, POSITION x)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
        cave_type *c_ptr;
-
-       /* Access the grid */
        c_ptr = &cave[y][x];
 
        /* Invisible trap */
@@ -370,7 +368,7 @@ static void discover_hidden_things(POSITION y, POSITION x)
 
                msg_print(_("トラップを発見した。", "You have found a trap."));
 
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
        }
 
        /* Secret door */
@@ -381,15 +379,13 @@ static void discover_hidden_things(POSITION y, POSITION x)
                /* Disclose */
                disclose_grid(y, x);
 
-               disturb(0, 0);
+               disturb(FALSE, FALSE);
        }
 
        /* Scan all objects in the grid */
        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 */
@@ -410,7 +406,7 @@ static void discover_hidden_things(POSITION y, POSITION x)
                        object_known(o_ptr);
 
                        /* Notice it */
-                       disturb(0, 0);
+                       disturb(FALSE, FALSE);
                }
        }
 }
@@ -475,7 +471,6 @@ void py_pickup_aux(OBJECT_IDX o_idx)
        o_ptr = &o_list[o_idx];
 
 #ifdef JP
-       /* Describe the object */
        object_desc(old_name, o_ptr, OD_NAME_ONLY);
        object_desc_kosuu(kazu_str, o_ptr);
        hirottakazu = o_ptr->number;
@@ -486,7 +481,6 @@ void py_pickup_aux(OBJECT_IDX o_idx)
        /* Get the object again */
        o_ptr = &inventory[slot];
 
-       /* Delete the object */
        delete_object_idx(o_idx);
 
        if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
@@ -500,7 +494,6 @@ void py_pickup_aux(OBJECT_IDX o_idx)
                if (o_ptr->marked & OM_AUTODESTROY) return;
        }
 
-       /* Describe the object */
        object_desc(o_name, o_ptr, 0);
 
 #ifdef JP
@@ -560,34 +553,24 @@ void carry(bool pickup)
 
        p_ptr->update |= (PU_MONSTERS);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
        p_ptr->window |= (PW_OVERHEAD);
-
-       /* Handle stuff */
        handle_stuff();
 
        /* Automatically pickup/destroy/inscribe items */
        autopick_pickup_items(c_ptr);
 
-
-#ifdef ALLOW_EASY_FLOOR
-
        if (easy_floor)
        {
                py_pickup_floor(pickup);
                return;
        }
 
-#endif /* ALLOW_EASY_FLOOR */
-
        /* Scan the pile of objects */
        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];
 
 #ifdef ALLOW_EASY_SENSE /* TNB */
@@ -601,14 +584,13 @@ void carry(bool pickup)
 
 #endif /* ALLOW_EASY_SENSE -- TNB */
 
-               /* Describe the object */
                object_desc(o_name, o_ptr, 0);
 
                /* Acquire next object */
                next_o_idx = o_ptr->next_o_idx;
 
                /* Hack -- disturb */
-               disturb(0, 0);
+               disturb(FALSE, FALSE);
 
                /* Pick up gold */
                if (o_ptr->tval == TV_GOLD)
@@ -641,7 +623,6 @@ void carry(bool pickup)
                                /* Clear the flag. */
                                o_ptr->marked &= ~OM_NOMSG;
                        }
-                       /* Describe the object */
                        else if (!pickup)
                        {
                                msg_format(_("%sがある。", "You see %s."), o_name);
@@ -872,7 +853,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
                                monster_type *om_ptr = &m_list[om_idx];
                                om_ptr->fy = ny;
                                om_ptr->fx = nx;
-                               update_mon(om_idx, TRUE);
+                               update_monster(om_idx, TRUE);
                        }
 
                        if (nm_idx > 0) /* Monster on new spot */
@@ -880,7 +861,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
                                monster_type *nm_ptr = &m_list[nm_idx];
                                nm_ptr->fy = oy;
                                nm_ptr->fx = ox;
-                               update_mon(nm_idx, TRUE);
+                               update_monster(nm_idx, TRUE);
                        }
                }
 
@@ -900,7 +881,6 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
                        /* Mega-Hack -- Forget the view */
                        p_ptr->update |= (PU_UN_VIEW);
 
-                       /* Redraw map */
                        p_ptr->redraw |= (PR_MAP);
                }
 
@@ -913,8 +893,6 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
 
                /* For get everything when requested hehe I'm *NASTY* */
                if (dun_level && (d_info[dungeon_type].flags1 & DF1_FORGET)) wiz_dark();
-
-               /* Handle stuff */
                if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
 
                if (p_ptr->pclass == CLASS_NINJA)
@@ -964,7 +942,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
        /* Handle "store doors" */
        if (have_flag(f_ptr->flags, FF_STORE))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                p_ptr->energy_use = 0;
                /* Hack -- Enter store */
@@ -974,7 +952,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
        /* Handle "building doors" -KMW- */
        else if (have_flag(f_ptr->flags, FF_BLDG))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                p_ptr->energy_use = 0;
                /* Hack -- Enter building */
@@ -984,7 +962,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
        /* Handle quest areas -KMW- */
        else if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                p_ptr->energy_use = 0;
                /* Hack -- Enter quest level */
@@ -1011,7 +989,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
        /* Set off a trap */
        else if (have_flag(f_ptr->flags, FF_HIT_TRAP) && !(mpe_mode & MPE_STAYING))
        {
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                /* Hidden trap */
                if (c_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET))
@@ -1043,7 +1021,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
                                msg_print(_("* 注意:この先はトラップの感知範囲外です! *", "*Leaving trap detect region!*"));
                        }
 
-                       if (disturb_trap_detect) disturb(0, 1);
+                       if (disturb_trap_detect) disturb(FALSE, TRUE);
                }
        }
 
@@ -1055,7 +1033,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
  * @param feat 地形ID
  * @return トラップが自動的に無効ならばTRUEを返す
  */
-bool trap_can_be_ignored(int feat)
+bool trap_can_be_ignored(FEAT_IDX feat)
 {
        feature_type *f_ptr = &f_info[feat];
 
@@ -1305,7 +1283,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                        msg_print(_("動けない!", "Can't move!"));
                        p_ptr->energy_use = 0;
                        oktomove = FALSE;
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
                else if (MON_MONFEAR(riding_m_ptr))
                {
@@ -1317,12 +1295,12 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                        /* Dump a message */
                        msg_format(_("%sが恐怖していて制御できない。", "%^s is too scared to control."), steed_name);
                        oktomove = FALSE;
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
                else if (p_ptr->riding_ryoute)
                {
                        oktomove = FALSE;
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
                else if (have_flag(f_ptr->flags, FF_CAN_FLY) && (riding_r_ptr->flags7 & RF7_CAN_FLY))
                {
@@ -1339,21 +1317,21 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                        msg_format(_("%sの上に行けない。", "Can't swim."), f_name + f_info[get_feat_mimic(c_ptr)].name);
                        p_ptr->energy_use = 0;
                        oktomove = FALSE;
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
                else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
                {
                        msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name);
                        p_ptr->energy_use = 0;
                        oktomove = FALSE;
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
                else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
                {
                        msg_format(_("%sの上に行けない。", "Too hot to go through."), f_name + f_info[get_feat_mimic(c_ptr)].name);
                        p_ptr->energy_use = 0;
                        oktomove = FALSE;
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
 
                if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
@@ -1362,7 +1340,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                        monster_desc(steed_name, riding_m_ptr, 0);
                        msg_format(_("%sが朦朧としていてうまく動けない!", "You cannot control stunned %s!"), steed_name);
                        oktomove = FALSE;
-                       disturb(0, 1);
+                       disturb(FALSE, TRUE);
                }
        }
 
@@ -1388,7 +1366,6 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) p_ptr->energy_use *= 2;
        }
 
-#ifdef ALLOW_EASY_DISARM /* TNB */
 
        /* Disarm a visible trap */
        else if ((do_pickup != easy_disarm) && have_flag(f_ptr->flags, FF_DISARM) && !c_ptr->mimic)
@@ -1400,7 +1377,6 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                }
        }
 
-#endif /* ALLOW_EASY_DISARM -- TNB */
 
        /* Player can not walk through "walls" unless in wraith form...*/
        else if (!p_can_enter && !p_can_kill_walls)
@@ -1470,7 +1446,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                        }
                }
 
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                if (!boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL);
        }
@@ -1484,7 +1460,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                }
 
                /* To avoid a loop with running */
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
 
                oktomove = FALSE;
        }
@@ -1529,16 +1505,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
 
                /* sound(SOUND_WALK); */
 
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                if (do_pickup != always_pickup) mpe_mode |= MPE_DO_PICKUP;
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-               if (do_pickup) mpe_mode |= MPE_DO_PICKUP;
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                if (break_trap) mpe_mode |= MPE_BREAK_TRAP;
 
                /* Move the player */
@@ -1840,8 +1807,6 @@ static bool run_test(void)
                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 */
@@ -2120,7 +2085,7 @@ void run_step(DIRECTION dir)
 
                        msg_print(_("その方向には走れません。", "You cannot run in that direction."));
 
-                       disturb(0, 0);
+                       disturb(FALSE, FALSE);
 
                        return;
                }
@@ -2134,7 +2099,7 @@ void run_step(DIRECTION dir)
                /* Update run */
                if (run_test())
                {
-                       disturb(0, 0);
+                       disturb(FALSE, FALSE);
 
                        return;
                }
@@ -2147,21 +2112,13 @@ void run_step(DIRECTION dir)
        p_ptr->energy_use = 100;
 
        /* Move the player, using the "pickup" flag */
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
        move_player(find_current, FALSE, FALSE);
 
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-       move_player(find_current, always_pickup, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
        if (player_bold(p_ptr->run_py, p_ptr->run_px))
        {
                p_ptr->run_py = 0;
                p_ptr->run_px = 0;
-               disturb(0, 0);
+               disturb(FALSE, FALSE);
        }
 }
 
@@ -2278,7 +2235,6 @@ void travel_step(void)
        /* Get travel direction */
        travel.dir = travel_test(travel.dir);
 
-       /* disturb */
        if (!travel.dir)
        {
                if (travel.run == 255)
@@ -2286,7 +2242,7 @@ void travel_step(void)
                        msg_print(_("道筋が見つかりません!", "No route is found!"));
                        travel.y = travel.x = 0;
                }
-               disturb(0, 1);
+               disturb(FALSE, TRUE);
                return;
        }