OSDN Git Service

[Refactor] #37353 混乱時のコマンド制限処理を cmd_limit_confused() に統合。 / Integrate command limitat...
[hengband/hengband.git] / src / racial.c
index 2a67f85..ef6bca7 100644 (file)
  */
 
 #include "angband.h"
-
-/*!
- * @brief 対象のアイテムが矢やクロスボウの矢の材料になるかを返す。/
- * Hook to determine if an object is contertible in an arrow/bolt
- * @param o_ptr オブジェクトの構造体の参照ポインタ。
- * @return 材料にできるならTRUEを返す
- */
-static bool item_tester_hook_convertible(object_type *o_ptr)
-{
-       if((o_ptr->tval==TV_JUNK) || (o_ptr->tval==TV_SKELETON)) return TRUE;
-
-       if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON)) return TRUE;
-       /* Assume not */
-       return (FALSE);
-}
-
-/*!
- * @brief レイシャル「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
- * Hook to determine if an object is contertible in an arrow/bolt
- * @return 製造を実際に行ったらTRUE、キャンセルしたらFALSEを返す
- */
-static bool do_cmd_archer(void)
-{
-       int ext=0;
-       char ch;
-
-       object_type     forge;
-       object_type     *q_ptr;
-
-       char com[80];
-       char o_name[MAX_NLEN];
-
-       q_ptr = &forge;
-
-       if(p_ptr->lev >= 20)
-               sprintf(com, _("[S]弾, [A]矢, [B]クロスボウの矢 :", "Create [S]hots, Create [A]rrow or Create [B]olt ?"));
-       else if(p_ptr->lev >= 10)
-               sprintf(com, _("[S]弾, [A]矢:", "Create [S]hots or Create [A]rrow ?"));
-       else
-               sprintf(com, _("[S]弾:", "Create [S]hots ?"));
-
-       if (p_ptr->confused)
-       {
-               msg_print(_("混乱してる!", "You are too confused!"));
-               return FALSE;
-       }
-
-       if (p_ptr->blind)
-       {
-               msg_print(_("目が見えない!", "You are blind!"));
-               return FALSE;
-       }
-
-       while (TRUE)
-       {
-               if (!get_com(com, &ch, TRUE))
-               {
-                       return FALSE;
-               }
-               if (ch == 'S' || ch == 's')
-               {
-                       ext = 1;
-                       break;
-               }
-               if ((ch == 'A' || ch == 'a')&&(p_ptr->lev >= 10))
-               {
-                       ext = 2;
-                       break;
-               }
-               if ((ch == 'B' || ch == 'b')&&(p_ptr->lev >= 20))
-               {
-                       ext = 3;
-                       break;
-               }
-       }
-
-       /**********Create shots*********/
-       if (ext == 1)
-       {
-               int x,y, dir;
-               cave_type *c_ptr;
-
-               if (!get_rep_dir(&dir, FALSE)) return FALSE;
-               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))
-               {
-                       msg_print(_("そこには岩石がない。", "You need pile of rubble."));
-                       return FALSE;
-               }
-               else if (!cave_have_flag_grid(c_ptr, FF_CAN_DIG) || !cave_have_flag_grid(c_ptr, FF_HURT_ROCK))
-               {
-                       msg_print(_("硬すぎて崩せなかった。", "You failed to make ammo."));
-               }
-               else
-               {
-                       s16b slot;
-
-                       /* Get local object */
-                       q_ptr = &forge;
-
-                       /* Hack -- Give the player some small firestones */
-                       object_prep(q_ptr, lookup_kind(TV_SHOT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev) + 1));
-                       q_ptr->number = (byte)rand_range(15,30);
-                       object_aware(q_ptr);
-                       object_known(q_ptr);
-                       apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
-                       q_ptr->discount = 99;
-
-                       slot = inven_carry(q_ptr);
-
-                       object_desc(o_name, q_ptr, 0);
-                       msg_format(_("%sを作った。", "You make some ammo."), o_name);
-
-                       /* Auto-inscription */
-                       if (slot >= 0) autopick_alter_item(slot, FALSE);
-
-                       /* Destroy the wall */
-                       cave_alter_feat(y, x, FF_HURT_ROCK);
-
-                       p_ptr->update |= (PU_FLOW);
-               }
-       }
-       /**********Create arrows*********/
-       else if (ext == 2)
-       {
-               OBJECT_IDX item;
-               cptr q, s;
-               s16b slot;
-
-               item_tester_hook = item_tester_hook_convertible;
-
-               /* Get an item */
-               q = _("どのアイテムから作りますか? ", "Convert which item? ");
-               s = _("材料を持っていない。", "You have no item to convert.");
-               if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
-
-               /* Get the item (in the pack) */
-               if (item >= 0)
-               {
-                       q_ptr = &inventory[item];
-               }
-
-               /* Get the item (on the floor) */
-               else
-               {
-                       q_ptr = &o_list[0 - item];
-               }
-
-               /* Get local object */
-               q_ptr = &forge;
-
-               /* Hack -- Give the player some small firestones */
-               object_prep(q_ptr, lookup_kind(TV_ARROW, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev)+ 1));
-               q_ptr->number = (byte)rand_range(5, 10);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
-
-               q_ptr->discount = 99;
-
-               object_desc(o_name, q_ptr, 0);
-               msg_format(_("%sを作った。", "You make some ammo."), o_name);
-
-               if (item >= 0)
-               {
-                       inven_item_increase(item, -1);
-                       inven_item_describe(item);
-                       inven_item_optimize(item);
-               }
-               else
-               {
-                       floor_item_increase(0 - item, -1);
-                       floor_item_describe(0 - item);
-                       floor_item_optimize(0 - item);
-               }
-
-               slot = inven_carry(q_ptr);
-
-               /* Auto-inscription */
-               if (slot >= 0) autopick_alter_item(slot, FALSE);
-       }
-       /**********Create bolts*********/
-       else if (ext == 3)
-       {
-               OBJECT_IDX item;
-               cptr q, s;
-               s16b slot;
-
-               item_tester_hook = item_tester_hook_convertible;
-
-               /* Get an item */
-               q = _("どのアイテムから作りますか? ", "Convert which item? ");
-               s = _("材料を持っていない。", "You have no item to convert.");
-               if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;
-
-               /* Get the item (in the pack) */
-               if (item >= 0)
-               {
-                       q_ptr = &inventory[item];
-               }
-
-               /* Get the item (on the floor) */
-               else
-               {
-                       q_ptr = &o_list[0 - item];
-               }
-
-               /* Get local object */
-               q_ptr = &forge;
-
-               /* Hack -- Give the player some small firestones */
-               object_prep(q_ptr, lookup_kind(TV_BOLT, (OBJECT_SUBTYPE_VALUE)m_bonus(1, p_ptr->lev)+1));
-               q_ptr->number = (byte)rand_range(4, 8);
-               object_aware(q_ptr);
-               object_known(q_ptr);
-               apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
-
-               q_ptr->discount = 99;
-
-               object_desc(o_name, q_ptr, 0);
-               msg_format(_("%sを作った。", "You make some ammo."), o_name);
-
-               if (item >= 0)
-               {
-                       inven_item_increase(item, -1);
-                       inven_item_describe(item);
-                       inven_item_optimize(item);
-               }
-               else
-               {
-                       floor_item_increase(0 - item, -1);
-                       floor_item_describe(0 - item);
-                       floor_item_optimize(0 - item);
-               }
-
-               slot = inven_carry(q_ptr);
-
-               /* Auto-inscription */
-               if (slot >= 0) autopick_alter_item(slot, FALSE);
-       }
-       return TRUE;
-}
-
-/*!
- * @brief 魔道具術師の魔力取り込み処理
- * @return 取り込みを実行したらTRUE、キャンセルしたらFALSEを返す
- */
-bool gain_magic(void)
-{
-       OBJECT_IDX item;
-       PARAMETER_VALUE pval;
-       int ext = 0;
-       cptr q, s;
-       object_type *o_ptr;
-       char o_name[MAX_NLEN];
-
-       /* Only accept legal items */
-       item_tester_hook = item_tester_hook_recharge;
-
-       /* Get an item */
-       q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
-       s = _("魔力を取り込めるアイテムがない。", "You have nothing to gain power.");
-
-       if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return (FALSE);
-
-       /* Get the item (in the pack) */
-       if (item >= 0)
-       {
-               o_ptr = &inventory[item];
-       }
-
-       /* Get the item (on the floor) */
-       else
-       {
-               o_ptr = &o_list[0 - item];
-       }
-
-       if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
-       {
-               msg_print(_("この杖には発動の為の能力は何も備わっていないようだ。", "This staff doesn't have any magical ability."));
-               return FALSE;
-       }
-
-
-       if (!object_is_known(o_ptr))
-       {
-               msg_print(_("鑑定されていないと取り込めない。", "You need to identify before absorbing."));
-               return FALSE;
-       }
-
-       if (o_ptr->timeout)
-       {
-               msg_print(_("充填中のアイテムは取り込めない。", "This item is still charging."));
-               return FALSE;
-       }
-
-       pval = o_ptr->pval;
-       if (o_ptr->tval == TV_ROD)
-               ext = 72;
-       else if (o_ptr->tval == TV_WAND)
-               ext = 36;
-
-       if (o_ptr->tval == TV_ROD)
-       {
-               p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)o_ptr->number;
-               if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
-       }
-       else
-       {
-               int num;
-               for (num = o_ptr->number; num; num--)
-               {
-                       int gain_num = pval;
-                       if (o_ptr->tval == TV_WAND) gain_num = (pval + num - 1) / num;
-                       if (p_ptr->magic_num2[o_ptr->sval + ext])
-                       {
-                               gain_num *= 256;
-                               gain_num = (gain_num/3 + randint0(gain_num/3)) / 256;
-                               if (gain_num < 1) gain_num = 1;
-                       }
-                       p_ptr->magic_num2[o_ptr->sval + ext] += (MAGIC_NUM2)gain_num;
-                       if (p_ptr->magic_num2[o_ptr->sval + ext] > 99) p_ptr->magic_num2[o_ptr->sval + ext] = 99;
-                       p_ptr->magic_num1[o_ptr->sval + ext] += pval * 0x10000;
-                       if (p_ptr->magic_num1[o_ptr->sval + ext] > 99 * 0x10000) p_ptr->magic_num1[o_ptr->sval + ext] = 99 * 0x10000;
-                       if (p_ptr->magic_num1[o_ptr->sval + ext] > p_ptr->magic_num2[o_ptr->sval + ext] * 0x10000) p_ptr->magic_num1[o_ptr->sval + ext] = p_ptr->magic_num2[o_ptr->sval + ext] * 0x10000;
-                       if (o_ptr->tval == TV_WAND) pval -= (pval + num - 1) / num;
-               }
-       }
-
-       object_desc(o_name, o_ptr, 0);
-       /* Message */
-       msg_format(_("%sの魔力を取り込んだ。", "You absorb magic of %s."), o_name);
-
-       /* Eliminate the item (from the pack) */
-       if (item >= 0)
-       {
-               inven_item_increase(item, -999);
-               inven_item_describe(item);
-               inven_item_optimize(item);
-       }
-
-       /* Eliminate the item (from the floor) */
-       else
-       {
-               floor_item_increase(0 - item, -999);
-               floor_item_describe(0 - item);
-               floor_item_optimize(0 - item);
-       }
-       p_ptr->energy_use = 100;
-       return TRUE;
-}
+#include "cmd-magiceat.h"
+#include "cmd-zapwand.h"
+#include "cmd-pet.h"
+#include "melee.h"
+#include "object-hook.h"
+
+#include "mutation.h"
+#include "player-status.h"
+#include "spells-status.h"
+#include "spells-object.h"
+#include "cmd-spell.h"
+#include "realm-hex.h"
 
 /*!
  * @brief 魔法系コマンドを実行できるかの判定を返す
@@ -403,13 +61,7 @@ static bool choose_kamae(void)
        int i;
        char buf[80];
 
-       if (p_ptr->confused)
-       {
-               msg_print(_("混乱していて構えられない!", "Too confused."));
-               return FALSE;
-       }
-
-       /* Save screen */
+       if (cmd_limit_confused(p_ptr)) return FALSE;
        screen_save();
        prt(_(" a) 構えをとく", " a) No form"), 2, 20);
 
