OSDN Git Service

MP操作が行われた後に再描画が必要な部分の修正.
[hengband/hengband.git] / src / racial.c
index b241e64..6308d93 100644 (file)
@@ -1,15 +1,15 @@
 /* File: racial.c */
 
-/* Purpose: Racial powers (and mutations) */
-
 /*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies.  Other copyrights may also apply.
  */
 
+/* Purpose: Racial powers (and mutations) */
+
 #include "angband.h"
 
 /*
@@ -124,7 +124,7 @@ static bool do_cmd_archer(void)
                        q_ptr->number = (byte)rand_range(15,30);
                        object_aware(q_ptr);
                        object_known(q_ptr);
-                       apply_magic(q_ptr, p_ptr->lev, FALSE, FALSE, FALSE, FALSE);
+                       apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
                        q_ptr->discount = 99;
 
                        (void)inven_carry(q_ptr);
@@ -137,7 +137,7 @@ static bool do_cmd_archer(void)
 #endif
 
                        (void)wall_to_mud(dir);
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW);
+                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
                        p_ptr->window |= (PW_OVERHEAD);
                }
                else
@@ -185,10 +185,10 @@ static bool do_cmd_archer(void)
 
                /* Hack -- Give the player some small firestones */
                object_prep(q_ptr, lookup_kind(TV_ARROW, m_bonus(1, p_ptr->lev)+ 1));
-               q_ptr->number = (byte)rand_range(5,10);
+               q_ptr->number = (byte)rand_range(5, 10);
                object_aware(q_ptr);
                object_known(q_ptr);
-               apply_magic(q_ptr, p_ptr->lev, FALSE, FALSE, FALSE, FALSE);
+               apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
 
                q_ptr->discount = 99;
 
@@ -242,17 +242,17 @@ static bool do_cmd_archer(void)
                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, m_bonus(1, p_ptr->lev)+1));
-               q_ptr->number = (byte)rand_range(4,8);
+               q_ptr->number = (byte)rand_range(4, 8);
                object_aware(q_ptr);
                object_known(q_ptr);
-               apply_magic(q_ptr, p_ptr->lev, FALSE, FALSE, FALSE, FALSE);
+               apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
 
                q_ptr->discount = 99;
 
@@ -316,6 +316,17 @@ s = "
                o_ptr = &o_list[0 - item];
        }
 
+       if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
+       {
+#ifdef JP
+               msg_print("¤³¤Î¾ó¤Ë¤Ïȯư¤Î°Ù¤ÎǽÎϤϲ¿¤âÈ÷¤ï¤Ã¤Æ¤¤¤Ê¤¤¤è¤¦¤À¡£");
+#else
+               msg_print("This staff doesn't have any magical ability.");
+#endif
+               return FALSE;
+       }
+
+
        if (!object_known_p(o_ptr))
        {
 #ifdef JP
@@ -458,7 +469,7 @@ static bool choose_kamae(void)
 #ifdef JP
                                msg_print("¤â¤È¤â¤È¹½¤¨¤Æ¤¤¤Ê¤¤¡£");
 #else
-                               msg_print("You are not assuming a posture.");
+                               msg_print("You are not assuming a posture.");
 #endif
                        screen_load();
                        return TRUE;
@@ -651,15 +662,31 @@ static bool choose_kata(void)
 }
 
 
+typedef struct power_desc_type power_desc_type;
+
+struct power_desc_type
+{
+       char name[40];
+       int  level;
+       int  cost;
+       int  stat;
+       int  fail;
+       int  number;
+};
+
+
 /*
  * Returns the chance to activate a racial power/mutation
  */
-static int racial_chance(s16b min_level, int use_stat, int difficulty)
+static int racial_chance(power_desc_type *pd_ptr)
 {
+       s16b min_level  = pd_ptr->level;
+       int  difficulty = pd_ptr->fail;
+
        int i;
        int val;
        int sum = 0;
-       int stat = p_ptr->stat_cur[use_stat];
+       int stat = p_ptr->stat_cur[pd_ptr->stat];
 
        /* No chance for success */
        if ((p_ptr->lev < min_level) || p_ptr->confused)
@@ -700,53 +727,61 @@ static int racial_chance(s16b min_level, int use_stat, int difficulty)
 }
 
 
-/* Note: return value indicates that we have succesfully used the power */
+static int  racial_cost;
 
