OSDN Git Service

Add new option -- show_ammo_detail / show_ammo_no_crit
[hengband/hengband.git] / src / racial.c
index 7705512..c129db9 100644 (file)
@@ -134,6 +134,8 @@ static bool do_cmd_archer(void)
                }
                else
                {
+                       s16b slot;
+
                        /* Get local object */
                        q_ptr = &forge;
 
@@ -145,7 +147,7 @@ static bool do_cmd_archer(void)
                        apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
                        q_ptr->discount = 99;
 
-                       (void)inven_carry(q_ptr);
+                       slot = inven_carry(q_ptr);
 
                        object_desc(o_name, q_ptr, 0);
 #ifdef JP
@@ -154,6 +156,9 @@ static bool do_cmd_archer(void)
                        msg_print("You make some ammo.");
 #endif
 
+                       /* Auto-inscription */
+                       if (slot >= 0) autopick_alter_item(slot, FALSE);
+
                        /* Destroy the wall */
                        cave_alter_feat(y, x, FF_HURT_ROCK);
 
@@ -164,8 +169,8 @@ static bool do_cmd_archer(void)
        else if (ext == 2)
        {
                int item;
-
                cptr q, s;
+               s16b slot;
 
                item_tester_hook = item_tester_hook_convertible;
 
@@ -189,7 +194,7 @@ static bool do_cmd_archer(void)
                else
                {
                        q_ptr = &o_list[0 - item];
-               }       
+               }
 
                /* Get local object */
                q_ptr = &forge;
@@ -222,14 +227,18 @@ static bool do_cmd_archer(void)
                        floor_item_describe(0 - item);
                        floor_item_optimize(0 - item);
                }
-               (void)inven_carry(q_ptr);
+
+               slot = inven_carry(q_ptr);
+
+               /* Auto-inscription */
+               if (slot >= 0) autopick_alter_item(slot, FALSE);
        }
        /**********Create bolts*********/
        else if (ext == 3)
        {
                int item;
-
                cptr q, s;
+               s16b slot;
 
                item_tester_hook = item_tester_hook_convertible;
 
@@ -287,7 +296,10 @@ static bool do_cmd_archer(void)
                        floor_item_optimize(0 - item);
                }
 
-               (void)inven_carry(q_ptr);
+               slot = inven_carry(q_ptr);
+
+               /* Auto-inscription */
+               if (slot >= 0) autopick_alter_item(slot, FALSE);
        }
        return TRUE;
 }
@@ -419,6 +431,41 @@ s = "
 }
 
 
+static bool can_do_cmd_cast(void)
+{
+       if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
+       {
+#ifdef JP
+               msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
+#else
+               msg_print("The dungeon absorbs all attempted magic!");
+#endif
+               msg_print(NULL);
+               return FALSE;
+       }
+       else if (p_ptr->anti_magic)
+       {
+#ifdef JP
+               msg_print("È¿ËâË¡¥Ð¥ê¥¢¤¬ËâË¡¤ò¼ÙË⤷¤¿¡ª");
+#else
+               msg_print("An anti-magic shell disrupts your magic!");
+#endif
+               return FALSE;
+       }
+       else if (p_ptr->shero)
+       {
+#ifdef JP
+               msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
+#else
+               msg_format("You cannot think directly!");
+#endif
+               return FALSE;
+       }
+       else
+               return TRUE;
+}
+
+
 static bool choose_kamae(void)
 {
        char choice;
@@ -470,7 +517,7 @@ static bool choose_kamae(void)
                        screen_load();
                        return FALSE;
                }