@@ -496,11 +148,7 @@ static bool choose_kata(void)
        int i;
        char buf[80];
 
-       if (p_ptr->confused)
-       {
-               msg_print(_("混乱していて構えられない!", "Too confused."));
-               return FALSE;
-       }
+       if (cmd_limit_confused(p_ptr)) return FALSE;
 
        if (p_ptr->stun)
        {
@@ -513,8 +161,6 @@ static bool choose_kata(void)
                msg_print(_("体が震えて構えられない!", "You are trembling with fear!"));
                return FALSE;
        }
-
-       /* Save screen */
        screen_save();
        prt(_(" a) 型を崩す", " a) No Form"), 2, 20);
 
@@ -580,13 +226,11 @@ static bool choose_kata(void)
        else
        {
                p_ptr->special_defense &= ~(KATA_MASK);
-               p_ptr->update |= (PU_BONUS);
-               p_ptr->update |= (PU_MONSTERS);
+               p_ptr->update |= (PU_BONUS | PU_MONSTERS);
                msg_format(_("%sの型で構えた。", "You assume a posture of %s form."),kata_shurui[new_kata].desc);
                p_ptr->special_defense |= (KATA_IAI << new_kata);
        }
-       p_ptr->redraw |= (PR_STATE);
-       p_ptr->redraw |= (PR_STATUS);
+       p_ptr->redraw |= (PR_STATE | PR_STATUS);
        screen_load();
        return TRUE;
 }