-bool racial_aux(s16b min_level, int cost, int use_stat, int difficulty)
+/*
+ * Note: return value indicates that we have succesfully used the power
+ * 1: Succeeded, 0: Cancelled, -1: Failed
+ */
+static int racial_aux(power_desc_type *pd_ptr)
 {
-       bool use_hp = FALSE;
+       s16b 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;
 
        /* Not enough mana - use hp */
-       if (p_ptr->csp < cost) use_hp = TRUE;
+       if (p_ptr->csp < racial_cost) use_hp = racial_cost - p_ptr->csp;
 
        /* Power is not available yet */
        if (p_ptr->lev < min_level)
        {
 #ifdef JP
-msg_format("¤³¤ÎǽÎϤò»ÈÍѤ¹¤ë¤Ë¤Ï¥ì¥Ù¥ë %d ¤Ë㤷¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£", min_level);
+               msg_format("¤³¤ÎǽÎϤò»ÈÍѤ¹¤ë¤Ë¤Ï¥ì¥Ù¥ë %d ¤Ë㤷¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£", min_level);
 #else
                msg_format("You need to attain level %d to use this power.", min_level);
 #endif
 
                energy_use = 0;
-               return FALSE;
+               return 0;
        }
 
        /* Too confused */
        else if (p_ptr->confused)
        {
 #ifdef JP
-msg_print("º®Í𤷤Ƥ¤¤Æ¤½¤ÎǽÎϤϻȤ¨¤Ê¤¤¡£");
+               msg_print("º®Í𤷤Ƥ¤¤Æ¤½¤ÎǽÎϤϻȤ¨¤Ê¤¤¡£");
 #else
                msg_print("You are too confused to use this power.");
 #endif
 
                energy_use = 0;
-               return FALSE;
+               return 0;
        }
 
        /* Risk death? */
-       else if (use_hp && (p_ptr->chp < cost))
+       else if (p_ptr->chp < use_hp)
        {
 #ifdef JP
-if (!get_check("ËÜÅö¤Ëº£¤Î¿ê¼å¤·¤¿¾õÂ֤Ǥ³¤ÎǽÎϤò»È¤¤¤Þ¤¹¤«¡©"))
+               if (!get_check("ËÜÅö¤Ëº£¤Î¿ê¼å¤·¤¿¾õÂ֤Ǥ³¤ÎǽÎϤò»È¤¤¤Þ¤¹¤«¡©"))
 #else
                if (!get_check("Really use the power in your weakened state? "))
 #endif
-
                {
                        energy_use = 0;
-                       return FALSE;
+                       return 0;
                }
        }
 
@@ -771,47 +806,21 @@ if (!get_check("
        /* take time and pay the price */
        energy_use = 100;
 
-       if (cost)
-       {
-               if (use_hp)
-               {
-#ifdef JP
-                       take_hit(DAMAGE_USELIFE, (cost / 2) + randint1(cost / 2),
-                                "²áÅ٤ν¸Ãæ", -1);
-#else
-                       take_hit(DAMAGE_USELIFE, (cost / 2) + randint1(cost / 2),
-                                "concentrating too hard", -1);
-#endif
-
-               }
-               else
-               {
-                       p_ptr->csp -= (cost / 2) + randint1(cost / 2);
-               }
-       }
-
-
-       /* Redraw mana and hp */
-       p_ptr->redraw |= (PR_HP | PR_MANA);
-
-       /* Window stuff */
-       p_ptr->window |= (PW_PLAYER | PW_SPELL);
-
        /* Success? */
        if (randint1(p_ptr->stat_cur[use_stat]) >=
            ((difficulty / 2) + randint1(difficulty / 2)))
        {
-               return TRUE;
+               return 1;
        }
 
 #ifdef JP
-msg_print("½¼Ê¬¤Ë½¸Ãæ¤Ç¤­¤Ê¤«¤Ã¤¿¡£");
+       msg_print("½¼Ê¬¤Ë½¸Ãæ¤Ç¤­¤Ê¤«¤Ã¤¿¡£");
 #else
        msg_print("You've failed to concentrate hard enough.");
 #endif
        if (flush_failure) flush();
 
-       return FALSE;
+       return -1;
 }
 
 
@@ -826,33 +835,26 @@ static bool cmd_racial_power_aux(s32b command)
                {
                case CLASS_WARRIOR:
                {
-                       if (racial_aux(40, 75, A_DEX, 35))
+                       int y = 0, x = 0, i;
+                       cave_type       *c_ptr;
+
+                       for (i = 0; i < 6; i++)
                        {
-                               int y = 0, x = 0, i;
-                               cave_type       *c_ptr;
-                               monster_type    *m_ptr;
+                               dir = randint0(8);
+                               y = py + ddy_ddd[dir];
+                               x = px + ddx_ddd[dir];
+                               c_ptr = &cave[y][x];
 
-                               for (i = 0; i < 6; i++)
+                               /* Hack -- attack monsters */
+                               if (c_ptr->m_idx)
+                                       py_attack(y, x, 0);
+                               else
                                {
-                                       dir = randint0(8);
-                                       y = py + ddy_ddd[dir];
-                                       x = px + ddx_ddd[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)
-                                               py_attack(y, x, 0);
-                                       else
-                                       {
 #ifdef JP
-msg_print("¹¶·â¤¬¶õ¤ò¤­¤Ã¤¿¡£");
+                                       msg_print("¹¶·â¤¬¶õ¤ò¤­¤Ã¤¿¡£");
 #else
-                                               msg_print("You attack the empty air.");
+                                       msg_print("You attack the empty air.");
 #endif
-                                       }
                                }
                        }
                        break;
@@ -861,96 +863,75 @@ msg_print("
                case CLASS_HIGH_MAGE:
                case CLASS_SORCERER:
                {
-                       if (racial_aux(25, 1, A_INT, 25))
-                       {
-                               if (!eat_magic(p_ptr->lev * 2)) return FALSE;
-                       }
+                       if (!eat_magic(p_ptr->lev * 2)) return FALSE;
                        break;
                }
                case CLASS_PRIEST:
                {
-                       if (p_ptr->realm1 == REALM_LIFE)
+                       if (is_good_realm(p_ptr->realm1))
                        {
-                               if (racial_aux(35, 70, A_WIS, 50))
-                               {
-                                       if (!bless_weapon()) return FALSE;
-                               }
+                               if (!bless_weapon()) return FALSE;
                        }
                        else
                        {
-                               if (racial_aux(42, 40, A_WIS, 30))
-                               {
-                                       (void)dispel_monsters(plev * 4);
-                                       turn_monsters(plev * 4);
-                                       banish_monsters(plev * 4);
-                               }
+                               (void)dispel_monsters(plev * 4);
+                               turn_monsters(plev * 4);
+                               banish_monsters(plev * 4);
                        }
                        break;
                }
                case CLASS_ROGUE:
                {
-                       if (racial_aux(8, 12, A_DEX, 14))
-                       {
-                               int x, y;
+                       int x, y;
 
-                               if (!get_rep_dir(&dir, FALSE)) return FALSE;
-                               y = py + ddy[dir];
-                               x = px + ddx[dir];
-                               if (cave[y][x].m_idx)
-                               {
-                                       py_attack(y, x, 0);
-                                       if (randint0(p_ptr->skill_dis) < 7)
+                       if (!get_rep_dir(&dir, FALSE)) return FALSE;
+                       y = py + ddy[dir];
+                       x = px + ddx[dir];
+                       if (cave[y][x].m_idx)
+                       {
+                               py_attack(y, x, 0);
+                               if (randint0(p_ptr->skill_dis) < 7)
 #ifdef JP
-msg_print("¤¦¤Þ¤¯Æ¨¤²¤é¤ì¤Ê¤«¤Ã¤¿¡£");
+                                       msg_print("¤¦¤Þ¤¯Æ¨¤²¤é¤ì¤Ê¤«¤Ã¤¿¡£");
 #else
-                                               msg_print("You are failed to run away.");
+                                       msg_print("You are failed to run away.");
 #endif
-                                       else teleport_player(30);
-                               }
-                               else
-                               {
+                               else teleport_player(30);
+                       }
+                       else
+                       {
 #ifdef JP
-msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
+                               msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
 #else
-                                       msg_print("You don't see any monster in this direction");
+                               msg_print("You don't see any monster in this direction");
 #endif
 
-                                       msg_print(NULL);
-                               }
+                               msg_print(NULL);
                        }
                        break;
                }
                case CLASS_RANGER:
                {
-                       if (racial_aux(15, 20, A_INT, 12))
-                       {
 #ifdef JP
-msg_print("Ũ¤òÄ´ºº¤·¤¿...");
+                       msg_print("Ũ¤òÄ´ºº¤·¤¿...");
 #else
-                               msg_print("You examine your foes...");
+                       msg_print("You examine your foes...");
 #endif
 
-                               probing();
-                       }
+                       probing();
                        break;
                }
                case CLASS_PALADIN:
                {
-                       if (p_ptr->realm1 == REALM_LIFE)
+                       if (is_good_realm(p_ptr->realm1))
                        {
-                               if (racial_aux(30, 30, A_WIS, 20))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
-                                       fire_beam(GF_HOLY_FIRE, dir, plev * 3);
-                               }
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               fire_beam(GF_HOLY_FIRE, dir, plev * 3);
                        }
                        else
                        {
-                               if (racial_aux(30, 30, A_WIS, 20))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
-                                       fire_beam(GF_HELL_FIRE, dir, plev * 3);
-                               }
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               fire_beam(GF_HELL_FIRE, dir, plev * 3);
                        }
                        break;
                }
@@ -958,137 +939,114 @@ msg_print("Ũ
                {
                        if (command == -3)
                        {
-                               if (racial_aux(25, 0, A_INT, 10))
-                               {
-                                       if (take_hit(DAMAGE_USELIFE, p_ptr->lev, 
 #ifdef JP
-"£È£Ð¤«¤é£Í£Ð¤Ø¤Î̵ËŤÊÊÑ´¹", -1))
+                               int gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, "£È£Ð¤«¤é£Í£Ð¤Ø¤Î̵ËŤÊÊÑ´¹", -1) / 5;
 #else
-"thoughtless convertion from HP to SP", -1))
+                               int gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, "thoughtless convertion from HP to SP", -1) / 5;
 #endif
+                               if (gain_sp)
+                               {
+                                       p_ptr->csp += gain_sp;
+                                       if (p_ptr->csp > p_ptr->msp)
                                        {
-                                               p_ptr->csp += p_ptr->lev / 5;
-                                               if (p_ptr->csp > p_ptr->msp)
-                                               {
-                                                       p_ptr->csp = p_ptr->msp;
-                                                       p_ptr->csp_frac = 0;
-                                               }
+                                               p_ptr->csp = p_ptr->msp;
+                                               p_ptr->csp_frac = 0;
                                        }
-                                       else
+                               }
+                               else
 #ifdef JP
-msg_print("ÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¡£");
+                                       msg_print("ÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¡£");
 #else
-                               msg_print("You failed to convert.");
+                                       msg_print("You failed to convert.");
 #endif
-                               }
                        }
                        else if (command == -4)
                        {
-                               if (racial_aux(25, 0, A_INT, 10))
+                               if (p_ptr->csp >= p_ptr->lev / 5)
                                {
-                                       if (p_ptr->csp >= p_ptr->lev/5)
-                                       {
-                                               p_ptr->csp -= p_ptr->lev / 5;
-                                               hp_player(p_ptr->lev);
-                                       }
-                                       else
+                                       p_ptr->csp -= p_ptr->lev / 5;
+                                       hp_player(p_ptr->lev);
+                               }
+                               else
 #ifdef JP
-msg_print("ÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¡£");
+                                       msg_print("ÊÑ´¹¤Ë¼ºÇÔ¤·¤¿¡£");
 #else
-                               msg_print("You failed to convert.");
+                                       msg_print("You failed to convert.");
 #endif
-                               }
                        }
+
+                       /* Redraw mana and hp */
+                       p_ptr->redraw |= (PR_HP | PR_MANA);
+
                        break;
                }
                case CLASS_CHAOS_WARRIOR:
                {
-                       if (racial_aux(40, 50, A_INT, 25))
-                       {
 #ifdef JP
-msg_print("ÊÕ¤ê¤òâˤó¤À...");
+                       msg_print("ÊÕ¤ê¤òâˤó¤À...");
 #else
-                               msg_print("You glare nearby monsters...");
+                       msg_print("You glare nearby monsters...");
 #endif
-                               slow_monsters();
-                               stun_monsters(p_ptr->lev * 4);
-                               confuse_monsters(p_ptr->lev * 4);
-                               turn_monsters(p_ptr->lev * 4);
-                               stasis_monsters(p_ptr->lev * 4);
-                       }
+                       slow_monsters();
+                       stun_monsters(p_ptr->lev * 4);
+                       confuse_monsters(p_ptr->lev * 4);
+                       turn_monsters(p_ptr->lev * 4);
+                       stasis_monsters(p_ptr->lev * 4);
                        break;
                }
                case CLASS_MONK:
                {
-                       if (command == -3)
+                       if (empty_hands(TRUE) < 2)
                        {
-                               if (empty_hands(TRUE) < 2)
-                               {
 #ifdef JP
-msg_print("ÁǼꤸ¤ã¤Ê¤¤¤È¤Ç¤­¤Þ¤»¤ó¡£");
+                               msg_print("ÁǼꤸ¤ã¤Ê¤¤¤È¤Ç¤­¤Þ¤»¤ó¡£");
 #else
-                                       msg_print("You need to be bare hands.");
+                               msg_print("You need to be bare hand.");
 #endif
-                                       return FALSE;
-                               }
-                               if (racial_aux(25, 0, A_DEX, 0))
-                               {
-                                       if (choose_kamae()) energy_use = 100;
-                                       else energy_use = 0;
-                                       p_ptr->update |= (PU_BONUS);
-                                       p_ptr->redraw |= (PR_ARMOR);
-                               }
+                               return FALSE;
                        }
-                       if (command == -4)
+
+                       if (command == -3)
+                       {
+                               if (choose_kamae()) energy_use = 100;
+                               else energy_use = 0;
+                               p_ptr->update |= (PU_BONUS);
+                               p_ptr->redraw |= (PR_ARMOR);
+                       }
+                       else if (command == -4)
                        {
-                               if (empty_hands(TRUE) < 2)
+                               int x, y;
+
+                               if (!get_rep_dir(&dir, FALSE)) return FALSE;
+                               y = py + ddy[dir];
+                               x = px + ddx[dir];
+                               if (cave[y][x].m_idx)
                                {
 #ifdef JP
-msg_print("ÁǼꤸ¤ã¤Ê¤¤¤È¤Ç¤­¤Þ¤»¤ó¡£");
+                                       if (one_in_(2)) msg_print("¤¢¡¼¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¡ª¡ª¡ª");
+                                       else msg_print("¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¡ª¡ª¡ª");
 #else
-                                       msg_print("You need to be bare hand.");
+                                       if (one_in_(2)) msg_print("Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!");
+                                       else msg_print("Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!");
 #endif
-                                       return FALSE;
-                               }
-                               if (racial_aux(30, 30, A_STR, 20))
-                               {
-                                       int x, y;
 
-                                       if (!get_rep_dir(&dir, FALSE)) return FALSE;
-                                       y = py + ddy[dir];
-                                       x = px + ddx[dir];
+                                       py_attack(y, x, 0);
                                        if (cave[y][x].m_idx)
                                        {
-                                               if (one_in_(2))
-#ifdef JP
-msg_print("¤¢¡¼¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¤¿¡ª¡ª¡ª");
-#else
-msg_print("Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!");
-#endif
-                                               else
-#ifdef JP
-msg_print("¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¥ª¥é¡ª¡ª¡ª");
-#else
-msg_print("Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!");
-#endif
+                                               handle_stuff();
                                                py_attack(y, x, 0);
-                                               if (cave[y][x].m_idx)
-                                               {
-                                                       handle_stuff();
-                                                       py_attack(y, x, 0);
-                                               }
-                                               p_ptr->energy -= 100;
                                        }
-                                       else
-                                       {
+                                       p_ptr->energy_need += ENERGY_NEED();
+                               }
+                               else
+                               {
 #ifdef JP
-msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
+                                       msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¥â¥ó¥¹¥¿¡¼¤Ï¤¤¤Þ¤»¤ó¡£");
 #else
-                                               msg_print("You don't see any monster in this direction");
+                                       msg_print("You don't see any monster in this direction");
 #endif
 
-                                               msg_print(NULL);
-                                       }
+                                       msg_print(NULL);
                                }
                        }
                        break;
@@ -1099,274 +1057,229 @@ msg_print("
                        if (total_friends)
                        {
 #ifdef JP
-msg_print("º£¤Ï¥Ú¥Ã¥È¤òÁà¤ë¤³¤È¤Ë½¸Ã椷¤Æ¤¤¤Ê¤¤¤È¡£");
+                               msg_print("º£¤Ï¥Ú¥Ã¥È¤òÁà¤ë¤³¤È¤Ë½¸Ã椷¤Æ¤¤¤Ê¤¤¤È¡£");
 #else
                                msg_print("You need concentration on the pets now.");
 #endif
                                return FALSE;
                        }
-                       if (racial_aux(15, 0, A_WIS, 10))
-                       {
 #ifdef JP
-msg_print("¾¯¤·Æ¬¤¬¥Ï¥Ã¥­¥ê¤·¤¿¡£");
+                       msg_print("¾¯¤·Æ¬¤¬¥Ï¥Ã¥­¥ê¤·¤¿¡£");
 #else
-                               msg_print("You feel your head clear a little.");
+                       msg_print("You feel your head clear a little.");
 #endif
 
-                               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;
-                               }
+                       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;
                }
                case CLASS_TOURIST:
                {
                        if (command == -3)
                        {
-                               if (racial_aux(1, 0, A_DEX, 0))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
-                                       project_length = 1;
-                                       fire_beam(GF_PHOTO, dir, 1);
-                               }
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               project_length = 1;
+                               fire_beam(GF_PHOTO, dir, 1);
                        }
                        else if (command == -4)
                        {
-                               if (racial_aux(25, 20, A_INT, 20))
-                               {
-                                       if (!identify_fully(FALSE)) return FALSE;
-                               }
+                               if (!identify_fully(FALSE)) return FALSE;
                        }
                        break;
                }
                case CLASS_IMITATOR:
                {
-                       if (racial_aux(30, 100, A_DEX, 30))
-                       {
-                               handle_stuff();
-                               if (!do_cmd_mane(TRUE)) return FALSE;
-                       }
+                       handle_stuff();
+                       if (!do_cmd_mane(TRUE)) return FALSE;
                        break;
                }
                case CLASS_BEASTMASTER:
                {
                        if (command == -3)
                        {
-                               if (racial_aux(1, (p_ptr->lev+3) / 4, A_CHR, 10))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
-                                       (void)fire_ball_hide(GF_CONTROL_LIVING, dir, p_ptr->lev, 0);
-                               }
+                               if (!get_aim_dir(&dir)) return FALSE;
+                               (void)fire_ball_hide(GF_CONTROL_LIVING, dir, p_ptr->lev, 0);
                                break;
                        }
                        else if (command == -4)
                        {
-                               if (racial_aux(30, (p_ptr->lev+20) / 2, A_CHR, 10))
-                               {
-                                       project_hack(GF_CONTROL_LIVING, p_ptr->lev);
-                               }
+                               project_hack(GF_CONTROL_LIVING, p_ptr->lev);
                                break;
                        }
                }
                case CLASS_ARCHER:
                {
-                       if (racial_aux(1, 0, A_DEX, 0))
-                       {
-                               if (!do_cmd_archer()) return FALSE;
-                       }
+                       if (!do_cmd_archer()) return FALSE;
                        break;
                }
                case CLASS_MAGIC_EATER:
                {
-                       if (racial_aux(1, 0, A_INT, 0))
-                       {
-                               if (!gain_magic()) return FALSE;
-                       }
+                       if (!gain_magic()) return FALSE;
                        break;
                }
                case CLASS_BARD:
                {
-                       if (racial_aux(1, 0, A_CHR, 0))
-                       {
-                               stop_singing();
-                               energy_use = 10;
-                               return FALSE;
-                       }
-                       break;
+                       stop_singing();
+                       energy_use = 10;
+                       return FALSE;
                }
                case CLASS_RED_MAGE:
                {
-                       if (racial_aux(48, 20, A_INT, 0))
-                       {
-                               handle_stuff();
+                       handle_stuff();
+                       do_cmd_cast();
+                       handle_stuff();
+                       if (!p_ptr->paralyzed)
                                do_cmd_cast();
-                               handle_stuff();
-                               if (!p_ptr->paralyzed)
-                                       do_cmd_cast();
-                       }
                        break;
                }
                case CLASS_SAMURAI:
                {
-                       if (total_friends)
+                       if (command == -3)
                        {
+                               int max_csp = MAX(p_ptr->msp*4, p_ptr->lev*5+5);
+
+                               if (total_friends)
+                               {
 #ifdef JP
-msg_print("º£¤Ï¥Ú¥Ã¥È¤òÁà¤ë¤³¤È¤Ë½¸Ã椷¤Æ¤¤¤Ê¤¤¤È¡£");
+                                       msg_print("º£¤Ï¥Ú¥Ã¥È¤òÁà¤ë¤³¤È¤Ë½¸Ã椷¤Æ¤¤¤Ê¤¤¤È¡£");
 #else
-msg_print("You need concentration on the pets now.");
+                                       msg_print("You need concentration on the pets now.");
 #endif
-                               return FALSE;
-                       }
-                       if (command == -3)
-                       {
+                                       return FALSE;
+                               }
                                if (p_ptr->special_defense & KATA_MASK)
                                {
 #ifdef JP
-msg_print("º£¤Ï¹½¤¨¤Ë½¸Ã椷¤Æ¤¤¤ë¡£");
+                                       msg_print("º£¤Ï¹½¤¨¤Ë½¸Ã椷¤Æ¤¤¤ë¡£");
 #else
                                        msg_print("You need concentration on your form.");
 #endif
                                        return FALSE;
                                }
-                               if (racial_aux(1, 0, A_WIS, 0))
-                               {
-                                       int max_csp = MAX(p_ptr->msp*4, p_ptr->lev*5+5);
 #ifdef JP
-msg_print("Àº¿À¤ò½¸Ã椷¤Æµ¤¹ç¤¤¤òί¤á¤¿¡£");
+                               msg_print("Àº¿À¤ò½¸Ã椷¤Æµ¤¹ç¤¤¤òί¤á¤¿¡£");
 #else
-                                       msg_print("You concentrate to charge your power.");
+                               msg_print("You concentrate to charge your power.");
 #endif
 
-                                       p_ptr->csp += p_ptr->msp / 2;
-                                       if (p_ptr->csp >= max_csp)
-                                       {
-                                               p_ptr->csp = max_csp;
-                                               p_ptr->csp_frac = 0;
-                                       }
+                               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);
                        }
-                       if (command == -4)
+                       else if (command == -4)
                        {
                                if (!buki_motteruka(INVEN_RARM))
                                {
 #ifdef JP
-msg_print("Éð´ï¤ò»ý¤¿¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£");
+                                       msg_print("Éð´ï¤ò»ý¤¿¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£");
 #else
                                        msg_print("You need to wield a weapon.");
 #endif
                                        return FALSE;
                                }
-                               if (racial_aux(25, 0, A_DEX, 0))
-                               {
-                                       if (choose_kata()) energy_use = 100;
-                                       else energy_use = 0;
-                                       p_ptr->update |= (PU_BONUS);
-                                       p_ptr->redraw |= (PR_ARMOR);
-                               }
+                               if (choose_kata()) energy_use = 100;
+                               else energy_use = 0;
+                               p_ptr->update |= (PU_BONUS);
+                               p_ptr->redraw |= (PR_ARMOR);
                        }
                        break;
                }
                case CLASS_BLUE_MAGE:
                {
-                       if (racial_aux(1, 0, A_INT, 0))
+                       if (p_ptr->action == ACTION_LEARN)
                        {
-                               if (p_ptr->action == ACTION_LEARN)
-                               {
-                                       set_action(ACTION_NONE);
-                               }
-                               else
-                               {
-                                       set_action(ACTION_LEARN);
-                               }
-                               energy_use = 0;
+                               set_action(ACTION_NONE);
                        }
+                       else
+                       {
+                               set_action(ACTION_LEARN);
+                       }
+                       energy_use = 0;
                        break;
                }
                case CLASS_CAVALRY:
                {
-                       if (racial_aux(10, 0, A_STR, 10))
-                       {
-                               char m_name[80];
-                               monster_type *m_ptr;
-                               monster_race *r_ptr;
-                               int rlev;
+                       char m_name[80];
+                       monster_type *m_ptr;
+                       monster_race *r_ptr;
+                       int rlev;
 
-                               if (p_ptr->riding)
-                               {
+                       if (p_ptr->riding)
+                       {
 #ifdef JP
-                                       msg_print("º£¤Ï¾èÇÏÃæ¤À¡£");
+                               msg_print("º£¤Ï¾èÇÏÃæ¤À¡£");
 #else
-                                       msg_print("You ARE riding.");
+                               msg_print("You ARE riding.");
 #endif
-                                       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);
+                               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);
 #ifdef JP
-                               msg_format("%s¤Ë¾è¤Ã¤¿¡£",m_name);
+                       msg_format("%s¤Ë¾è¤Ã¤¿¡£",m_name);
 #else
-                               msg_format("You ride on %s.",m_name);
+                       msg_format("You ride on %s.",m_name);
 #endif
-                               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(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)))
-                               {
+                       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)))
+                       {
 #ifdef JP
-                                       msg_format("%s¤ò¼ê¤Ê¤º¤±¤¿¡£",m_name);
+                               msg_format("%s¤ò¼ê¤Ê¤º¤±¤¿¡£",m_name);
 #else
-                                       msg_format("You tame %s.",m_name);
+                               msg_format("You tame %s.",m_name);
 #endif
-                                       set_pet(m_ptr);
-                               }
-                               else
-                               {
+                               set_pet(m_ptr);
+                       }
+                       else
+                       {
 #ifdef JP
-                                       msg_format("%s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª",m_name);
+                               msg_format("%s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª",m_name);
 #else
-                                       msg_format("You have thrown off by %s.",m_name);
+                               msg_format("You have thrown off by %s.",m_name);
 #endif
-                                       rakuba(1,TRUE);
-                               }
+                               rakuba(1,TRUE);
+
+                               /* Paranoia */
+                               /* ÍîÇϽèÍý¤Ë¼ºÇÔ¤·¤Æ¤â¤È¤Ë¤«¤¯¾èÇϲò½ü */
+                               p_ptr->riding = 0;
                        }
                        break;
                }
                case CLASS_BERSERKER:
                {
-                       if (command == -3)
-                       {
-                               if (racial_aux(5, 5, A_DEX, 10))
-                               {
-                                       (void)set_food(PY_FOOD_MAX - 1);
-                               }
-                       }
-                       else if (command == -4)
-                       {
-                               if (racial_aux(10, 10, A_DEX, 20))
-                               {
-                                       if (!word_of_recall()) return FALSE;
-                               }
-                       }
+                       if (!word_of_recall()) return FALSE;
                        break;
                }
                case CLASS_SMITH:
                {
-                       if (racial_aux(5, 15, A_INT, 20))
+                       if (p_ptr->lev > 29)
                        {
-                               if (p_ptr->lev > 29)
-                               {
-                                       if (!identify_fully(TRUE)) return FALSE;
-                               }
-                               else
-                               {
-                                       if (!ident_spell(TRUE)) return FALSE;
-                               }
+                               if (!identify_fully(TRUE)) return FALSE;
+                       }
+                       else
+                       {
+                               if (!ident_spell(TRUE)) return FALSE;
                        }
                        break;
                }
