OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
[hengband/hengband.git] / src / racial.c
index 9e10467..aef3713 100644 (file)
@@ -94,8 +94,8 @@ static bool do_cmd_archer(void)
                cave_type *c_ptr;
 
                if (!get_rep_dir(&dir, FALSE)) return FALSE;
-               y = py + ddy[dir];
-               x = px + ddx[dir];
+               y = p_ptr->y + ddy[dir];
+               x = p_ptr->x + ddx[dir];
                c_ptr = &cave[y][x];
 
                if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_CAN_DIG))
@@ -264,7 +264,7 @@ static bool do_cmd_archer(void)
 bool gain_magic(void)
 {
        int item;
-       int pval;
+       PARAMETER_VALUE pval;
        int ext = 0;
        cptr q, s;
        object_type *o_ptr;
@@ -362,7 +362,7 @@ bool gain_magic(void)
                floor_item_describe(0 - item);
                floor_item_optimize(0 - item);
        }
-       energy_use = 100;
+       p_ptr->energy_use = 100;
        return TRUE;
 }
 
@@ -692,7 +692,7 @@ static int racial_aux(power_desc_type *pd_ptr)
                msg_format(_("この能力を使用するにはレベル %d に達していなければなりません。", 
                                         "You need to attain level %d to use this power."), min_level);
 
-               energy_use = 0;
+               p_ptr->energy_use = 0;
                return 0;
        }
 
@@ -700,7 +700,7 @@ static int racial_aux(power_desc_type *pd_ptr)
        else if (p_ptr->confused)
        {
                msg_print(_("混乱していてその能力は使えない。", "You are too confused to use this power."));
-               energy_use = 0;
+               p_ptr->energy_use = 0;
                return 0;
        }
 
@@ -709,7 +709,7 @@ static int racial_aux(power_desc_type *pd_ptr)
        {
                if (!get_check(_("本当に今の衰弱した状態でこの能力を使いますか?", "Really use the power in your weakened state? ")))
                {
-                       energy_use = 0;
+                       p_ptr->energy_use = 0;
                        return 0;
                }
        }