-               else if ((choice == 'a') || (choice == 'A') || (choice == ESCAPE))
+               else if ((choice == 'a') || (choice == 'A'))
                {
                        if (p_ptr->action == ACTION_KAMAE)
                        {
@@ -608,7 +655,7 @@ static bool choose_kata(void)
                        screen_load();
                        return FALSE;
                }
-               else if ((choice == 'a') || (choice == 'A') || (choice == ESCAPE))
+               else if ((choice == 'a') || (choice == 'A'))
                {
                        if (p_ptr->action == ACTION_KATA)
                        {
@@ -835,6 +882,14 @@ static int racial_aux(power_desc_type *pd_ptr)
 }
 
 
+
+void ratial_stop_mouth()
+{
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any()) stop_hex_spell_all();
+}
+
+
 static bool cmd_racial_power_aux(s32b command)
 {
        s16b        plev = p_ptr->lev;
@@ -870,8 +925,15 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        break;
                }
-               case CLASS_MAGE:
                case CLASS_HIGH_MAGE:
+               if (p_ptr->realm1 == REALM_HEX)
+               {
+                       bool retval = stop_hex_spell();
+                       if (retval) energy_use = 10;
+                       return (retval);
+               }
+               case CLASS_MAGE:
+               /* case CLASS_HIGH_MAGE: */
                case CLASS_SORCERER:
                {
                        if (!eat_magic(p_ptr->lev * 2)) return FALSE;
@@ -922,6 +984,7 @@ static bool cmd_racial_power_aux(s32b command)
                        break;
                }
                case CLASS_RANGER:
+               case CLASS_SNIPER:
                {
 #ifdef JP
                        msg_print("Ũ¤òÄ´ºº¤·¤¿...");
@@ -991,7 +1054,7 @@ static bool cmd_racial_power_aux(s32b command)
 #else
                        msg_print("You glare nearby monsters...");
 #endif
-                       slow_monsters();
+                       slow_monsters(p_ptr->lev);
                        stun_monsters(p_ptr->lev * 4);
                        confuse_monsters(p_ptr->lev * 4);
                        turn_monsters(p_ptr->lev * 4);
@@ -1021,10 +1084,8 @@ static bool cmd_racial_power_aux(s32b command)
 
                        if (command == -3)
                        {
-                               if (choose_kamae()) energy_use = 100;
-                               else energy_use = 0;
+                               if (!choose_kamae()) return FALSE;
                                p_ptr->update |= (PU_BONUS);
-                               p_ptr->redraw |= (PR_ARMOR);
                        }
                        else if (command == -4)
                        {
@@ -1133,7 +1194,12 @@ static bool cmd_racial_power_aux(s32b command)
                }
                case CLASS_MAGIC_EATER:
                {
-                       if (!gain_magic()) return FALSE;
+                       if (command == -3) {
+                               if (!gain_magic()) return FALSE;
+                       } else if (command == -4) {
+                               if (!can_do_cmd_cast()) return FALSE;
+                               if (!do_cmd_magic_eater(FALSE, TRUE)) return FALSE;
+                       }
                        break;
                }
                case CLASS_BARD:
@@ -1147,10 +1213,11 @@ static bool cmd_racial_power_aux(s32b command)
                }
                case CLASS_RED_MAGE:
                {
+                       if (!can_do_cmd_cast()) return FALSE;
                        handle_stuff();
                        do_cmd_cast();
                        handle_stuff();
-                       if (!p_ptr->paralyzed)
+                       if (!p_ptr->paralyzed && can_do_cmd_cast())
                                do_cmd_cast();
                        break;
                }
@@ -1205,10 +1272,8 @@ static bool cmd_racial_power_aux(s32b command)
 #endif
                                        return FALSE;
                                }
-                               if (choose_kata()) energy_use = 100;
-                               else energy_use = 0;
+                               if (!choose_kata()) return FALSE;
                                p_ptr->update |= (PU_BONUS);
-                               p_ptr->redraw |= (PR_ARMOR);
                        }
                        break;
                }
@@ -1347,11 +1412,35 @@ static bool cmd_racial_power_aux(s32b command)
                }
                case CLASS_NINJA:
                {
-                       if (p_ptr->action == ACTION_HAYAGAKE) set_action(ACTION_NONE);
-                       else set_action(ACTION_HAYAGAKE);
+                       if (p_ptr->action == ACTION_HAYAGAKE)
+                       {
+                               set_action(ACTION_NONE);
+                       }
+                       else
+                       {
+                               cave_type *c_ptr = &cave[py][px];
+                               feature_type *f_ptr = &f_info[c_ptr->feat];
+
+                               if (!have_flag(f_ptr->flags, FF_PROJECT) ||
+                                   (!p_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
+                               {
+#ifdef JP
+                                       msg_print("¤³¤³¤Ç¤ÏÁÇÁ᤯ư¤±¤Ê¤¤¡£");
+#else
+                                       msg_print("You cannot run in here.");
+#endif
+                               }
+                               else
+                               {
+                                       set_action(ACTION_HAYAGAKE);
+                               }
+                       }
+
+
                        energy_use = 0;
                        break;
                }
+
                }
        }
        else if (p_ptr->mimic_form)
@@ -1363,7 +1452,7 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
                        if (!get_aim_dir(&dir)) return FALSE;
-                       if (music_singing_any()) stop_singing();
+                       ratial_stop_mouth();
 #ifdef JP
                        msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
 #else
