OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / mind.c
index 12aef7a..4eef34b 100644 (file)
@@ -679,10 +679,10 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
 {
        SPELL_IDX i;
        int             num = 0;
-       int             y = 1;
-       int             x = 10;
+       TERM_LEN y = 1;
+       TERM_LEN x = 10;
        int             minfail = 0;
-       int             plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
        int             chance = 0;
        int             ask = TRUE;
        char            choice;
@@ -740,8 +740,6 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
        /* Assume cancelled */
        *sn = (-1);
 
-#ifdef ALLOW_REPEAT /* TNB */
-
        /* Get the spell, if available */
 
        if (repeat_pull(&code))
@@ -759,8 +757,6 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
                }
        }
 
-#endif /* ALLOW_REPEAT -- TNB */
-
     /* Nothing chosen yet */
     flag = FALSE;
 
@@ -1007,7 +1003,6 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
        /* Show choices */
        p_ptr->window |= (PW_SPELL);
 
-       /* Window stuff */
        window_stuff();
 
        /* Abort if needed */
@@ -1016,12 +1011,8 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
        /* Save the choice */
        (*sn) = i;
 
-#ifdef ALLOW_REPEAT /* TNB */
-
        repeat_push((COMMAND_CODE)i);
 
-#endif /* ALLOW_REPEAT -- TNB */
-
        /* Success */
        return (TRUE);
 }
@@ -1190,13 +1181,11 @@ static bool cast_mindcrafter_spell(int spell)
                /* Hack */
                p_ptr->energy_need -= 1000 + (100 + p_ptr->csp - 50)*TURNS_PER_TICK/10;
 
-               /* Redraw map */
                p_ptr->redraw |= (PR_MAP);
 
                /* Update monsters */
                p_ptr->update |= (PU_MONSTERS);
 
-               /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                handle_stuff();
@@ -1261,63 +1250,8 @@ static bool cast_force_spell(int spell)
                set_tim_sh_touki(randint1(plev / 2) + 15 + boost / 7, FALSE);
                break;
        case 7:
-       {
-               int y, x, dam;
-               project_length = 1;
-               if (!get_aim_dir(&dir)) return FALSE;
-
-               y = p_ptr->y + ddy[dir];
-               x = p_ptr->x + ddx[dir];
-               dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
-               fire_beam(GF_MISSILE, dir, dam);
-               if (cave[y][x].m_idx)
-               {
-                       int i;
-                       int ty = y, tx = x;
-                       int oy = y, ox = x;
-                       MONSTER_IDX m_idx = cave[y][x].m_idx;
-                       monster_type *m_ptr = &m_list[m_idx];
-                       monster_race *r_ptr = &r_info[m_ptr->r_idx];
-                       char m_name[80];
-
-                       monster_desc(m_name, m_ptr, 0);
-
-                       if (randint1(r_ptr->level * 3 / 2) > randint0(dam / 2) + dam/2)
-                       {
-                               msg_format(_("%sは飛ばされなかった。", "%^s was not blown away."), m_name);
-                       }
-                       else
-                       {
-                               for (i = 0; i < 5; i++)
-                               {
-                                       y += ddy[dir];
-                                       x += ddx[dir];
-                                       if (cave_empty_bold(y, x))
-                                       {
-                                               ty = y;
-                                               tx = x;
-                                       }
-                                       else break;
-                               }
-                               if ((ty != oy) || (tx != ox))
-                               {
-                                       msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
-                                       cave[oy][ox].m_idx = 0;
-                                       cave[ty][tx].m_idx = (s16b)m_idx;
-                                       m_ptr->fy = (byte_hack)ty;
-                                       m_ptr->fx = (byte_hack)tx;
-
-                                       update_mon(m_idx, TRUE);
-                                       lite_spot(oy, ox);
-                                       lite_spot(ty, tx);
-
-                                       if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
-                                               p_ptr->update |= (PU_MON_LITE);
-                               }
-                       }
-               }
+               return shock_power();
                break;
-       }
        case 8:
                if (!get_aim_dir(&dir)) return FALSE;
                fire_ball(GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3);
@@ -1565,7 +1499,7 @@ static bool cast_berserk_spell(int spell)
                        return FALSE;
                }
 
-               if (!get_rep_dir2(&dir)) return FALSE;
+               if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
 
                if (dir == 5) return FALSE;
                y = p_ptr->y + ddy[dir];
@@ -1596,7 +1530,7 @@ static bool cast_berserk_spell(int spell)
        }
        case 2:
        {
-               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];
                move_player(dir, easy_disarm, TRUE);
@@ -1772,7 +1706,7 @@ static bool cast_ninja_spell(int spell)
                (void)set_monster_csleep(m_idx, 0);
 
                /* Update the monster (new location) */
-               update_mon(m_idx, TRUE);
+               update_monster(m_idx, TRUE);
 
                /* Redraw the old grid */
                lite_spot(target_row, target_col);
@@ -1863,7 +1797,7 @@ void do_cmd_mind(void)
        int b = 0;
        int             chance;
        int             minfail = 0;
-       int             plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
        int             old_csp = p_ptr->csp;
        mind_type       spell;
        bool            cast;
@@ -2096,7 +2030,6 @@ void do_cmd_mind(void)
        }
 
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
        /* teleport from mirror costs small energy */
        if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
@@ -2137,7 +2070,6 @@ void do_cmd_mind(void)
                if ((p_ptr->csp - mana_cost) < 0) p_ptr->csp_frac = 0;
                p_ptr->csp = MAX(0, p_ptr->csp - mana_cost);
 
-               /* Message */
                msg_format(_("%sを集中しすぎて気を失ってしまった!", "You faint from the effort!"),p);
 
                /* Hack -- Bypass free action */
@@ -2148,7 +2080,6 @@ void do_cmd_mind(void)
                {
                        bool perm = (randint0(100) < 25);
 
-                       /* Message */
                        msg_print(_("自分の精神を攻撃してしまった!", "You have damaged your mind!"));
 
                        /* Reduce constitution */
@@ -2159,7 +2090,6 @@ void do_cmd_mind(void)
        /* Redraw mana */
        p_ptr->redraw |= (PR_MANA);
 
-       /* Window stuff */
        p_ptr->window |= (PW_PLAYER);
        p_ptr->window |= (PW_SPELL);
 }