OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / cmd-activate.c
index 300f646..64d2948 100644 (file)
@@ -66,7 +66,9 @@ static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
  */
 void do_cmd_activate_aux(INVENTORY_IDX item)
 {
-       int         dir, lev, chance, fail;
+       DIRECTION dir;
+       DEPTH lev;
+       int chance, fail;
        object_type *o_ptr;
        bool success;
 
@@ -83,7 +85,6 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
                o_ptr = &o_list[0 - item];
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Extract the item level */
@@ -167,7 +168,6 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
        {
                (void)activate_artifact(o_ptr);
 
-               /* Window stuff */
                p_ptr->window |= (PW_INVEN | PW_EQUIP);
 
                /* Success */
@@ -180,14 +180,6 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
                if (music_singing_any()) stop_singing();
                if (hex_spelling_any()) stop_hex_spell_all();
 
-#if 0
-               if (object_is_cursed(o_ptr))
-               {
-                       msg_print(_("カン高い音が響き渡った。", "You produce a shrill whistling sound."));
-                       aggravate_monsters(0);
-               }
-               else
-#endif
                {
                        IDX pet_ctr, i;
                        IDX *who;
@@ -220,7 +212,7 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
                        /* Free the "who" array */
                        C_KILL(who, max_m_idx, IDX);
                }
-               o_ptr->timeout = 100+randint1(100);
+               o_ptr->timeout = 100 + randint1(100);
                return;
        }
        else if (o_ptr->tval == TV_CAPTURE)
@@ -284,7 +276,7 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
                else
                {
                        success = FALSE;
-                       if (!get_rep_dir2(&dir)) return;
+                       if (!get_direction(&dir, FALSE, FALSE)) return;
                        if (monster_can_enter(p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
                        {
                                if (place_monster_aux(0, p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
@@ -383,7 +375,6 @@ void do_cmd_activate(void)
        /* Prepare the hook */
        item_tester_hook = item_tester_hook_activate;
 
-       /* Get an item */
        q = _("どのアイテムを始動させますか? ", "Activate which item? ");
        s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
 
@@ -404,7 +395,8 @@ static bool activate_dragon_breath(object_type *o_ptr)
        BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
        int type[20];
        cptr name[20];
-       int i, dir, t, n = 0;
+       int i, t, n = 0;
+       DIRECTION dir;
 
        if (!get_aim_dir(&dir)) return FALSE;
 
@@ -638,25 +630,7 @@ bool activate_artifact(object_type *o_ptr)
 
        case ACT_WHIRLWIND:
        {
-               {
-                       int y = 0, x = 0;
-                       cave_type       *c_ptr;
-                       monster_type    *m_ptr;
-
-                       for (dir = 0; dir <= 9; dir++)
-                       {
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
-
-                               /* Get the monster */
-                               m_ptr = &m_list[c_ptr->m_idx];
-
-                               /* Hack -- attack monsters */
-                               if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
-                                       py_attack(y, x, 0);
-                       }
-               }
+               massacre();
                break;
        }
 
@@ -1509,7 +1483,6 @@ bool activate_artifact(object_type *o_ptr)
                                p_ptr->csp = 0;
                                p_ptr->csp_frac = 0;
 
-                               /* Message */
                                msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
                                /* Hack -- Bypass free action */
                                (void)set_paralyzed(p_ptr->paralyzed +
@@ -1656,7 +1629,7 @@ bool activate_artifact(object_type *o_ptr)
        {
                POSITION x, y;
 
-               if (!get_rep_dir2(&dir)) return FALSE;
+               if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
                y = p_ptr->y + ddy[dir];
                x = p_ptr->x + ddx[dir];
                tsuri_dir = dir;