@@ -1374,68 +1287,65 @@ msg_print("
                {
                        if (command == -3)
                        {
-                         if (racial_aux(1, 0, A_INT, 0)){
-                           int x,y;
-                             for( x=0 ; x < cur_wid ;x++){
-                               for( y=0 ; y < cur_hgt ;y++){
-                                 if( cave[y][x].feat == FEAT_MIRROR){
-                                   cave_set_feat( y , x , FEAT_FLOOR );
-                                   project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF|PROJECT_NO_HANGEKI),-1);
-                                 }
+                               int x, y;
+                               for (x = 0; x < cur_wid; x++)
+                               {
+                                       for (y = 0; y < cur_hgt; y++)
+                                       {
+                                               if (is_mirror_grid(&cave[y][x]))
+                                               {
+                                                       remove_mirror(y, x);
+                                                       project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
+                                                               (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
+                                               }
+                                       }
                                }
-                             }
-                         }
                        }
                        else if (command == -4)
                        {
-                         if (total_friends)
-                         {
+                               if (total_friends)
+                               {
 #ifdef JP
-msg_print("º£¤Ï¥Ú¥Ã¥È¤òÁà¤ë¤³¤È¤Ë½¸Ã椷¤Æ¤¤¤Ê¤¤¤È¡£");
+                                       msg_print("º£¤Ï¥Ú¥Ã¥È¤òÁà¤ë¤³¤È¤Ë½¸Ã椷¤Æ¤¤¤Ê¤¤¤È¡£");
 #else
-                               msg_print("You need concentration on the pets now.");
+                                       msg_print("You need concentration on the pets now.");
 #endif
-                                 return FALSE;
-                         }
-                         if (racial_aux(30, 0, A_INT, 20)){
-                               if( cave[py][px].feat == FEAT_MIRROR)
+                                       return FALSE;
+                               }
+                               if (is_mirror_grid(&cave[py][px]))
                                {
 #ifdef JP
-msg_print("¾¯¤·Æ¬¤¬¥Ï¥Ã¥­¥ê¤·¤¿¡£");
+                                       msg_print("¾¯¤·Æ¬¤¬¥Ï¥Ã¥­¥ê¤·¤¿¡£");
 #else
                                        msg_print("You feel your head clear a little.");
 #endif
 
-                                       p_ptr->csp += ( 5 + (p_ptr->lev)*(p_ptr->lev)/100);
+                                       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 {
+                               else
+                               {
 #ifdef JP
-msg_print("¶À¤Î¾å¤Ç¤Ê¤¤¤È½¸Ãæ¤Ç¤­¤Ê¤¤¡ª");
+                                       msg_print("¶À¤Î¾å¤Ç¤Ê¤¤¤È½¸Ãæ¤Ç¤­¤Ê¤¤¡ª");
 #else
                                        msg_print("Here are not any mirrors!");
 #endif
-
                                }
-                         }
                        }
                        break;
                }
                case CLASS_NINJA:
                {
-                       if (command == -3)
-                       {
-                               if (racial_aux(20, 0, A_DEX, 0))
-                               {
-                                       if (p_ptr->action == ACTION_HAYAGAKE) set_action(ACTION_NONE);
-                                       else set_action(ACTION_HAYAGAKE);
-                                       energy_use = 0;
-                               }
-                       }
+                       if (p_ptr->action == ACTION_HAYAGAKE) set_action(ACTION_NONE);
+                       else set_action(ACTION_HAYAGAKE);
+                       energy_use = 0;
                        break;
                }
                }
@@ -1446,28 +1356,35 @@ msg_print("
                {
                case MIMIC_DEMON:
                case MIMIC_DEMON_LORD:
-                       if (racial_aux(15, 10+p_ptr->lev/3, A_CON, 20))
-                       {
-                               int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
-                               if (!get_aim_dir(&dir)) break;
+               {
+                       int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
+                       msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
 #else
-                               msg_format("You breathe %s.",((type == GF_NETHER) ? "nether" : "fire"));
+                       msg_format("You breathe %s.",((type == GF_NETHER) ? "nether" : "fire"));
 #endif
 
-                               fire_ball(type, dir, plev * 3,
-                                   -(plev / 15) - 1);
-                       }
+                       fire_ball(type, dir, plev * 3, -(plev / 15) - 1);
                        break;
+               }
                case MIMIC_VAMPIRE:
-                       if (racial_aux(2, (1 + (plev / 3)), A_CON, 9))
+                       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+                       {
+#ifdef JP
+                               msg_print("¤Ê¤¼¤«¹¶·â¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£");
+#else
+                               msg_print("Something prevent you from attacking.");
+#endif
+                               return FALSE;
+                       }
+                       else
                        {
                                int y, x, dummy = 0;
                                cave_type *c_ptr;
 
                                /* Only works on adjacent monsters */
-                               if (!get_rep_dir(&dir,FALSE)) break;   /* was get_aim_dir */
+                               if (!get_rep_dir(&dir, FALSE)) return FALSE;   /* was get_aim_dir */
                                y = py + ddy[dir];
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
@@ -1475,7 +1392,7 @@ msg_format("
                                if (!c_ptr->m_idx)
                                {
 #ifdef JP
-msg_print("²¿¤â¤Ê¤¤¾ì½ê¤Ë³ú¤ß¤Ä¤¤¤¿¡ª");
+                                       msg_print("²¿¤â¤Ê¤¤¾ì½ê¤Ë³ú¤ß¤Ä¤¤¤¿¡ª");
 #else
                                        msg_print("You bite into thin air!");
 #endif
@@ -1484,7 +1401,7 @@ msg_print("
                                }
 
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¥Ë¥ä¥ê¤È¤·¤Æ²ç¤ò¤à¤¤¤¿...");
+                               msg_print("¤¢¤Ê¤¿¤Ï¥Ë¥ä¥ê¤È¤·¤Æ²ç¤ò¤à¤¤¤¿...");
 #else
                                msg_print("You grin and bare your fangs...");
 #endif
@@ -1497,22 +1414,22 @@ msg_print("
                                                (void)hp_player(dummy);
                                        else
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¶õÊ¢¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+                                               msg_print("¤¢¤Ê¤¿¤Ï¶õÊ¢¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
 #else
                                                msg_print("You were not hungry.");
 #endif
 
-                                               /* 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);
+                                       /* 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
 #ifdef JP
-msg_print("¤²¤§¡£¤Ò¤É¤¤Ì£¤À¡£");
+                                       msg_print("¤²¤§¡£¤Ò¤É¤¤Ì£¤À¡£");
 #else
                                        msg_print("Yechh. That tastes foul.");
 #endif
@@ -1520,7 +1437,6 @@ msg_print("
                        }
                        break;
                }
-
        }
 
        else 
@@ -1529,22 +1445,18 @@ msg_print("
        switch (p_ptr->prace)
        {
                case RACE_DWARF:
-                       if (racial_aux(5, 5, A_WIS, 12))
-                       {
 #ifdef JP
-msg_print("¼þ°Ï¤òÄ´¤Ù¤¿¡£");
+                       msg_print("¼þ°Ï¤òÄ´¤Ù¤¿¡£");
 #else
-                               msg_print("You examine your surroundings.");
+                       msg_print("You examine your surroundings.");
 #endif
 
-                               (void)detect_traps(DETECT_RAD_DEFAULT);
-                               (void)detect_doors(DETECT_RAD_DEFAULT);
-                               (void)detect_stairs(DETECT_RAD_DEFAULT);
-                       }
+                       (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
+                       (void)detect_doors(DETECT_RAD_DEFAULT);
+                       (void)detect_stairs(DETECT_RAD_DEFAULT);
                        break;
 
                case RACE_HOBBIT:
-                       if (racial_aux(15, 10, A_INT, 10))
                        {
                                object_type *q_ptr;
                                object_type forge;
@@ -1553,12 +1465,12 @@ msg_print("
                                q_ptr = &forge;
 
                                /* Create the food ration */
-                               object_prep(q_ptr, 21);
+                               object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
 
                                /* Drop the object from heaven */
                                (void)drop_near(q_ptr, -1, py, px);
 #ifdef JP
-msg_print("¿©»ö¤òÎÁÍý¤·¤Æºî¤Ã¤¿¡£");
+                               msg_print("¿©»ö¤òÎÁÍý¤·¤Æºî¤Ã¤¿¡£");
 #else
                                msg_print("You cook some food.");
 #endif
@@ -1567,263 +1479,193 @@ msg_print("
                        break;
 
                case RACE_GNOME:
-                       if (racial_aux(5, 5, A_INT, 12))
-                       {
 #ifdef JP
-msg_print("¥Ñ¥Ã¡ª");
+                       msg_print("¥Ñ¥Ã¡ª");
 #else
-                               msg_print("Blink!");
+                       msg_print("Blink!");
 #endif
 
-                               teleport_player(10);
-                       }
+                       teleport_player(10);
                        break;
 
                case RACE_HALF_ORC:
-                       if (racial_aux(3, 5, A_WIS,
-                           ((p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_BERSERKER) ? 5 : 10)))
-                       {
 #ifdef JP
-msg_print("ͦµ¤¤ò½Ð¤·¤¿¡£");
+                       msg_print("ͦµ¤¤ò½Ð¤·¤¿¡£");
 #else
-                               msg_print("You play tough.");
+                       msg_print("You play tough.");
 #endif
 
-                               (void)set_afraid(0);
-                       }
+                       (void)set_afraid(0);
                        break;
 
                case RACE_HALF_TROLL:
-                       if (racial_aux(10, 12, A_STR,
-                           ((p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_BERSERKER) ? 6 : 12)))
-                       {
 #ifdef JP
-msg_print("¤¦¤¬¤¡¤¡¡ª");
+                       msg_print("¤¦¤¬¤¡¤¡¡ª");
 #else
-                               msg_print("RAAAGH!");
+                       msg_print("RAAAGH!");
 #endif
 
-                               (void)set_afraid(0);
-
-                               (void)set_shero(10 + randint1(plev), FALSE);
-                               (void)hp_player(30);
-                       }
+                       (void)set_afraid(0);
+                       (void)set_shero(10 + randint1(plev), FALSE);
+                       (void)hp_player(30);
                        break;
 
                case RACE_AMBERITE:
-                       if (command == -2)
+                       if (command == -1)
                        {
-                               if (racial_aux(40, 75, A_WIS, 50))
-                               {
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¡Ö¥Ñ¥¿¡¼¥ó¡×¤ò¿´¤ËÉÁ¤¤¤Æ¤½¤Î¾å¤òÊ⤤¤¿...");
+                               msg_print("¤¢¤Ê¤¿¤ÏÊ⤭¼þ¤ê»Ï¤á¤¿¡£");
 #else
-                                       msg_print("You picture the Pattern in your mind and walk it...");
+                               msg_print("You start walking around. ");
 #endif
-
-                                       (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)restore_level();
-                               }
+                               alter_reality();
                        }
-
-                       else if (command == -1)
+                       else if (command == -2)
                        {
-                               if (racial_aux(30, 50, A_INT, 50))
-                               {
-                                       /* No effect in arena or quest */
-                                       if (p_ptr->inside_arena || p_ptr->inside_quest)
-                                       {
 #ifdef JP
-msg_print("¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£");
+                               msg_print("¤¢¤Ê¤¿¤Ï¡Ö¥Ñ¥¿¡¼¥ó¡×¤ò¿´¤ËÉÁ¤¤¤Æ¤½¤Î¾å¤òÊ⤤¤¿...");
 #else
-                                               msg_print("There is no effect.");
+                               msg_print("You picture the Pattern in your mind and walk it...");
 #endif
 
-                                       }
-                                       else
-                                       {
-#ifdef JP
-msg_print("¤¢¤Ê¤¿¤ÏÊ⤭¼þ¤ê»Ï¤á¤¿¡£¼þ°Ï¤¬ÊѲ½¤·¤Æ¤¤¤ë¡£");
-#else
-                                               msg_print("You start walking around. Your surroundings change.");
-#endif
-
-
-                                               if (autosave_l) do_cmd_save_game(TRUE);
-
-                                               /* Leaving */
-                                               p_ptr->leaving = TRUE;
-                                       }
-                               }
+                               (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)restore_level();
                        }
                        break;
 
                case RACE_BARBARIAN:
-                       if (racial_aux(8, 10, A_STR, ((p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_BERSERKER) ? 6 : 12)))
-                       {
 #ifdef JP
-msg_print("¤¦¤©¤©¤ª¤ª¡ª");
+                       msg_print("¤¦¤©¤©¤ª¤ª¡ª");
 #else
-                               msg_print("Raaagh!");
+                       msg_print("Raaagh!");
 #endif
 
-                               (void)set_afraid(0);
-
-                               (void)set_shero(10 + randint1(plev), FALSE);
-                               (void)hp_player(30);
-                       }
+                       (void)set_afraid(0);
+                       (void)set_shero(10 + randint1(plev), FALSE);
+                       (void)hp_player(30);
                        break;
 
                case RACE_HALF_OGRE:
-                       if (racial_aux(25, 35, A_INT, 15))
-                       {
 #ifdef JP
-msg_print("Çúȯ¤Î¥ë¡¼¥ó¤ò¿µ½Å¤Ë»Å³Ý¤±¤¿...");
+                       msg_print("Çúȯ¤Î¥ë¡¼¥ó¤ò¿µ½Å¤Ë»Å³Ý¤±¤¿...");
 #else
-                               msg_print("You carefully set an explosive rune...");
+                       msg_print("You carefully set an explosive rune...");
 #endif
 
-                               explosive_rune();
-                       }
+                       explosive_rune();
                        break;
 
                case RACE_HALF_GIANT:
-                       if (racial_aux(20, 10, A_STR, 12))
-                       {
-                               if (!get_aim_dir(&dir)) break;
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("ÀФÎÊɤò᤭¤Ä¤±¤¿¡£");
+                       msg_print("ÀФÎÊɤò᤭¤Ä¤±¤¿¡£");
 #else
-                               msg_print("You bash at a stone wall.");
+                       msg_print("You bash at a stone wall.");
 #endif
 
-                               (void)wall_to_mud(dir);
-                       }
+                       (void)wall_to_mud(dir);
                        break;
 
                case RACE_HALF_TITAN:
-                       if (racial_aux(15, 10, A_INT, 12))
-                       {
 #ifdef JP
-msg_print("Ũ¤òÄ´ºº¤·¤¿...");
+                       msg_print("Ũ¤òÄ´ºº¤·¤¿...");
 #else
-                               msg_print("You examine your foes...");
+                       msg_print("You examine your foes...");
 #endif
 
-                               probing();
-                       }
+                       probing();
                        break;
 
                case RACE_CYCLOPS:
-                       if (racial_aux(20, 15, A_STR, 12))
-                       {
-                               if (!get_aim_dir(&dir)) break;
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("µðÂç¤Ê´ä¤òÅꤲ¤¿¡£");
+                       msg_print("µðÂç¤Ê´ä¤òÅꤲ¤¿¡£");
 #else
-                               msg_print("You throw a huge boulder.");
+                       msg_print("You throw a huge boulder.");
 #endif
 
-                               fire_bolt(GF_MISSILE, dir, (3 * plev) / 2);
-                       }
+                       fire_bolt(GF_MISSILE, dir, (3 * plev) / 2);
                        break;
 
                case RACE_YEEK:
-                       if (racial_aux(15, 15, A_WIS, 10))
-                       {
-                               if (!get_aim_dir(&dir)) break;
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¶«¤ÓÀ¼¤ò¾å¤²¤¿¡ª");
+                       msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¶«¤ÓÀ¼¤ò¾å¤²¤¿¡ª");
 #else
-                               msg_print("You make a horrible scream!");
+                       msg_print("You make a horrible scream!");
 #endif
 
-                               (void)fear_monster(dir, plev);
-                       }
+                       (void)fear_monster(dir, plev);
                        break;
 
                case RACE_KLACKON:
-                       if (racial_aux(9, 9, A_DEX, 14))
-                       {
-                               if (!get_aim_dir(&dir)) break;
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("»À¤òÅǤ¤¤¿¡£");
+                       msg_print("»À¤òÅǤ¤¤¿¡£");
 #else
-                               msg_print("You spit acid.");
+                       msg_print("You spit acid.");
 #endif
 
-                               if (plev < 25)
-                                       fire_bolt(GF_ACID, dir, plev);
-                               else
-                                       fire_ball(GF_ACID, dir, plev, 2);
-                       }
+                       if (plev < 25) fire_bolt(GF_ACID, dir, plev);
+                       else fire_ball(GF_ACID, dir, plev, 2);
                        break;
 
                case RACE_KOBOLD:
-                       if (racial_aux(12, 8, A_DEX, 14))
-                       {
-                               if(!get_aim_dir(&dir)) break;
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("ÆǤΥÀ¡¼¥Ä¤òÅꤲ¤¿¡£");
+                       msg_print("ÆǤΥÀ¡¼¥Ä¤òÅꤲ¤¿¡£");
 #else
-                               msg_print("You throw a dart of poison.");
+                       msg_print("You throw a dart of poison.");
 #endif
 
-                               fire_bolt(GF_POIS, dir, plev);
-                       }
+                       fire_bolt(GF_POIS, dir, plev);
                        break;
 
                case RACE_NIBELUNG:
-                       if (racial_aux(10, 5, A_WIS, 10))
-                       {
 #ifdef JP
-msg_print("¼þ°Ï¤òÄ´ºº¤·¤¿¡£");
+                       msg_print("¼þ°Ï¤òÄ´ºº¤·¤¿¡£");
 #else
-                               msg_print("You examine your surroundings.");
+                       msg_print("You examine your surroundings.");
 #endif
 
-                               (void)detect_traps(DETECT_RAD_DEFAULT);
-                               (void)detect_doors(DETECT_RAD_DEFAULT);
-                               (void)detect_stairs(DETECT_RAD_DEFAULT);
-                       }
+                       (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
+                       (void)detect_doors(DETECT_RAD_DEFAULT);
+                       (void)detect_stairs(DETECT_RAD_DEFAULT);
                        break;
 
                case RACE_DARK_ELF:
-                       if (racial_aux(2, 2, A_INT, 9))
-                       {
-                               if (!get_aim_dir(&dir)) break;
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤òÊü¤Ã¤¿¡£");
+                       msg_print("¥Þ¥¸¥Ã¥¯¡¦¥ß¥µ¥¤¥ë¤òÊü¤Ã¤¿¡£");
 #else
-                               msg_print("You cast a magic missile.");
+                       msg_print("You cast a magic missile.");
 #endif
 
-                               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:
-                       if (racial_aux(1, plev, A_CON, 12))
                        {
                                int  Type = (one_in_(3) ? GF_COLD : GF_FIRE);
 #ifdef JP
-cptr Type_desc = ((Type == GF_COLD) ? "Î䵤" : "±ê");
+                               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)
                                {
@@ -1840,21 +1682,19 @@ cptr Type_desc = ((Type == GF_COLD) ? "
                                                        {
                                                                Type = GF_MISSILE;
 #ifdef JP
-Type_desc = "¥¨¥ì¥á¥ó¥È";
+                                                               Type_desc = "¥¨¥ì¥á¥ó¥È";
 #else
                                                                Type_desc = "the elements";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_SHARDS;
 #ifdef JP
-Type_desc = "ÇËÊÒ";
+                                                               Type_desc = "ÇËÊÒ";
 #else
                                                                Type_desc = "shards";
 #endif
-
                                                        }
                                                        break;
                                                case CLASS_MAGE:
@@ -1869,21 +1709,19 @@ Type_desc = "
                                                        {
                                                                Type = GF_MANA;
 #ifdef JP
-Type_desc = "ËâÎÏ";
+                                                               Type_desc = "ËâÎÏ";
 #else
                                                                Type_desc = "mana";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_DISENCHANT;
 #ifdef JP
-Type_desc = "Îô²½";
+                                                               Type_desc = "Îô²½";
 #else
                                                                Type_desc = "disenchantment";
 #endif
-
                                                        }
                                                        break;
                                                case CLASS_CHAOS_WARRIOR:
@@ -1891,21 +1729,19 @@ Type_desc = "
                                                        {
                                                                Type = GF_CONFUSION;
 #ifdef JP
-Type_desc = "º®Íð";
+                                                               Type_desc = "º®Íð";
 #else
                                                                Type_desc = "confusion";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_CHAOS;
 #ifdef JP
-Type_desc = "¥«¥ª¥¹";
+                                                               Type_desc = "¥«¥ª¥¹";
 #else
                                                                Type_desc = "chaos";
 #endif
-
                                                        }
                                                        break;
                                                case CLASS_MONK:
@@ -1915,21 +1751,19 @@ Type_desc = "
                                                        {
                                                                Type = GF_CONFUSION;
 #ifdef JP
-Type_desc = "º®Íð";
+                                                               Type_desc = "º®Íð";
 #else
                                                                Type_desc = "confusion";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_SOUND;
 #ifdef JP
-Type_desc = "¹ì²»";
+                                                               Type_desc = "¹ì²»";
 #else
                                                                Type_desc = "sound";
 #endif
-
                                                        }
                                                        break;
                                                case CLASS_MINDCRAFTER:
@@ -1937,21 +1771,19 @@ Type_desc = "
                                                        {
                                                                Type = GF_CONFUSION;
 #ifdef JP
-Type_desc = "º®Íð";
+                                                               Type_desc = "º®Íð";
 #else
                                                                Type_desc = "confusion";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_PSI;
 #ifdef JP
-Type_desc = "Àº¿À¥¨¥Í¥ë¥®¡¼";
+                                                               Type_desc = "Àº¿À¥¨¥Í¥ë¥®¡¼";
 #else
                                                                Type_desc = "mental energy";
 #endif
-
                                                        }
                                                        break;
                                                case CLASS_PRIEST:
@@ -1960,21 +1792,19 @@ Type_desc = "
                                                        {
                                                                Type = GF_HELL_FIRE;
 #ifdef JP
-Type_desc = "ÃϹö¤Î¹å²Ð";
+                                                               Type_desc = "ÃϹö¤Î¹å²Ð";
 #else
                                                                Type_desc = "hellfire";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_HOLY_FIRE;
 #ifdef JP
-Type_desc = "À»¤Ê¤ë±ê";
+                                                               Type_desc = "À»¤Ê¤ë±ê";
 #else
                                                                Type_desc = "holy fire";
 #endif
-
                                                        }
                                                        break;
                                                case CLASS_ROGUE:
@@ -1983,21 +1813,19 @@ Type_desc = "
                                                        {
                                                                Type = GF_DARK;
 #ifdef JP
-Type_desc = "°Å¹õ";
+                                                               Type_desc = "°Å¹õ";
 #else
                                                                Type_desc = "darkness";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_POIS;
 #ifdef JP
-Type_desc = "ÆÇ";
+                                                               Type_desc = "ÆÇ";
 #else
                                                                Type_desc = "poison";
 #endif
-
                                                        }
                                                        break;
                                                case CLASS_BARD:
@@ -2005,29 +1833,26 @@ Type_desc = "
                                                        {
                                                                Type = GF_SOUND;
 #ifdef JP
-Type_desc = "¹ì²»";
+                                                               Type_desc = "¹ì²»";
 #else
                                                                Type_desc = "sound";
 #endif
-
                                                        }
                                                        else
                                                        {
                                                                Type = GF_CONFUSION;
 #ifdef JP
-Type_desc = "º®Íð";
+                                                               Type_desc = "º®Íð";
 #else
                                                                Type_desc = "confusion";
 #endif
-
                                                        }
                                                        break;
                                        }
                                }
 
-                               if (!get_aim_dir(&dir)) break;
 #ifdef JP
-msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", Type_desc);
+                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", Type_desc);
 #else
                                msg_format("You breathe %s.", Type_desc);
 #endif
@@ -2038,78 +1863,72 @@ msg_format("
                        break;
 
                case RACE_MIND_FLAYER:
-                       if (racial_aux(15, 12, A_INT, 14))
-                       {
-                               if (!get_aim_dir(&dir)) break;
-                               else
-                               {
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï½¸Ã椷¡¢Ìܤ¬ÀÖ¤¯µ±¤¤¤¿...");
+                       msg_print("¤¢¤Ê¤¿¤Ï½¸Ã椷¡¢Ìܤ¬ÀÖ¤¯µ±¤¤¤¿...");
 #else
-                                       msg_print("You concentrate and your eyes glow red...");
+                       msg_print("You concentrate and your eyes glow red...");
 #endif
 
-                                       fire_bolt(GF_PSI, dir, plev);
-                               }
-                       }
+                       fire_bolt(GF_PSI, dir, plev);
                        break;
 
                case RACE_IMP:
-                       if (racial_aux(9, 15, A_WIS, 15))
+                       if (!get_aim_dir(&dir)) return FALSE;
+                       if (plev >= 30)
                        {
-                               if (!get_aim_dir(&dir)) break;
-                               if (plev >= 30)
-                               {
 #ifdef JP
-msg_print("¥Õ¥¡¥¤¥¢¡¼¥Ü¡¼¥ë¤òÊü¤Ã¤¿¡£");
+                               msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¡¼¥ë¤òÊü¤Ã¤¿¡£");
 #else
-                                       msg_print("You cast a ball of fire.");
+                               msg_print("You cast a ball of fire.");
 #endif
 
-                                       fire_ball(GF_FIRE, dir, plev, 2);
-                               }
-                               else
-                               {
+                               fire_ball(GF_FIRE, dir, plev, 2);
+                       }
+                       else
+                       {
 #ifdef JP
-msg_print("¥Õ¥¡¥¤¥¢¡¼¥Ü¥ë¥È¤òÊü¤Ã¤¿¡£");
+                               msg_print("¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È¤òÊü¤Ã¤¿¡£");
 #else
-                                       msg_print("You cast a bolt of fire.");
+                               msg_print("You cast a bolt of fire.");
 #endif
 
-                                       fire_bolt(GF_FIRE, dir, plev);
-                               }
+                               fire_bolt(GF_FIRE, dir, plev);
                        }
                        break;
 
                case RACE_GOLEM:
-                       if (racial_aux(20, 15, A_CON, 8))
-                       {
-                               (void)set_shield(randint1(20) + 30, FALSE);
-                       }
+                       (void)set_shield(randint1(20) + 30, FALSE);
                        break;
 
                case RACE_SKELETON:
                case RACE_ZOMBIE:
-                       if (racial_aux(30, 30, A_WIS, 18))
-                       {
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¼º¤Ã¤¿¥¨¥Í¥ë¥®¡¼¤ò¼è¤êÌ᤽¤¦¤È»î¤ß¤¿¡£");
+                       msg_print("¤¢¤Ê¤¿¤Ï¼º¤Ã¤¿¥¨¥Í¥ë¥®¡¼¤ò¼è¤êÌ᤽¤¦¤È»î¤ß¤¿¡£");
 #else
-                               msg_print("You attempt to restore your lost energies.");
+                       msg_print("You attempt to restore your lost energies.");
 #endif
 
-                               (void)restore_level();
-                       }
+                       (void)restore_level();
                        break;
 
                case RACE_VAMPIRE:
-                       if (racial_aux(2, (1 + (plev / 3)), A_CON, 9))
+                       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+                       {
+#ifdef JP
+                               msg_print("¤Ê¤¼¤«¹¶·â¤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤¡£");
+#else
+                               msg_print("Something prevent you from attacking.");
+#endif
+                               return FALSE;
+                       }
+                       else
                        {
                                int y, x, dummy = 0;
                                cave_type *c_ptr;
 
                                /* Only works on adjacent monsters */
-                               if (!get_rep_dir(&dir,FALSE)) break;   /* was get_aim_dir */
+                               if (!get_rep_dir(&dir,FALSE)) return FALSE;   /* was get_aim_dir */
                                y = py + ddy[dir];
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
@@ -2117,7 +1936,7 @@ msg_print("
                                if (!c_ptr->m_idx)
                                {
 #ifdef JP
-msg_print("²¿¤â¤Ê¤¤¾ì½ê¤Ë³ú¤ß¤Ä¤¤¤¿¡ª");
+                                       msg_print("²¿¤â¤Ê¤¤¾ì½ê¤Ë³ú¤ß¤Ä¤¤¤¿¡ª");
 #else
                                        msg_print("You bite into thin air!");
 #endif
@@ -2126,7 +1945,7 @@ msg_print("
                                }
 
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¥Ë¥ä¥ê¤È¤·¤Æ²ç¤ò¤à¤¤¤¿...");
+                               msg_print("¤¢¤Ê¤¿¤Ï¥Ë¥ä¥ê¤È¤·¤Æ²ç¤ò¤à¤¤¤¿...");
 #else
                                msg_print("You grin and bare your fangs...");
 #endif
@@ -2139,22 +1958,22 @@ msg_print("
                                                (void)hp_player(dummy);
                                        else
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¶õÊ¢¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
+                                               msg_print("¤¢¤Ê¤¿¤Ï¶õÊ¢¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
 #else
                                                msg_print("You were not hungry.");
 #endif
 
-                                               /* 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);
+                                       /* 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
 #ifdef JP
-msg_print("¤²¤§¡£¤Ò¤É¤¤Ì£¤À¡£");
+                                       msg_print("¤²¤§¡£¤Ò¤É¤¤Ì£¤À¡£");
 #else
                                        msg_print("Yechh. That tastes foul.");
 #endif
@@ -2163,129 +1982,97 @@ msg_print("
                        break;
 
                case RACE_SPECTRE:
-                       if (racial_aux(4, 6, A_INT, 3))
-                       {
+                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤¶«¤ÓÀ¼¤ò¤¢¤²¤¿¡ª");
+                       msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤¶«¤ÓÀ¼¤ò¤¢¤²¤¿¡ª");
 #else
-                               msg_print("You emit an eldritch howl!");
+                       msg_print("You emit an eldritch howl!");
 #endif
 
-                               if (!get_aim_dir(&dir)) break;
-                               (void)fear_monster(dir, plev);
-                       }
+                       (void)fear_monster(dir, plev);
                        break;
 
                case RACE_SPRITE:
-                       if (racial_aux(12, 12, A_INT, 15))
-                       {
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤ÏËâË¡¤ÎÊ´¤òÅꤲ¤Ä¤±¤¿...");
+                       msg_print("¤¢¤Ê¤¿¤ÏËâË¡¤ÎÊ´¤òÅꤲ¤Ä¤±¤¿...");
 #else
-                               msg_print("You throw some magic dust...");
+                       msg_print("You throw some magic dust...");
 #endif
 
-                               if (plev < 25)
-                                       sleep_monsters_touch();
-                               else
-                                       (void)sleep_monsters();
-                       }
+                       if (plev < 25) sleep_monsters_touch();
+                       else (void)sleep_monsters();
                        break;
 
                case RACE_DEMON:
-                       if (racial_aux(15, 10+p_ptr->lev/3, A_CON, 20))
                        {
                                int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
-                               if (!get_aim_dir(&dir)) break;
+                               if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
+                               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);
+                               fire_ball(type, dir, plev * 3, -(plev / 15) - 1);
                        }
                        break;
 
                case RACE_KUTA:
-                       if (racial_aux(20, 15, A_CHR, 8))
-                       {
-                               (void)set_tsubureru(randint1(20) + 30, FALSE);
-                       }
+                       (void)set_tsubureru(randint1(20) + 30, FALSE);
                        break;
 
                case RACE_ANDROID:
+                       if (!get_aim_dir(&dir)) return FALSE;
                        if (plev < 10)
                        {
-                               if (racial_aux(1, 7, A_STR, 8))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-                                       msg_print("¥ì¥¤¥¬¥ó¤òȯ¼Í¤·¤¿¡£");
+                               msg_print("¥ì¥¤¥¬¥ó¤òȯ¼Í¤·¤¿¡£");
 #else
-                                       msg_print("You fire your ray gun.");
+                               msg_print("You fire your ray gun.");
 #endif
-                                       fire_bolt(GF_MISSILE, dir, (plev+1) / 2);
-                               }
+                               fire_bolt(GF_MISSILE, dir, (plev+1) / 2);
                        }
                        else if (plev < 25)
                        {
-                               if (racial_aux(10, 13, A_STR, 10))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-                                       msg_print("¥Ö¥é¥¹¥¿¡¼¤òȯ¼Í¤·¤¿¡£");
+                               msg_print("¥Ö¥é¥¹¥¿¡¼¤òȯ¼Í¤·¤¿¡£");
 #else
-                                       msg_print("You fire your blaster.");
+                               msg_print("You fire your blaster.");
 #endif
-                                       fire_bolt(GF_MISSILE, dir, plev);
-                               }
+                               fire_bolt(GF_MISSILE, dir, plev);
                        }
                        else if (plev < 35)
                        {
-                               if (racial_aux(25, 26, A_STR, 12))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-                                       msg_print("¥Ð¥º¡¼¥«¤òȯ¼Í¤·¤¿¡£");
+                               msg_print("¥Ð¥º¡¼¥«¤òȯ¼Í¤·¤¿¡£");
 #else
-                                       msg_print("You fire your bazooka.");
+                               msg_print("You fire your bazooka.");
 #endif
-                                       fire_ball(GF_MISSILE, dir, plev * 2, 2);
-                               }
+                               fire_ball(GF_MISSILE, dir, plev * 2, 2);
                        }
                        else if (plev < 45)
                        {
-                               if (racial_aux(35, 40, A_STR, 15))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-                                       msg_print("¥Ó¡¼¥à¥­¥ã¥Î¥ó¤òȯ¼Í¤·¤¿¡£");
+                               msg_print("¥Ó¡¼¥à¥­¥ã¥Î¥ó¤òȯ¼Í¤·¤¿¡£");
 #else
-                                       msg_print("You fire a beam cannon.");
+                               msg_print("You fire a beam cannon.");
 #endif
-                                       fire_beam(GF_MISSILE, dir, plev * 2);
-                               }
+                               fire_beam(GF_MISSILE, dir, plev * 2);
                        }
                        else
                        {
-                               if (racial_aux(45, 60, A_STR, 18))
-                               {
-                                       if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
-                                       msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
+                               msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡£");
 #else
-                                       msg_print("You fire a rocket.");
+                               msg_print("You fire a rocket.");
 #endif
-                                       fire_ball(GF_ROCKET, dir, plev * 5, 2);
-                               }
+                               fire_ball(GF_ROCKET, dir, plev * 5, 2);
                        }
                        break;
 
                default:
 #ifdef JP
-msg_print("¤³¤Î¼ï²¤ÏÆüì¤ÊǽÎϤò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£");
+                       msg_print("¤³¤Î¼ï²¤ÏÆüì¤ÊǽÎϤò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£");
 #else
                        msg_print("This race has no bonus power.");
 #endif
@@ -2297,18 +2084,6 @@ msg_print("
 }
 
 
-typedef struct power_desc_type power_desc_type;
-
-struct power_desc_type
-{
-       char name[40];
-       int  level;
-       int  cost;
-       int  fail;
-       int  number;
-};
-
-
 /*
  * Allow user to choose a power (racial / mutation) to activate
  */
@@ -2318,7 +2093,7 @@ void do_cmd_racial_power(void)
        int             num, i = 0;
        int             ask = TRUE;
        int             lvl = p_ptr->lev;
-       bool            flag, redraw;
+       bool            flag, redraw, cast = FALSE;
        bool            warrior = ((p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_BERSERKER) ? TRUE : FALSE);
        char            choice;
        char            out_val[160];
@@ -2362,7 +2137,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 40;
                power_desc[num].cost = 75;
-               power_desc[num].fail = 100 - racial_chance(40, A_DEX, 35);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 35;
                power_desc[num++].number = -3;
                break;
        }
@@ -2378,13 +2154,14 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 25;
                power_desc[num].cost = 1;
-               power_desc[num].fail = 100 - racial_chance(25, A_INT, 25);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 25;
                power_desc[num++].number = -3;
                break;
        }
        case CLASS_PRIEST:
        {
-               if (p_ptr->realm1 == REALM_LIFE)
+               if (is_good_realm(p_ptr->realm1))
                {
 #ifdef JP
 strcpy(power_desc[num].name, "Éð´ï½ËÊ¡");
@@ -2394,7 +2171,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 35;
                        power_desc[num].cost = 70;
-                       power_desc[num].fail = 100 - racial_chance(35, A_WIS, 50);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 50;
                        power_desc[num++].number = -3;
                }
                else
@@ -2407,7 +2185,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 42;
                        power_desc[num].cost = 40;
-                       power_desc[num].fail = 100 - racial_chance(42, A_WIS, 35);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 35;
                        power_desc[num++].number = -3;
                }
                break;
@@ -2422,7 +2201,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 8;
                power_desc[num].cost = 12;
-               power_desc[num].fail = 100 - racial_chance(8, A_DEX, 14);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 14;
                power_desc[num++].number = -3;
                break;
        }
@@ -2436,13 +2216,14 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 15;
                power_desc[num].cost = 20;
-               power_desc[num].fail = 100 - racial_chance(15, A_INT, 12);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 12;
                power_desc[num++].number = -3;
                break;
        }
        case CLASS_PALADIN:
        {
-               if (p_ptr->realm1 == REALM_LIFE)
+               if (is_good_realm(p_ptr->realm1))
                {
 #ifdef JP
 strcpy(power_desc[num].name, "¥Û¡¼¥ê¡¼¡¦¥é¥ó¥¹");
@@ -2452,7 +2233,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 30;
                        power_desc[num].cost = 30;
-                       power_desc[num].fail = 100 - racial_chance(30, A_WIS, 30);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 30;
                        power_desc[num++].number = -3;
                }
                else
@@ -2465,7 +2247,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 30;
                        power_desc[num].cost = 30;
-                       power_desc[num].fail = 100 - racial_chance(30, A_WIS, 30);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 30;
                        power_desc[num++].number = -3;
                }
                break;
@@ -2480,7 +2263,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 25;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(25, A_INT, 10);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 10;
                power_desc[num++].number = -3;
 #ifdef JP
 strcpy(power_desc[num].name, "ÊÑ´¹: £Í£Ð¢ª£È£Ð");
@@ -2490,7 +2274,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 25;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(25, A_INT, 10);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 10;
                power_desc[num++].number = -4;
                break;
        }
@@ -2504,7 +2289,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 40;
                power_desc[num].cost = 50;
-               power_desc[num].fail = 100 - racial_chance(40, A_INT, 25);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 25;
                power_desc[num++].number = -3;
                break;
        }
@@ -2518,7 +2304,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 25;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(20, A_DEX, 0);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
 #ifdef JP
 strcpy(power_desc[num].name, "É´Îö·ý");
@@ -2528,7 +2315,8 @@ strcpy(power_desc[num].name, "ɴ
 
                power_desc[num].level = 30;
                power_desc[num].cost = 30;
-               power_desc[num].fail = 100 - racial_chance(20, A_STR, 20);
+               power_desc[num].stat = A_STR;
+               power_desc[num].fail = 20;
                power_desc[num++].number = -4;
                break;
        }
@@ -2543,7 +2331,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 15;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(15, A_WIS, 10);
+               power_desc[num].stat = A_WIS;
+               power_desc[num].fail = 10;
                power_desc[num++].number = -3;
                break;
        }
@@ -2557,7 +2346,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(1, A_DEX, 0);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
 #ifdef JP
 strcpy(power_desc[num].name, "¿¿¡¦´ÕÄê");
@@ -2567,7 +2357,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 25;
                power_desc[num].cost = 20;
-               power_desc[num].fail = 100 - racial_chance(25, A_INT, 20);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 20;
                power_desc[num++].number = -4;
                break;
        }
@@ -2581,7 +2372,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 30;
                power_desc[num].cost = 100;
-               power_desc[num].fail = 100 - racial_chance(30, A_DEX, 30);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 30;
                power_desc[num++].number = -3;
                break;
        }
@@ -2595,7 +2387,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = (p_ptr->lev+3)/4;
-               power_desc[num].fail = 100 - racial_chance(1, A_CHR, 10);
+               power_desc[num].stat = A_CHR;
+               power_desc[num].fail = 10;
                power_desc[num++].number = -3;
 #ifdef JP
 strcpy(power_desc[num].name, "¿¿¡¦À¸Êª»ÙÇÛ");
@@ -2605,7 +2398,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 30;
                power_desc[num].cost = (p_ptr->lev+20)/2;
-               power_desc[num].fail = 100 - racial_chance(30, A_CHR, 10);
+               power_desc[num].stat = A_CHR;
+               power_desc[num].fail = 10;
                power_desc[num++].number = -4;
                break;
        }
@@ -2619,7 +2413,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(0, A_DEX, 0);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
                break;
        }
@@ -2633,7 +2428,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(0, A_INT, 0);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
                break;
        }
@@ -2647,7 +2443,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(0, A_CHR, 0);
+               power_desc[num].stat = A_CHR;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
                break;
        }
@@ -2661,7 +2458,8 @@ strcpy(power_desc[num].name, "Ϣ³
 
                power_desc[num].level = 48;
                power_desc[num].cost = 20;
-               power_desc[num].fail = 100 - racial_chance(48, A_INT, 0);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
                break;
        }
@@ -2675,7 +2473,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(1, A_WIS, 0);
+               power_desc[num].stat = A_WIS;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
 #ifdef JP
 strcpy(power_desc[num].name, "·¿");
@@ -2685,7 +2484,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 25;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(25, A_DEX, 0);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -4;
                break;
        }
@@ -2699,7 +2499,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(1, A_INT, 0);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
                break;
        }
@@ -2713,23 +2514,14 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 10;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(10, A_STR, 10);
+               power_desc[num].stat = A_STR;
+               power_desc[num].fail = 10;
                power_desc[num++].number = -3;
                break;
        }
        case CLASS_BERSERKER:
        {
 #ifdef JP
-strcpy(power_desc[num].name, "¶õÊ¢½¼Â­");
-#else
-               strcpy(power_desc[num].name, "Satisfy Hunger");
-#endif
-
-               power_desc[num].level = 5;
-               power_desc[num].cost = 5;
-               power_desc[num].fail = 100 - racial_chance(5, A_DEX, 10);
-               power_desc[num++].number = -3;
-#ifdef JP
 strcpy(power_desc[num].name, "µ¢´Ô");
 #else
                strcpy(power_desc[num].name, "Recall");
@@ -2737,8 +2529,9 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 10;
                power_desc[num].cost = 10;
-               power_desc[num].fail = 100 - racial_chance(10, A_DEX, 20);
-               power_desc[num++].number = -4;
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 20;
+               power_desc[num++].number = -3;
                break;
        }
        case CLASS_MIRROR_MASTER:
@@ -2751,7 +2544,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 1;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(1, A_INT, 0);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
 #ifdef JP
 strcpy(power_desc[num].name, "ÀÅ¿å");
@@ -2761,7 +2555,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 30;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(30, A_INT, 20);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 20;
                power_desc[num++].number = -4;
                break;
        }
@@ -2775,7 +2570,8 @@ strcpy(power_desc[num].name, "
 
                power_desc[num].level = 5;
                power_desc[num].cost = 15;
-               power_desc[num].fail = 100 - racial_chance(5, A_INT, 20);
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 20;
                power_desc[num++].number = -3;
                break;
        }
@@ -2789,7 +2585,8 @@ strcpy(power_desc[num].name, "®
 
                power_desc[num].level = 20;
                power_desc[num].cost = 0;
-               power_desc[num].fail = 100 - racial_chance(20, A_DEX, 0);
+               power_desc[num].stat = A_DEX;
+               power_desc[num].fail = 0;
                power_desc[num++].number = -3;
                break;
        }
@@ -2816,7 +2613,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 10+lvl/3;
-                       power_desc[num].fail = 100 - racial_chance(15, A_CON, 20);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 20;
                        power_desc[num++].number = -1;
                        break;
                case MIMIC_VAMPIRE:
@@ -2828,7 +2626,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 2;
                        power_desc[num].cost = 1 + (lvl / 3);
-                       power_desc[num].fail = 100 - racial_chance(2, A_CON, 9);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 9;
                        power_desc[num++].number = -1;
                        break;
                }