@@ -733,7 +733,7 @@ static int racial_aux(power_desc_type *pd_ptr)
        }
 
        /* take time and pay the price */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        /* Success? */
        if (randint1(p_ptr->stat_cur[use_stat]) >=
@@ -752,7 +752,7 @@ static int racial_aux(power_desc_type *pd_ptr)
  * @brief レイシャル・パワー発動時に口を使う継続的な詠唱処理を中断する
  * @return なし
  */
-void ratial_stop_mouth()
+void ratial_stop_mouth(void)
 {
        if (music_singing_any()) stop_singing();
        if (hex_spelling_any()) stop_hex_spell_all();
@@ -780,8 +780,8 @@ static bool cmd_racial_power_aux(s32b command)
                        for (i = 0; i < 6; i++)
                        {
                                dir = randint0(8);
-                               y = py + ddy_ddd[dir];
-                               x = px + ddx_ddd[dir];
+                               y = p_ptr->y + ddy_ddd[dir];
+                               x = p_ptr->x + ddx_ddd[dir];
                                c_ptr = &cave[y][x];
 
                                /* Hack -- attack monsters */
@@ -798,7 +798,7 @@ static bool cmd_racial_power_aux(s32b command)
                if (p_ptr->realm1 == REALM_HEX)
                {
                        bool retval = stop_hex_spell();
-                       if (retval) energy_use = 10;
+                       if (retval) p_ptr->energy_use = 10;
                        return (retval);
                }
                case CLASS_MAGE:
@@ -827,8 +827,8 @@ static bool cmd_racial_power_aux(s32b command)
                        int x, y;
 
                        if (!get_rep_dir(&dir, FALSE)) return FALSE;
-                       y = py + ddy[dir];
-                       x = px + ddx[dir];
+                       y = p_ptr->y + ddy[dir];
+                       x = p_ptr->x + ddx[dir];
                        if (cave[y][x].m_idx)
                        {
                                py_attack(y, x, 0);
@@ -928,8 +928,8 @@ static bool cmd_racial_power_aux(s32b command)
                                int x, y;
 
                                if (!get_rep_dir(&dir, FALSE)) return FALSE;
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                if (cave[y][x].m_idx)
                                {
                                        if (one_in_(2)) 
@@ -1030,7 +1030,7 @@ static bool cmd_racial_power_aux(s32b command)
                        if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return FALSE;
 
                        stop_singing();
-                       energy_use = 10;
+                       p_ptr->energy_use = 10;
                        break;
                }
                case CLASS_RED_MAGE:
@@ -1093,7 +1093,7 @@ static bool cmd_racial_power_aux(s32b command)
                        {
                                set_action(ACTION_LEARN);
                        }
-                       energy_use = 0;
+                       p_ptr->energy_use = 0;
                        break;
                }
                case CLASS_CAVALRY:
@@ -1167,7 +1167,7 @@ static bool cmd_racial_power_aux(s32b command)
                                        msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
                                        return FALSE;
                                }
-                               if (is_mirror_grid(&cave[py][px]))
+                               if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x]))
                                {
                                        msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
 
@@ -1196,7 +1196,7 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        else
                        {
-                               cave_type *c_ptr = &cave[py][px];
+                               cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
                                feature_type *f_ptr = &f_info[c_ptr->feat];
 
                                if (!have_flag(f_ptr->flags, FF_PROJECT) ||
@@ -1211,7 +1211,7 @@ static bool cmd_racial_power_aux(s32b command)
                        }
 
 
-                       energy_use = 0;
+                       p_ptr->energy_use = 0;
                        break;
                }
 
@@ -1249,8 +1249,8 @@ static bool cmd_racial_power_aux(s32b command)
 
                                /* Only works on adjacent monsters */
                                if (!get_rep_dir(&dir, FALSE)) return FALSE;   /* was get_aim_dir */
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                c_ptr = &cave[y][x];
 
                                ratial_stop_mouth();
@@ -1310,7 +1310,7 @@ static bool cmd_racial_power_aux(s32b command)
                                object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
 
                                /* Drop the object from heaven */
-                               (void)drop_near(q_ptr, -1, py, px);
+                               (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
                                msg_print(_("食事を料理して作った。", "You cook some food."));
                        }
                        break;
@@ -1603,8 +1603,8 @@ static bool cmd_racial_power_aux(s32b command)
 
                                /* Only works on adjacent monsters */
                                if (!get_rep_dir(&dir,FALSE)) return FALSE;   /* was get_aim_dir */
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
+                               y = p_ptr->y + ddy[dir];
+                               x = p_ptr->x + ddx[dir];
                                c_ptr = &cave[y][x];
 
                                ratial_stop_mouth();
@@ -1701,7 +1701,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                default:
                        msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
-                       energy_use = 0;
+                       p_ptr->energy_use = 0;
        }
        }
        return TRUE;
@@ -1735,7 +1735,7 @@ void do_cmd_racial_power(void)
        if (p_ptr->confused)
        {
                msg_print(_("混乱していて特殊能力を使えません!", "You are too confused to use any powers!"));
-               energy_use = 0;
+               p_ptr->energy_use = 0;
                return;
        }
 
@@ -2721,7 +2721,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                                case '0':
                                {
                                        screen_load();
-                                       energy_use = 0;
+                                       p_ptr->energy_use = 0;
                                        return;
                                }
 
@@ -2891,7 +2891,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
        /* Abort if needed */
        if (!flag)
        {
-               energy_use = 0;
+               p_ptr->energy_use = 0;
                return;
        }
 #ifdef ALLOW_REPEAT
@@ -2936,7 +2936,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                        p_ptr->window |= (PW_PLAYER | PW_SPELL);
                }
        }
-       else energy_use = 0;
+       else p_ptr->energy_use = 0;
 
        /* Success */
        return;