@@ -602,12 +246,12 @@ typedef struct power_desc_type power_desc_type;
  */
 struct power_desc_type
 {
-       char name[40];
-       PLAYER_LEVEL level;
-       int  cost;
-       int  stat;
-       int  fail;
-       int  number;
+       GAME_TEXT name[MAX_NLEN];      //!<レイシャル名
+       PLAYER_LEVEL level;     //!<体得レベル
+       int cost;
+       int stat;
+       int fail;
+       int number;
 };
 
 
@@ -616,10 +260,10 @@ struct power_desc_type
  * @param pd_ptr 発動したいレイシャル・パワー情報の構造体参照ポインタ
  * @return 成功率(%)を返す
  */
-static int racial_chance(power_desc_type *pd_ptr)
+static PERCENTAGE racial_chance(power_desc_type *pd_ptr)
 {
        PLAYER_LEVEL min_level  = pd_ptr->level;
-       int  difficulty = pd_ptr->fail;
+       int difficulty = pd_ptr->fail;
 
        int i;
        int val;
@@ -676,10 +320,10 @@ static int  racial_cost;
  */
 static int racial_aux(power_desc_type *pd_ptr)
 {
-       s16b min_level  = pd_ptr->level;
-       int  use_stat   = pd_ptr->stat;
-       int  difficulty = pd_ptr->fail;
-       int  use_hp = 0;
+       PLAYER_LEVEL min_level  = pd_ptr->level;
+       int use_stat   = pd_ptr->stat;
+       int difficulty = pd_ptr->fail;
+       int use_hp = 0;
 
        racial_cost = pd_ptr->cost;
 
@@ -693,15 +337,13 @@ static int racial_aux(power_desc_type *pd_ptr)
                                         "You need to attain level %d to use this power."), min_level);
 
                p_ptr->energy_use = 0;
-               return 0;
+               return FALSE;
        }
 
-       /* Too confused */
-       else if (p_ptr->confused)
+       if (cmd_limit_confused(p_ptr))
        {
-               msg_print(_("混乱していてその能力は使えない。", "You are too confused to use this power."));
                p_ptr->energy_use = 0;
-               return 0;
+               return FALSE;
        }
 
        /* Risk death? */
@@ -710,7 +352,7 @@ static int racial_aux(power_desc_type *pd_ptr)
                if (!get_check(_("本当に今の衰弱した状態でこの能力を使いますか?", "Really use the power in your weakened state? ")))
                {
                        p_ptr->energy_use = 0;
-                       return 0;
+                       return FALSE;
                }
        }
 
@@ -736,8 +378,7 @@ static int racial_aux(power_desc_type *pd_ptr)
        p_ptr->energy_use = 100;
 
        /* Success? */
-       if (randint1(p_ptr->stat_cur[use_stat]) >=
-           ((difficulty / 2) + randint1(difficulty / 2)))
+       if (randint1(p_ptr->stat_cur[use_stat]) >= ((difficulty / 2) + randint1(difficulty / 2)))
        {
                return 1;
        }
@@ -748,15 +389,6 @@ static int racial_aux(power_desc_type *pd_ptr)
        return -1;
 }
 