@@ -2846,7 +2645,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 5;
                        power_desc[num].cost = 5;
-                       power_desc[num].fail = 100 - racial_chance(5, A_WIS, 12);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_NIBELUNG:
@@ -2858,7 +2658,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 10;
                        power_desc[num].cost = 5;
-                       power_desc[num].fail = 100 - racial_chance(10, A_WIS, 10);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 10;
                        power_desc[num++].number = -1;
                        break;
                case RACE_HOBBIT:
@@ -2870,7 +2671,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 10;
-                       power_desc[num].fail = 100 - racial_chance(15, A_INT, 10);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 10;
                        power_desc[num++].number = -1;
                        break;
                case RACE_GNOME:
@@ -2882,7 +2684,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 5;
                        power_desc[num].cost = 5;
-                       power_desc[num].fail = 100 - racial_chance(5, A_INT, 12);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_HALF_ORC:
@@ -2894,7 +2697,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 3;
                        power_desc[num].cost = 5;
-                       power_desc[num].fail = 100 - racial_chance(3, A_WIS, (warrior ? 5 : 10));
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = warrior ? 5 : 10;
                        power_desc[num++].number = -1;
                        break;
                case RACE_HALF_TROLL:
@@ -2906,7 +2710,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 10;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(10, A_STR, (warrior ? 6 : 12));
+                       power_desc[num].stat = A_STR;
+                       power_desc[num].fail = warrior ? 6 : 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_BARBARIAN:
@@ -2918,7 +2723,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 8;
                        power_desc[num].cost = 10;