@@ -1394,7 +1483,7 @@ static bool cmd_racial_power_aux(s32b command)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
-                               if (music_singing_any()) stop_singing();
+                               ratial_stop_mouth();
 
                                if (!c_ptr->m_idx)
                                {
@@ -1575,7 +1664,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_HALF_GIANT:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       (void)wall_to_mud(dir);
+                       (void)wall_to_mud(dir, 20 + randint1(30));
                        break;
 
                case RACE_HALF_TITAN:
@@ -1601,7 +1690,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_YEEK:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       if (music_singing_any()) stop_singing();
+                       ratial_stop_mouth();
 #ifdef JP
                        msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¶«¤ÓÀ¼¤ò¾å¤²¤¿¡ª");
 #else
@@ -1613,7 +1702,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_KLACKON:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       if (music_singing_any()) stop_singing();
+                       ratial_stop_mouth();
 #ifdef JP
                        msg_print("»À¤òÅǤ¤¤¿¡£");
 #else
@@ -1854,7 +1943,7 @@ static bool cmd_racial_power_aux(s32b command)
                                        }
                                }
 
-                               if (music_singing_any()) stop_singing();
+                               ratial_stop_mouth();
 
 #ifdef JP
                                msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", Type_desc);
@@ -1938,7 +2027,7 @@ static bool cmd_racial_power_aux(s32b command)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
-                               if (music_singing_any()) stop_singing();
+                               ratial_stop_mouth();
 
                                if (!c_ptr->m_idx)
                                {
@@ -1990,7 +2079,7 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_SPECTRE:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       if (music_singing_any()) stop_singing();
+                       ratial_stop_mouth();
 #ifdef JP
                        msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤¶«¤ÓÀ¼¤ò¤¢¤²¤¿¡ª");
 #else
@@ -2008,14 +2097,14 @@ static bool cmd_racial_power_aux(s32b command)
 #endif
 
                        if (plev < 25) sleep_monsters_touch();
-                       else (void)sleep_monsters();
+                       else (void)sleep_monsters(plev);
                        break;
 
                case RACE_DEMON:
                        {
                                int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
                                if (!get_aim_dir(&dir)) return FALSE;
-                               if (music_singing_any()) stop_singing();
+                               ratial_stop_mouth();
 #ifdef JP
                                msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
 #else
@@ -2026,7 +2115,7 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        break;
 
-               case RACE_KUTA:
+               case RACE_KUTAR:
                        (void)set_tsubureru(randint1(20) + 30, FALSE);
                        break;
 
@@ -2151,8 +2240,23 @@ strcpy(power_desc[num].name, "
                power_desc[num++].number = -3;
                break;
        }
-       case CLASS_MAGE:
        case CLASS_HIGH_MAGE:
+       if (p_ptr->realm1 == REALM_HEX)
+       {
+#ifdef JP
+               strcpy(power_desc[num].name, "±Ó¾§¤ò¤ä¤á¤ë");
+#else
+               strcpy(power_desc[num].name, "Stop spelling");
+#endif
+               power_desc[num].level = 1;
+               power_desc[num].cost = 0;
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 0;
+               power_desc[num++].number = -3;
+               break;
+       }
+       case CLASS_MAGE:
+       /* case CLASS_HIGH_MAGE: */
        case CLASS_SORCERER:
        {
 #ifdef JP
@@ -2216,6 +2320,7 @@ strcpy(power_desc[num].name, "
                break;
        }
        case CLASS_RANGER:
+       case CLASS_SNIPER:
        {
 #ifdef JP
 strcpy(power_desc[num].name, "¥â¥ó¥¹¥¿¡¼Ä´ºº");
@@ -2440,6 +2545,13 @@ strcpy(power_desc[num].name, "
                power_desc[num].stat = A_INT;
                power_desc[num].fail = 0;
                power_desc[num++].number = -3;
+
+               strcpy(power_desc[num].name, _("¶¯ÎÏȯư", "Powerful Activation"));
+               power_desc[num].level = 10;
+               power_desc[num].cost = 10 + (lvl - 10) / 2;
+               power_desc[num].stat = A_INT;
+               power_desc[num].fail = 0;
+               power_desc[num++].number = -4;
                break;
        }
        case CLASS_BARD:
@@ -2982,7 +3094,7 @@ sprintf(power_desc[num].name, "
                        power_desc[num].fail = 20;
                        power_desc[num++].number = -1;
                        break;
-               case RACE_KUTA:
+               case RACE_KUTAR:
 #ifdef JP
 strcpy(power_desc[num].name, "²£¤Ë¿­¤Ó¤ë");
 #else