-/*!
- * @brief レイシャル・パワー発動時に口を使う継続的な詠唱処理を中断する
- * @return なし
- */
-void ratial_stop_mouth(void)
-{
-       if (music_singing_any()) stop_singing();
-       if (hex_spelling_any()) stop_hex_spell_all();
-}
 
 /*!
  * @brief レイシャル・パワー発動処理
@@ -765,8 +397,8 @@ void ratial_stop_mouth(void)
  */
 static bool cmd_racial_power_aux(s32b command)
 {
-       s16b        plev = p_ptr->lev;
-       int         dir = 0;
+       PLAYER_LEVEL plev = p_ptr->lev;
+       DIRECTION dir = 0;
 
        if (command <= -3)
        {
@@ -774,24 +406,7 @@ static bool cmd_racial_power_aux(s32b command)
                {
                case CLASS_WARRIOR:
                {
-                       int y = 0, x = 0, i;
-                       cave_type       *c_ptr;
-
-                       for (i = 0; i < 6; i++)
-                       {
-                               dir = randint0(8);
-                               y = p_ptr->y + ddy_ddd[dir];
-                               x = p_ptr->x + ddx_ddd[dir];
-                               c_ptr = &cave[y][x];
-
-                               /* Hack -- attack monsters */
-                               if (c_ptr->m_idx)
-                                       py_attack(y, x, 0);
-                               else
-                               {
-                                       msg_print(_("攻撃が空をきった。", "You attack the empty air."));
-                               }
-                       }
+                       return sword_dancing(p_ptr);
                        break;
                }
                case CLASS_HIGH_MAGE:
@@ -824,23 +439,7 @@ static bool cmd_racial_power_aux(s32b command)
                }
                case CLASS_ROGUE:
                {
-                       int x, y;
-
-                       if (!get_rep_dir(&dir, FALSE)) return FALSE;
-                       y = p_ptr->y + ddy[dir];
-                       x = p_ptr->x + ddx[dir];
-                       if (cave[y][x].m_idx)
-                       {
-                               py_attack(y, x, 0);
-                               if (randint0(p_ptr->skill_dis) < 7)
-                                       msg_print(_("うまく逃げられなかった。", "You are failed to run away."));
-                               else teleport_player(30, 0L);
-                       }
-                       else
-                       {
-                               msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
-                               msg_print(NULL);
-                       }
+                       if(!panic_hit()) return FALSE;
                        break;
                }
                case CLASS_RANGER:
@@ -861,48 +460,17 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        if (command == -3)
                        {
-                               int gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, 
-                                                               _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
-                               if (gain_sp)
-                               {
-                                       p_ptr->csp += gain_sp;
-                                       if (p_ptr->csp > p_ptr->msp)
-                                       {
-                                               p_ptr->csp = p_ptr->msp;
-                                               p_ptr->csp_frac = 0;
-                                       }
-                               }
-                               else
-                               {
-                                       msg_print(_("変換に失敗した。", "You failed to convert."));
-                               }
+                               return comvert_hp_to_mp(p_ptr);
                        }
                        else if (command == -4)
                        {
-                               if (p_ptr->csp >= p_ptr->lev / 5)
-                               {
-                                       p_ptr->csp -= p_ptr->lev / 5;
-                                       hp_player(p_ptr->lev);
-                               }
-                               else
-                               {
-                                       msg_print(_("変換に失敗した。", "You failed to convert."));
-                               }
+                               return comvert_mp_to_hp(p_ptr);
                        }
-
-                       /* Redraw mana and hp */
-                       p_ptr->redraw |= (PR_HP | PR_MANA);
-
                        break;
                }
                case CLASS_CHAOS_WARRIOR:
                {
-                       msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
-                       slow_monsters(p_ptr->lev);
-                       stun_monsters(p_ptr->lev * 4);
-                       confuse_monsters(p_ptr->lev * 4);
-                       turn_monsters(p_ptr->lev * 4);
-                       stasis_monsters(p_ptr->lev * 4);
+                       return confusing_light(p_ptr);
                        break;
                }
                case CLASS_MONK:
@@ -925,56 +493,14 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        else if (command == -4)
                        {
-                               int x, y;
-
-                               if (!get_rep_dir(&dir, FALSE)) return FALSE;
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               if (cave[y][x].m_idx)
-                               {
-                                       if (one_in_(2)) 
-                                               msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!", 
-                                                                       "Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!"));
-                                       else
-                                               msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
-                                                                       "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
-
-                                       py_attack(y, x, 0);
-                                       if (cave[y][x].m_idx)
-                                       {
-                                               handle_stuff();
-                                               py_attack(y, x, 0);
-                                       }
-                                       p_ptr->energy_need += ENERGY_NEED();
-                               }
-                               else
-                               {
-                                       msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
-                                       msg_print(NULL);
-                               }
+                               return double_attack(p_ptr);
                        }
                        break;
                }
                case CLASS_MINDCRAFTER:
                case CLASS_FORCETRAINER:
                {
-                       if (total_friends)
-                       {
-                               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
-                               return FALSE;
-                       }
-                       msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
-
-                       p_ptr->csp += (3 + p_ptr->lev/20);
-                       if (p_ptr->csp >= p_ptr->msp)
-                       {
-                               p_ptr->csp = p_ptr->msp;
-                               p_ptr->csp_frac = 0;
-                       }
-
-                       /* Redraw mana */
-                       p_ptr->redraw |= (PR_MANA);
-                       break;
+                       return clear_mind(p_ptr);
                }
                case CLASS_TOURIST:
                {
@@ -1001,23 +527,23 @@ static bool cmd_racial_power_aux(s32b command)
                        if (command == -3)
                        {
                                if (!get_aim_dir(&dir)) return FALSE;
-                               (void)fire_ball_hide(GF_CONTROL_LIVING, dir, p_ptr->lev, 0);
+                               (void)fire_ball_hide(GF_CHARM_LIVING, dir, p_ptr->lev, 0);
                        }
                        else if (command == -4)
                        {
-                               project_hack(GF_CONTROL_LIVING, p_ptr->lev);
+                               project_all_los(GF_CHARM_LIVING, p_ptr->lev);
                        }
                        break;
                }
                case CLASS_ARCHER:
                {
-                       if (!do_cmd_archer()) return FALSE;
+                       if (!create_ammo()) return FALSE;
                        break;
                }
                case CLASS_MAGIC_EATER:
                {
                        if (command == -3) {
-                               if (!gain_magic()) return FALSE;
+                               if (!import_magic_device()) return FALSE;
                        } else if (command == -4) {
                                if (!can_do_cmd_cast()) return FALSE;
                                if (!do_cmd_magic_eater(FALSE, TRUE)) return FALSE;
@@ -1027,7 +553,7 @@ static bool cmd_racial_power_aux(s32b command)
                case CLASS_BARD:
                {
                        /* Singing is already stopped */
-                       if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return FALSE;
+                       if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return FALSE;
 
                        stop_singing();
                        p_ptr->energy_use = 10;
@@ -1047,33 +573,10 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        if (command == -3)
                        {
-                               int max_csp = MAX(p_ptr->msp*4, p_ptr->lev*5+5);
-
-                               if (total_friends)
-                               {
-                                       msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
-                                       return FALSE;
-                               }
-                               if (p_ptr->special_defense & KATA_MASK)
-                               {
-                                       msg_print(_("今は構えに集中している。", "You need concentration on your form."));
-                                       return FALSE;
-                               }
-                               msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
-
-                               p_ptr->csp += p_ptr->msp / 2;
-                               if (p_ptr->csp >= max_csp)
-                               {
-                                       p_ptr->csp = max_csp;
-                                       p_ptr->csp_frac = 0;
-                               }
-
-                               /* Redraw mana */
-                               p_ptr->redraw |= (PR_MANA);
                        }
                        else if (command == -4)
                        {
-                               if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+                               if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
                                {
                                        msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
                                        return FALSE;
@@ -1098,47 +601,11 @@ static bool cmd_racial_power_aux(s32b command)
                }
                case CLASS_CAVALRY:
                {
-                       char m_name[80];
-                       monster_type *m_ptr;
-                       monster_race *r_ptr;
-                       int rlev;
-
-                       if (p_ptr->riding)
-                       {
-                               msg_print(_("今は乗馬中だ。", "You ARE riding."));
-                               return FALSE;
-                       }
-                       if (!do_riding(TRUE)) return TRUE;
-                       m_ptr = &m_list[p_ptr->riding];
-                       r_ptr = &r_info[m_ptr->r_idx];
-                       monster_desc(m_name, m_ptr, 0);
-                       msg_format(_("%sに乗った。", "You ride on %s."),m_name);
-                       if (is_pet(m_ptr)) break;
-                       rlev = r_ptr->level;
-                       if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
-                       if (rlev > 60) rlev = 60+(rlev-60)/2;
-                       if ((randint1(p_ptr->skill_exp[GINOU_RIDING] / 120 + p_ptr->lev * 2 / 3) > rlev)
-                           && one_in_(2) && !p_ptr->inside_arena && !p_ptr->inside_battle
-                           && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
-                           && (rlev < p_ptr->lev * 3 / 2 + randint0(p_ptr->lev / 5)))
-                       {
-                               msg_format(_("%sを手なずけた。", "You tame %s."),m_name);
-                               set_pet(m_ptr);
-                       }
-                       else
-                       {
-                               msg_format(_("%sに振り落とされた!", "You have thrown off by %s."),m_name);
-                               rakuba(1,TRUE);
-
-                               /* Paranoia */
-                               /* 落馬処理に失敗してもとにかく乗馬解除 */
-                               p_ptr->riding = 0;
-                       }
-                       break;
+                       return rodeo(p_ptr);
                }
                case CLASS_BERSERKER:
                {
-                       if (!word_of_recall()) return FALSE;
+                       if (!recall_player(p_ptr, randint0(21) + 15)) return FALSE;
                        break;
                }
                case CLASS_SMITH:
@@ -1162,60 +629,14 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        else if (command == -4)
                        {
-                               if (total_friends)
-                               {
-                                       msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
-                                       return FALSE;
-                               }
-                               if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x]))
-                               {
-                                       msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
-
-                                       p_ptr->csp += (5 + p_ptr->lev * p_ptr->lev / 100);
-                                       if (p_ptr->csp >= p_ptr->msp)
-                                       {
-                                               p_ptr->csp = p_ptr->msp;
-                                               p_ptr->csp_frac = 0;
-                                       }
-
-                                       /* Redraw mana */
-                                       p_ptr->redraw |= (PR_MANA);
-                               }
-                               else
-                               {
-                                       msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
-                               }
+                               return mirror_concentration(p_ptr);
                        }
                        break;
                }
                case CLASS_NINJA:
-               {
-                       if (p_ptr->action == ACTION_HAYAGAKE)
-                       {
-                               set_action(ACTION_NONE);
-                       }
-                       else
-                       {
-                               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) ||
-                                   (!p_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
-                               {
-                                       msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
-                               }
-                               else
-                               {
-                                       set_action(ACTION_HAYAGAKE);
-                               }
-                       }
-
-
-                       p_ptr->energy_use = 0;
+                       hayagake(p_ptr);
                        break;
                }
-
-               }
        }
        else if (p_ptr->mimic_form)
        {
@@ -1224,64 +645,10 @@ static bool cmd_racial_power_aux(s32b command)
                case MIMIC_DEMON:
                case MIMIC_DEMON_LORD:
                {
-                       int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
-                       if (!get_aim_dir(&dir)) return FALSE;
-                       ratial_stop_mouth();
-#ifdef JP
-                       msg_format("あなたは%sのブレスを吐いた。",((type == GF_NETHER) ? "地獄" : "火炎"));
-#else
-                       msg_format("You breathe %s.",((type == GF_NETHER) ? "nether" : "fire"));
-#endif
-
-                       fire_ball(type, dir, plev * 3, -(plev / 15) - 1);
-                       break;
+                       return demonic_breath(p_ptr);
                }
                case MIMIC_VAMPIRE:
-                       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
-                       {
-                               msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
-                               return FALSE;
-                       }
-                       else
-                       {
-                               int y, x, dummy = 0;
-                               cave_type *c_ptr;
-
-                               /* Only works on adjacent monsters */
-                               if (!get_rep_dir(&dir, FALSE)) return FALSE;   /* was get_aim_dir */
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
-
-                               ratial_stop_mouth();
-
-                               if (!c_ptr->m_idx)
-                               {
-                                       msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
-                                       break;
-                               }
-
-                               msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
-                               dummy = plev + randint1(plev) * MAX(1, plev / 10);   /* Dmg */
-                               if (drain_life(dir, dummy))
-                               {
-                                       if (p_ptr->food < PY_FOOD_FULL)
-                                               /* No heal if we are "full" */
-                                               (void)hp_player(dummy);
-                                       else
-                                               msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
-
-                                       /* Gain nutritional sustenance: 150/hp drained */
-                                       /* A Food ration gives 5000 food points (by contrast) */
-                                       /* Don't ever get more than "Full" this way */
-                                       /* But if we ARE Gorged,  it won't cure us */
-                                       dummy = p_ptr->food + MIN(5000, 100 * dummy);
-                                       if (p_ptr->food < PY_FOOD_MAX)   /* Not gorged already */
-                                               (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
-                               }
-                               else
-                                       msg_print(_("げぇ。ひどい味だ。", "Yechh. That tastes foul."));
-                       }
+                       vampirism();
                        break;
                }
        }