-                       power_desc[num].fail = 100 - racial_chance(8, A_STR, (warrior ? 6 : 12));
+                       power_desc[num].stat = A_STR;
+                       power_desc[num].fail = warrior ? 6 : 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_AMBERITE:
@@ -2930,7 +2736,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 30;
                        power_desc[num].cost = 50;
-                       power_desc[num].fail = 100 - racial_chance(30, A_INT, 50);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 50;
                        power_desc[num++].number = -1;
 #ifdef JP
 strcpy(power_desc[num].name, "¥Ñ¥¿¡¼¥ó¡¦¥¦¥©¡¼¥¯");
@@ -2940,7 +2747,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 40;
                        power_desc[num].cost = 75;
-                       power_desc[num].fail = 100 - racial_chance(40, A_WIS, 50);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 50;
                        power_desc[num++].number = -2;
                        break;
                case RACE_HALF_OGRE:
@@ -2952,7 +2760,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 25;
                        power_desc[num].cost = 35;
-                       power_desc[num].fail = 100 - racial_chance(25, A_INT, 15);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = -1;
                        break;
                case RACE_HALF_GIANT:
@@ -2964,7 +2773,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 20;
                        power_desc[num].cost = 10;
-                       power_desc[num].fail = 100 - racial_chance(20, A_STR, 12);
+                       power_desc[num].stat = A_STR;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_HALF_TITAN:
@@ -2976,7 +2786,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 10;
-                       power_desc[num].fail = 100 - racial_chance(15, A_INT, 12);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_CYCLOPS:
@@ -2988,7 +2799,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 20;
                        power_desc[num].cost = 15;
-                       power_desc[num].fail = 100 - racial_chance(20, A_STR, 12);
+                       power_desc[num].stat = A_STR;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_YEEK:
@@ -3000,7 +2812,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 15;
-                       power_desc[num].fail = 100 - racial_chance(15, A_WIS, 10);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 10;
                        power_desc[num++].number = -1;
                        break;
                case RACE_SPECTRE:
@@ -3012,7 +2825,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 4;
                        power_desc[num].cost = 6;
-                       power_desc[num].fail = 100 - racial_chance(4, A_INT, 3);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 3;
                        power_desc[num++].number = -1;
                        break;
                case RACE_KLACKON:
@@ -3024,7 +2838,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 9;
                        power_desc[num].cost = 9;
-                       power_desc[num].fail = 100 - racial_chance(9, A_DEX, 14);
+                       power_desc[num].stat = A_DEX;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = -1;
                        break;
                case RACE_KOBOLD:
@@ -3036,7 +2851,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 12;
                        power_desc[num].cost = 8;
-                       power_desc[num].fail = 100 - racial_chance(12, A_DEX, 14);
+                       power_desc[num].stat = A_DEX;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = -1;
                        break;
                case RACE_DARK_ELF:
@@ -3048,7 +2864,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 2;
                        power_desc[num].cost = 2;