@@ -1299,20 +666,7 @@ static bool cmd_racial_power_aux(s32b command)
                        break;
 
                case RACE_HOBBIT:
-                       {
-                               object_type *q_ptr;
-                               object_type forge;
-
-                               /* Get local object */
-                               q_ptr = &forge;
-
-                               /* Create the food ration */
-                               object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
-
-                               /* Drop the object from heaven */
-                               (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
-                               msg_print(_("食事を料理して作った。", "You cook some food."));
-                       }
+                       return create_ration(p_ptr);
                        break;
 
                case RACE_GNOME:
@@ -1327,9 +681,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_HALF_TROLL:
                        msg_print(_("うがぁぁ!", "RAAAGH!"));
-                       (void)set_afraid(0);
-                       (void)set_shero(10 + randint1(plev), FALSE);
-                       (void)hp_player(30);
+                       (void)berserk(10 + randint1(plev));
                        break;
 
                case RACE_AMBERITE:
@@ -1342,27 +694,15 @@ static bool cmd_racial_power_aux(s32b command)
                        {
                                msg_print(_("あなたは「パターン」を心に描いてその上を歩いた...", "You picture the Pattern in your mind and walk it..."));
 
-                               (void)set_poisoned(0);
-                               (void)set_image(0);
-                               (void)set_stun(0);
-                               (void)set_cut(0);
-                               (void)set_blind(0);
-                               (void)set_afraid(0);
-                               (void)do_res_stat(A_STR);
-                               (void)do_res_stat(A_INT);
-                               (void)do_res_stat(A_WIS);
-                               (void)do_res_stat(A_DEX);
-                               (void)do_res_stat(A_CON);
-                               (void)do_res_stat(A_CHR);
+                               (void)true_healing(0);
+                               (void)restore_all_status();
                                (void)restore_level();
                        }
                        break;
 
                case RACE_BARBARIAN:
                        msg_print(_("うぉぉおお!", "Raaagh!"));
-                       (void)set_afraid(0);
-                       (void)set_shero(10 + randint1(plev), FALSE);
-                       (void)hp_player(30);
+                       (void)berserk(10 + randint1(plev));
                        break;
 
                case RACE_HALF_OGRE:
@@ -1388,14 +728,14 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_YEEK:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       ratial_stop_mouth();
+                       stop_mouth();
                        msg_print(_("身の毛もよだつ叫び声を上げた!", "You make a horrible scream!"));
                        (void)fear_monster(dir, plev);
                        break;
 
                case RACE_KLACKON:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       ratial_stop_mouth();
+                       stop_mouth();
                        msg_print(_("酸を吐いた。", "You spit acid."));
                        if (plev < 25) fire_bolt(GF_ACID, dir, plev);
                        else fire_ball(GF_ACID, dir, plev, 2);
@@ -1417,147 +757,11 @@ static bool cmd_racial_power_aux(s32b command)
                case RACE_DARK_ELF:
                        if (!get_aim_dir(&dir)) return FALSE;
                        msg_print(_("マジック・ミサイルを放った。", "You cast a magic missile."));
-                       fire_bolt_or_beam(10, GF_MISSILE, dir,
-                           damroll(3 + ((plev - 1) / 5), 4));
+                       fire_bolt_or_beam(10, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4));
                        break;
 
                case RACE_DRACONIAN:
-                       {
-                               int  Type = (one_in_(3) ? GF_COLD : GF_FIRE);
-#ifdef JP
-                               cptr Type_desc = ((Type == GF_COLD) ? "冷気" : "炎");
-#else
-                               cptr Type_desc = ((Type == GF_COLD) ? "cold" : "fire");
-#endif
-
-                               if (!get_aim_dir(&dir)) return FALSE;
-
-                               if (randint1(100) < plev)
-                               {
-                                       switch (p_ptr->pclass)
-                                       {
-                                               case CLASS_WARRIOR:
-                                               case CLASS_BERSERKER:
-                                               case CLASS_RANGER:
-                                               case CLASS_TOURIST:
-                                               case CLASS_IMITATOR:
-                                               case CLASS_ARCHER:
-                                               case CLASS_SMITH:
-                                                       if (one_in_(3))
-                                                       {
-                                                               Type = GF_MISSILE;
-                                                               Type_desc = _("エレメント", "the elements");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_SHARDS;
-                                                               Type_desc = _("破片", "shards");
-                                                       }
-                                                       break;
-                                               case CLASS_MAGE:
-                                               case CLASS_WARRIOR_MAGE:
-                                               case CLASS_HIGH_MAGE:
-                                               case CLASS_SORCERER:
-                                               case CLASS_MAGIC_EATER:
-                                               case CLASS_RED_MAGE:
-                                               case CLASS_BLUE_MAGE:
-                                               case CLASS_MIRROR_MASTER:
-                                                       if (one_in_(3))
-                                                       {
-                                                               Type = GF_MANA;
-                                                               Type_desc = _("魔力", "mana");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_DISENCHANT;
-                                                               Type_desc = _("劣化", "disenchantment");
-                                                       }
-                                                       break;
-                                               case CLASS_CHAOS_WARRIOR:
-                                                       if (!one_in_(3))
-                                                       {
-                                                               Type = GF_CONFUSION;
-                                                               Type_desc = _("混乱", "confusion");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_CHAOS;
-                                                               Type_desc = _("カオス", "chaos");
-                                                       }
-                                                       break;
-                                               case CLASS_MONK:
-                                               case CLASS_SAMURAI:
-                                               case CLASS_FORCETRAINER:
-                                                       if (!one_in_(3))
-                                                       {
-                                                               Type = GF_CONFUSION;
-                                                               Type_desc = _("混乱", "confusion");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_SOUND;
-                                                               Type_desc = _("轟音", "sound");
-                                                       }
-                                                       break;
-                                               case CLASS_MINDCRAFTER:
-                                                       if (!one_in_(3))
-                                                       {
-                                                               Type = GF_CONFUSION;
-                                                               Type_desc = _("混乱", "confusion");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_PSI;
-                                                               Type_desc = _("精神エネルギー", "mental energy");
-                                                       }
-                                                       break;
-                                               case CLASS_PRIEST:
-                                               case CLASS_PALADIN:
-                                                       if (one_in_(3))
-                                                       {
-                                                               Type = GF_HELL_FIRE;
-                                                               Type_desc = _("地獄の劫火", "hellfire");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_HOLY_FIRE;
-                                                               Type_desc = _("聖なる炎", "holy fire");
-                                                       }
-                                                       break;
-                                               case CLASS_ROGUE:
-                                               case CLASS_NINJA:
-                                                       if (one_in_(3))
-                                                       {
-                                                               Type = GF_DARK;
-                                                               Type_desc = _("暗黒", "darkness");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_POIS;
-                                                               Type_desc = _("毒", "poison");
-                                                       }
-                                                       break;
-                                               case CLASS_BARD:
-                                                       if (!one_in_(3))
-                                                       {
-                                                               Type = GF_SOUND;
-                                                               Type_desc = _("轟音", "sound");
-                                                       }
-                                                       else
-                                                       {
-                                                               Type = GF_CONFUSION;
-                                                               Type_desc = _("混乱", "confusion");
-                                                       }
-                                                       break;
-                                       }
-                               }
-
-                               ratial_stop_mouth();
-                               msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
-
-                               fire_ball(Type, dir, plev * 2,
-                                   -(plev / 15) - 1);
-                       }
+                       return draconian_breath(p_ptr);
                        break;
 
                case RACE_MIND_FLAYER:
@@ -1591,56 +795,12 @@ static bool cmd_racial_power_aux(s32b command)
                        break;
 
                case RACE_VAMPIRE:
-                       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
-                       {
-                               msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
-                               return FALSE;
-                       }
-                       else
-                       {
-                               int y, x, dummy = 0;
-                               cave_type *c_ptr;
-
-                               /* Only works on adjacent monsters */
-                               if (!get_rep_dir(&dir,FALSE)) return FALSE;   /* was get_aim_dir */
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
-
-                               ratial_stop_mouth();
-
-                               if (!c_ptr->m_idx)
-                               {
-                                       msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
-                                       break;
-                               }
-
-                               msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
-                               dummy = plev + randint1(plev) * MAX(1, plev / 10);   /* Dmg */
-                               if (drain_life(dir, dummy))
-                               {
-                                       if (p_ptr->food < PY_FOOD_FULL)
-                                               /* No heal if we are "full" */
-                                               (void)hp_player(dummy);
-                                       else
-                                               msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
-
-                                       /* Gain nutritional sustenance: 150/hp drained */
-                                       /* A Food ration gives 5000 food points (by contrast) */
-                                       /* Don't ever get more than "Full" this way */
-                                       /* But if we ARE Gorged,  it won't cure us */
-                                       dummy = p_ptr->food + MIN(5000, 100 * dummy);
-                                       if (p_ptr->food < PY_FOOD_MAX)   /* Not gorged already */
-                                               (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
-                               }
-                               else
-                                       msg_print(_("げぇ。ひどい味だ。", "Yechh. That tastes foul."));
-                       }
+                       vampirism();
                        break;
 
                case RACE_SPECTRE:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       ratial_stop_mouth();
+                       stop_mouth();
                        msg_print(_("あなたはおどろおどろしい叫び声をあげた!", "You emit an eldritch howl!"));
                        (void)fear_monster(dir, plev);
                        break;
@@ -1652,18 +812,7 @@ static bool cmd_racial_power_aux(s32b command)
                        break;
 
                case RACE_DEMON:
-                       {
-                               int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
-                               if (!get_aim_dir(&dir)) return FALSE;
-                               ratial_stop_mouth();
-#ifdef JP
-                               msg_format("あなたは%sのブレスを吐いた。",((type == GF_NETHER) ? "地獄" : "火炎"));
-#else
-                               msg_format("You breathe %s.",((type == GF_NETHER) ? "nether" : "fire"));
-#endif
-
-                               fire_ball(type, dir, plev * 3, -(plev / 15) - 1);
-                       }
+                       return demonic_breath(p_ptr); 
                        break;
 
                case RACE_KUTAR:
@@ -1671,32 +820,7 @@ static bool cmd_racial_power_aux(s32b command)
                        break;
 
                case RACE_ANDROID:
-                       if (!get_aim_dir(&dir)) return FALSE;
-                       if (plev < 10)
-                       {
-                               msg_print(_("レイガンを発射した。", "You fire your ray gun."));
-                               fire_bolt(GF_MISSILE, dir, (plev+1) / 2);
-                       }
-                       else if (plev < 25)
-                       {
-                               msg_print(_("ブラスターを発射した。", "You fire your blaster."));
-                               fire_bolt(GF_MISSILE, dir, plev);
-                       }
-                       else if (plev < 35)
-                       {
-                               msg_print(_("バズーカを発射した。", "You fire your bazooka."));
-                               fire_ball(GF_MISSILE, dir, plev * 2, 2);
-                       }
-                       else if (plev < 45)
-                       {
-                               msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
-                               fire_beam(GF_MISSILE, dir, plev * 2);
-                       }
-                       else
-                       {
-                               msg_print(_("ロケットを発射した。", "You fire a rocket."));
-                               fire_rocket(GF_ROCKET, dir, plev * 5, 2);
-                       }
+                       return android_inside_weapon(p_ptr);
                        break;
 
                default:
@@ -1724,6 +848,7 @@ void do_cmd_racial_power(void)
        char            out_val[160];
        int menu_line = (use_menu ? 1 : 0);
 
+       if (p_ptr->wild_mode) return;
 
        for (num = 0; num < 36; num++)
        {
@@ -1733,9 +858,8 @@ void do_cmd_racial_power(void)
 
        num = 0;
 
-       if (p_ptr->confused)
+       if (cmd_limit_confused(p_ptr))
        {
-               msg_print(_("混乱していて特殊能力を使えません!", "You are too confused to use any powers!"));
                p_ptr->energy_use = 0;
                return;
        }
@@ -2093,7 +1217,7 @@ void do_cmd_racial_power(void)
                        power_desc[num++].number = -1;
                        break;
                case MIMIC_VAMPIRE:
-                       strcpy(power_desc[num].name, _("生命力吸収", "Drain Life"));
+                       strcpy(power_desc[num].name, _("吸血", "Vampiric Drain"));
                        power_desc[num].level = 2;
                        power_desc[num].cost = 1 + (lvl / 3);
                        power_desc[num].stat = A_CON;
@@ -2291,7 +1415,7 @@ void do_cmd_racial_power(void)
                        power_desc[num++].number = -1;
                        break;
                case RACE_VAMPIRE:
-                       strcpy(power_desc[num].name, _("生命力吸収", "Drain Life"));
+                       strcpy(power_desc[num].name, _("吸血", "Vampiric Drain"));
                        power_desc[num].level = 2;
                        power_desc[num].cost = 1 + (lvl / 3);
                        power_desc[num].stat = A_CON;
@@ -2442,7 +1566,7 @@ void do_cmd_racial_power(void)
 
                if (p_ptr->muta1 & MUT1_VAMPIRISM)
                {
-                       strcpy(power_desc[num].name, _("吸血ドレイン", "Vampiric Drain"));
+                       strcpy(power_desc[num].name, _("吸血", "Vampiric Drain"));
                        power_desc[num].level = 2;
                        power_desc[num].cost = (1 + (lvl / 3));
                        power_desc[num].stat = A_CON;
@@ -2703,9 +1827,7 @@ void do_cmd_racial_power(void)
                                _("(特殊能力 %c-%c, *'で一覧, ESCで中断) どの特殊能力を使いますか?", "(Powers %c-%c, *=List, ESC=exit) Use which power? "),
                                I2A(0), (num <= 26) ? I2A(num - 1) : '0' + num - 27);
 
-#ifdef ALLOW_REPEAT
 if (!repeat_pull(&i) || i<0 || i>=num) {
-#endif /* ALLOW_REPEAT */
        if (use_menu) screen_save();
         /* Get a spell from the user */
 
@@ -2777,14 +1899,12 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                                int ctr = 0;
                                char dummy[80];
                                char letter;
-                               int x1, y1;
+                               TERM_LEN x1, y1;
 
                                strcpy(dummy, "");
 
                                /* Show list */
                                redraw = TRUE;
-
-                               /* Save the screen */
                                if (!use_menu) screen_save();
 
                                /* Print header(s) */
@@ -2828,8 +1948,6 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                        {
                                /* Hide list */
                                redraw = FALSE;
-
-                               /* Restore the screen */
                                screen_load();
                        }
 
@@ -2885,8 +2003,6 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                /* Stop the loop */
                flag = TRUE;
        }
-
-       /* Restore the screen */
        if (redraw) screen_load();
 
        /* Abort if needed */
@@ -2895,10 +2011,8 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                p_ptr->energy_use = 0;
                return;
        }
-#ifdef ALLOW_REPEAT
        repeat_push(i);
        } /*if (!repeat_pull(&i) || ...)*/
-#endif /* ALLOW_REPEAT */
        switch (racial_aux(&power_desc[i]))
        {
        case 1:
@@ -2933,7 +2047,6 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                        /* Redraw mana and hp */
                        p_ptr->redraw |= (PR_HP | PR_MANA);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_PLAYER | PW_SPELL);
                }
        }