-                       power_desc[num].fail = 100 - racial_chance(2, A_INT, 9);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 9;
                        power_desc[num++].number = -1;
                        break;
                case RACE_DRACONIAN:
@@ -3060,7 +2877,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 1;
                        power_desc[num].cost = lvl;
-                       power_desc[num].fail = 100 - racial_chance(1, A_CON, 12);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = -1;
                        break;
                case RACE_MIND_FLAYER:
@@ -3072,7 +2890,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(15, A_INT, 14);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = -1;
                        break;
                case RACE_IMP:
@@ -3084,7 +2903,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 9;
                        power_desc[num].cost = 15;
-                       power_desc[num].fail = 100 - racial_chance(9, A_WIS, 15);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = -1;
                        break;
                case RACE_GOLEM:
@@ -3096,7 +2916,8 @@ strcpy(power_desc[num].name, "ȩ
 
                        power_desc[num].level = 20;
                        power_desc[num].cost = 15;
-                       power_desc[num].fail = 100 - racial_chance(20, A_CON, 8);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 8;
                        power_desc[num++].number = -1;
                        break;
                case RACE_SKELETON:
@@ -3109,7 +2930,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 30;
                        power_desc[num].cost = 30;
-                       power_desc[num].fail = 100 - racial_chance(30, A_WIS, 18);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 18;
                        power_desc[num++].number = -1;
                        break;
                case RACE_VAMPIRE:
@@ -3121,7 +2943,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 2;
                        power_desc[num].cost = 1 + (lvl / 3);
-                       power_desc[num].fail = 100 - racial_chance(2, A_CON, 9);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 9;
                        power_desc[num++].number = -1;
                        break;
                case RACE_SPRITE:
@@ -3133,7 +2956,8 @@ strcpy(power_desc[num].name, "̲
 
                        power_desc[num].level = 12;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(12, A_INT, 15);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = -1;
                        break;
                case RACE_DEMON:
@@ -3145,7 +2969,8 @@ sprintf(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 10+lvl/3;
-                       power_desc[num].fail = 100 - racial_chance(15, A_CON, 20);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 20;
                        power_desc[num++].number = -1;
                        break;
                case RACE_KUTA:
@@ -3157,7 +2982,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 20;
                        power_desc[num].cost = 15;
-                       power_desc[num].fail = 100 - racial_chance(15, A_CHR, 8);
+                       power_desc[num].stat = A_CHR;
+                       power_desc[num].fail = 8;
                        power_desc[num++].number = -1;
                        break;
                case RACE_ANDROID:
@@ -3171,7 +2997,7 @@ strcpy(power_desc[num].name, "
 
                                power_desc[num].level = 1;
                                power_desc[num].cost = 7;
-                               power_desc[num].fail = 100 - racial_chance(1, A_STR, 8);
+                               power_desc[num].fail = 8;
                        }
                        else if (p_ptr->lev < 25)
                        {
@@ -3183,7 +3009,7 @@ strcpy(power_desc[num].name, "
 
                                power_desc[num].level = 10;
                                power_desc[num].cost = 13;
-                               power_desc[num].fail = 100 - racial_chance(10, A_STR, 10);
+                               power_desc[num].fail = 10;
                        }
                        else if (p_ptr->lev < 35)
                        {
@@ -3195,7 +3021,7 @@ strcpy(power_desc[num].name, "
 
                                power_desc[num].level = 25;
                                power_desc[num].cost = 26;
-                               power_desc[num].fail = 100 - racial_chance(25, A_STR, 12);
+                               power_desc[num].fail = 12;
                        }
                        else if (p_ptr->lev < 45)
                        {
@@ -3207,7 +3033,7 @@ strcpy(power_desc[num].name, "
 
                                power_desc[num].level = 35;
                                power_desc[num].cost = 40;
-                               power_desc[num].fail = 100 - racial_chance(35, A_STR, 15);
+                               power_desc[num].fail = 15;
                        }
                        else
                        {
@@ -3219,8 +3045,9 @@ strcpy(power_desc[num].name, "
 
                                power_desc[num].level = 45;
                                power_desc[num].cost = 60;
-                               power_desc[num].fail = 100 - racial_chance(45, A_STR, 18);
+                               power_desc[num].fail = 18;
                        }
+                       power_desc[num].stat = A_STR;
                        power_desc[num++].number = -1;
                        break;
                default:
@@ -3242,7 +3069,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 9;
                        power_desc[num].cost = 9;
-                       power_desc[num].fail = 100 - racial_chance(9, A_DEX, 15);
+                       power_desc[num].stat = A_DEX;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = MUT1_SPIT_ACID;
                }
 
@@ -3256,7 +3084,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 20;
                        power_desc[num].cost = lvl;
-                       power_desc[num].fail = 100 - racial_chance(20, A_CON, 18);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 18;
                        power_desc[num++].number = MUT1_BR_FIRE;
                }
 
@@ -3270,7 +3099,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 12;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(12, A_CHR, 18);
+                       power_desc[num].stat = A_CHR;
+                       power_desc[num].fail = 18;
                        power_desc[num++].number = MUT1_HYPN_GAZE;
                }
 
@@ -3284,7 +3114,8 @@ strcpy(power_desc[num].name, "ǰư
 
                        power_desc[num].level = 9;
                        power_desc[num].cost = 9;
-                       power_desc[num].fail = 100 - racial_chance(9, A_WIS, 14);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = MUT1_TELEKINES;
                }
 
@@ -3298,7 +3129,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 7;
                        power_desc[num].cost = 7;
-                       power_desc[num].fail = 100 - racial_chance(7, A_WIS, 15);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = MUT1_VTELEPORT;
                }
 
@@ -3312,7 +3144,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 5;
                        power_desc[num].cost = 3;
-                       power_desc[num].fail = 100 - racial_chance(5, A_WIS, 15);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = MUT1_MIND_BLST;
                }
 
@@ -3326,7 +3159,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 15;
-                       power_desc[num].fail = 100 - racial_chance(15, A_CON, 14);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = MUT1_RADIATION;
                }
 
@@ -3340,7 +3174,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 2;
                        power_desc[num].cost = (1 + (lvl / 3));
-                       power_desc[num].fail = 100 - racial_chance(2, A_CON, 9);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 9;
                        power_desc[num++].number = MUT1_VAMPIRISM;
                }
 
@@ -3354,7 +3189,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 3;
                        power_desc[num].cost = 2;
-                       power_desc[num].fail = 100 - racial_chance(3, A_INT, 12);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = MUT1_SMELL_MET;
                }
 
@@ -3368,7 +3204,8 @@ strcpy(power_desc[num].name, "Ũ
 
                        power_desc[num].level = 5;
                        power_desc[num].cost = 4;
-                       power_desc[num].fail = 100 - racial_chance(5, A_INT, 15);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = MUT1_SMELL_MON;
                }
 
@@ -3382,7 +3219,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 3;
                        power_desc[num].cost = 3;
-                       power_desc[num].fail = 100 - racial_chance(3, A_WIS, 12);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = MUT1_BLINK;
                }
 
@@ -3396,7 +3234,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 8;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(8, A_CON, 18);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 18;
                        power_desc[num++].number = MUT1_EAT_ROCK;
                }
 
@@ -3410,7 +3249,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 15;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(15, A_DEX, 16);
+                       power_desc[num].stat = A_DEX;
+                       power_desc[num].fail = 16;
                        power_desc[num++].number = MUT1_SWAP_POS;
                }
 
@@ -3424,7 +3264,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 20;
                        power_desc[num].cost = 14;
-                       power_desc[num].fail = 100 - racial_chance(20, A_CON, 16);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 16;
                        power_desc[num++].number = MUT1_SHRIEK;
                }
 
@@ -3438,7 +3279,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 3;
                        power_desc[num].cost = 2;
-                       power_desc[num].fail = 100 - racial_chance(3, A_INT, 10);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 10;
                        power_desc[num++].number = MUT1_ILLUMINE;
                }
 
@@ -3452,7 +3294,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 7;
                        power_desc[num].cost = 14;
-                       power_desc[num].fail = 100 - racial_chance(7, A_WIS, 14);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = MUT1_DET_CURSE;
                }
 
@@ -3466,7 +3309,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 8;
                        power_desc[num].cost = 8;
-                       power_desc[num].fail = 100 - racial_chance(8, A_STR, 14);
+                       power_desc[num].stat = A_STR;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = MUT1_BERSERK;
                }
 
@@ -3480,7 +3324,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 18;
                        power_desc[num].cost = 20;
-                       power_desc[num].fail = 100 - racial_chance(18, A_CON, 18);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 18;
                        power_desc[num++].number = MUT1_POLYMORPH;
                }
 
@@ -3494,7 +3339,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 10;
                        power_desc[num].cost = 5;
-                       power_desc[num].fail = 100 - racial_chance(10, A_INT, 12);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = MUT1_MIDAS_TCH;
                }
 
@@ -3508,7 +3354,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 1;
                        power_desc[num].cost = 6;
-                       power_desc[num].fail = 100 - racial_chance(1, A_CON, 14);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = MUT1_GROW_MOLD;
                }
 
@@ -3522,7 +3369,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 10;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(10, A_CON, 12);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 12;
                        power_desc[num++].number = MUT1_RESIST;
                }
 
@@ -3536,7 +3384,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 12;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(12, A_STR, 16);
+                       power_desc[num].stat = A_STR;
+                       power_desc[num].fail = 16;
                        power_desc[num++].number = MUT1_EARTHQUAKE;
                }
 
@@ -3550,7 +3399,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 17;
                        power_desc[num].cost = 1;
-                       power_desc[num].fail = 100 - racial_chance(17, A_WIS, 15);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = MUT1_EAT_MAGIC;
                }
 
@@ -3564,7 +3414,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 6;
                        power_desc[num].cost = 6;
-                       power_desc[num].fail = 100 - racial_chance(6, A_INT, 10);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 10;
                        power_desc[num++].number = MUT1_WEIGH_MAG;
                }
 
@@ -3578,7 +3429,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 12;
                        power_desc[num].cost = 23;
-                       power_desc[num].fail = 100 - racial_chance(12, A_CHR, 15);
+                       power_desc[num].stat = A_CHR;
+                       power_desc[num].fail = 15;
                        power_desc[num++].number = MUT1_STERILITY;
                }
 
@@ -3592,7 +3444,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 10;
                        power_desc[num].cost = 12;
-                       power_desc[num].fail = 100 - racial_chance(10, A_DEX, 14);
+                       power_desc[num].stat = A_DEX;
+                       power_desc[num].fail = 14;
                        power_desc[num++].number = MUT1_PANIC_HIT;
                }
 
@@ -3606,7 +3459,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 7;
                        power_desc[num].cost = 15;
-                       power_desc[num].fail = 100 - racial_chance(7, A_CHR, 8);
+                       power_desc[num].stat = A_CHR;
+                       power_desc[num].fail = 8;
                        power_desc[num++].number = MUT1_DAZZLE;
                }
 
@@ -3620,7 +3474,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 7;
                        power_desc[num].cost = 10;
-                       power_desc[num].fail = 100 - racial_chance(7, A_WIS, 9);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 9;
                        power_desc[num++].number = MUT1_LASER_EYE;
                }
 
@@ -3634,7 +3489,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 17;
                        power_desc[num].cost = 50;
-                       power_desc[num].fail = 100 - racial_chance(17, A_INT, 16);
+                       power_desc[num].stat = A_INT;
+                       power_desc[num].fail = 16;
                        power_desc[num++].number = MUT1_RECALL;
                }
 
@@ -3648,7 +3504,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 25;
                        power_desc[num].cost = 25;
-                       power_desc[num].fail = 100 - racial_chance(25, A_WIS, 18);
+                       power_desc[num].stat = A_WIS;
+                       power_desc[num].fail = 18;
                        power_desc[num++].number = MUT1_BANISH;
                }
 
@@ -3662,7 +3519,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 2;
                        power_desc[num].cost = 2;
-                       power_desc[num].fail = 100 - racial_chance(2, A_CON, 11);
+                       power_desc[num].stat = A_CON;
+                       power_desc[num].fail = 11;
                        power_desc[num++].number = MUT1_COLD_TOUCH;
                }
 
@@ -3676,7 +3534,8 @@ strcpy(power_desc[num].name, "
 
                        power_desc[num].level = 1;
                        power_desc[num].cost = lvl;
-                       power_desc[num].fail = 100 - racial_chance(1, A_STR, 6);
+                       power_desc[num].stat = A_STR;
+                       power_desc[num].fail = 6;
                        /* XXX_XXX_XXX Hack! MUT1_LAUNCHER counts as negative... */
                        power_desc[num++].number = 3;
                }
@@ -3703,9 +3562,9 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
        if (use_menu) screen_save();
         /* Get a spell from the user */
 
-        choice = (always_show_list || use_menu) ? ESCAPE:1;
-        while (!flag)
-        {
+       choice = (always_show_list || use_menu) ? ESCAPE:1;
+       while (!flag)
+       {
                if( choice==ESCAPE ) choice = ' '; 
                else if( !get_com(out_val, &choice, FALSE) )break; 
 
@@ -3718,7 +3577,6 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
                                        screen_load();
                                        energy_use = 0;
                                        return;
-                                       break;
                                }
 
                                case '8':
@@ -3822,7 +3680,9 @@ prt("                            Lv   MP 
                                                        letter = '0' + ctr - 26;
                                                sprintf(dummy, " %c) ",letter);
                                        }
-                                       strcat(dummy, format("%-23.23s %2d %4d %3d%%", power_desc[ctr].name, power_desc[ctr].level, power_desc[ctr].cost, power_desc[ctr].fail));
+                                       strcat(dummy, format("%-23.23s %2d %4d %3d%%",
+                                               power_desc[ctr].name, power_desc[ctr].level, power_desc[ctr].cost,
+                                               100 - racial_chance(&power_desc[ctr])));
                                        prt(dummy, y1, x1);
                                        ctr++;
                                }
@@ -3909,20 +3769,49 @@ prt("                            Lv   MP 
        repeat_push(i);
        } /*if (!repeat_pull(&i) || ...)*/
 #endif /* ALLOW_REPEAT */
-       if (power_desc[i].number < 0)
+       switch (racial_aux(&power_desc[i]))
        {
-               if (!cmd_racial_power_aux(power_desc[i].number)) energy_use = 0;
+       case 1:
+               if (power_desc[i].number < 0)
+                       cast = cmd_racial_power_aux(power_desc[i].number);
+               else
+                       cast = mutation_power_aux(power_desc[i].number);
+               break;
+       case 0:
+               cast = FALSE;
+               break;
+       case -1:
+               cast = TRUE;
+               break;
        }
-       else
+
+       if (cast)
        {
-               mutation_power_aux(power_desc[i].number);
-       }
+               if (racial_cost)
+               {
+                       int actual_racial_cost = racial_cost / 2 + randint1(racial_cost / 2);
 
-       /* Redraw mana and hp */
-       p_ptr->redraw |= (PR_HP | PR_MANA);
+                       /* If mana is not enough, player consumes hit point! */
+                       if (p_ptr->csp < actual_racial_cost)
+                       {
+                               actual_racial_cost -= p_ptr->csp;
+                               p_ptr->csp = 0;
+#ifdef JP
+                               take_hit(DAMAGE_USELIFE, actual_racial_cost, "²áÅ٤ν¸Ãæ", -1);
+#else
+                               take_hit(DAMAGE_USELIFE, actual_racial_cost, "concentrating too hard", -1);
+#endif
+                       }
+                       else p_ptr->csp -= actual_racial_cost;
 
-       /* Window stuff */
-       p_ptr->window |= (PW_PLAYER | PW_SPELL);
+                       /* Redraw mana and hp */
+                       p_ptr->redraw |= (PR_HP | PR_MANA);
+
+                       /* Window stuff */
+                       p_ptr->window |= (PW_PLAYER | PW_SPELL);
+               }
+       }
+       else energy_use = 0;
 
        /* Success */
        return;