OSDN Git Service

プレイヤーの周囲にアイテムを置けない状況でアーティファクトを落とした
[hengband/hengband.git] / src / racial.c
index 611ae5e..8a35d35 100644 (file)
@@ -114,7 +114,25 @@ static bool do_cmd_archer(void)
                y = py + ddy[dir];
                x = px + ddx[dir];
                c_ptr = &cave[y][x];
-               if (c_ptr->feat == FEAT_RUBBLE)
+
+               if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_CAN_DIG))
+               {
+#ifdef JP
+                       msg_print("¤½¤³¤Ë¤Ï´äÀФ¬¤Ê¤¤¡£");
+#else
+                       msg_print("You need pile of rubble.");
+#endif
+                       return FALSE;
+               }
+               else if (!cave_have_flag_grid(c_ptr, FF_CAN_DIG) || !cave_have_flag_grid(c_ptr, FF_HURT_ROCK))
+               {
+#ifdef JP
+                       msg_print("¹Å¤¹¤®¤ÆÊø¤»¤Ê¤«¤Ã¤¿¡£");
+#else
+                       msg_print("You failed to make ammo.");
+#endif
+               }
+               else
                {
                        /* Get local object */
                        q_ptr = &forge;
@@ -129,24 +147,17 @@ static bool do_cmd_archer(void)
 
                        (void)inven_carry(q_ptr);
 
-                       object_desc(o_name, q_ptr, TRUE, 2);
+                       object_desc(o_name, q_ptr, 0);
 #ifdef JP
-                       msg_format("´äÀФòºï¤Ã¤Æ%s¤òºî¤Ã¤¿¡£",o_name);
+                       msg_format("%s¤òºî¤Ã¤¿¡£", o_name);
 #else
                        msg_print("You make some ammo.");
 #endif
 
-                       (void)wall_to_mud(dir);
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
-                       p_ptr->window |= (PW_OVERHEAD);
-               }
-               else
-               {
-#ifdef JP
-                       msg_print("¤½¤³¤Ë¤Ï´äÀФ¬¤Ê¤¤¡£");
-#else
-                       msg_print("You need pile of rubble.");
-#endif
+                       /* Destroy the wall */
+                       cave_alter_feat(y, x, FF_HURT_ROCK);
+
+                       p_ptr->update |= (PU_FLOW);
                }
        }
        /**********Create arrows*********/
@@ -192,7 +203,7 @@ static bool do_cmd_archer(void)
 
                q_ptr->discount = 99;
 
-               object_desc(o_name, q_ptr, TRUE, 2);
+               object_desc(o_name, q_ptr, 0);
 #ifdef JP
                msg_format("%s¤òºî¤Ã¤¿¡£", o_name);
 #else
@@ -256,7 +267,7 @@ static bool do_cmd_archer(void)
 
                q_ptr->discount = 99;
 
-               object_desc(o_name, q_ptr, TRUE, 2);
+               object_desc(o_name, q_ptr, 0);
 #ifdef JP
                msg_format("%s¤òºî¤Ã¤¿¡£", o_name);
 #else
@@ -327,7 +338,7 @@ s = "
        }
 
 
-       if (!object_known_p(o_ptr))
+       if (!object_is_known(o_ptr))
        {
 #ifdef JP
                msg_print("´ÕÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¼è¤ê¹þ¤á¤Ê¤¤¡£");
@@ -380,7 +391,7 @@ s = "
                }
        }
 
-       object_desc(o_name, o_ptr, TRUE, 3);
+       object_desc(o_name, o_ptr, 0);
        /* Message */
 #ifdef JP
        msg_format("%s¤ÎËâÎϤò¼è¤ê¹þ¤ó¤À¡£", o_name);
@@ -459,7 +470,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)
                        {
@@ -597,7 +608,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)
                        {
@@ -896,7 +907,7 @@ static bool cmd_racial_power_aux(s32b command)
 #else
                                        msg_print("You are failed to run away.");
 #endif
-                               else teleport_player(30);
+                               else teleport_player(30, 0L);
                        }
                        else
                        {
@@ -989,7 +1000,7 @@ static bool cmd_racial_power_aux(s32b command)
                }
                case CLASS_MONK:
                {
-                       if (empty_hands(TRUE) < 2)
+                       if (!(empty_hands(TRUE) & EMPTY_HAND_RARM))
                        {
 #ifdef JP
                                msg_print("ÁǼꤸ¤ã¤Ê¤¤¤È¤Ç¤­¤Þ¤»¤ó¡£");
@@ -998,13 +1009,20 @@ static bool cmd_racial_power_aux(s32b command)
 #endif
                                return FALSE;
                        }
+                       if (p_ptr->riding)
+                       {
+#ifdef JP
+                               msg_print("¾èÇÏÃæ¤Ï¤Ç¤­¤Þ¤»¤ó¡£");
+#else
+                               msg_print("You need to get off a pet.");
+#endif
+                               return FALSE;
+                       }
 
                        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)
                        {
@@ -1176,7 +1194,7 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        else if (command == -4)
                        {
-                               if (!buki_motteruka(INVEN_RARM))
+                               if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
                                {
 #ifdef JP
                                        msg_print("Éð´ï¤ò»ý¤¿¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£");
@@ -1185,10 +1203,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;
                }
@@ -1282,19 +1298,8 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        if (command == -3)
                        {
-                               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);
-                                               }
-                                       }
-                               }
+                               /* Explode all mirrors */
+                               remove_all_mirrors(TRUE);
                        }
                        else if (command == -4)
                        {
@@ -1354,6 +1359,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();
 #ifdef JP
                        msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
 #else
@@ -1384,6 +1390,8 @@ static bool cmd_racial_power_aux(s32b command)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
+                               if (music_singing_any()) stop_singing();
+
                                if (!c_ptr->m_idx)
                                {
 #ifdef JP
@@ -1480,7 +1488,7 @@ static bool cmd_racial_power_aux(s32b command)
                        msg_print("Blink!");
 #endif
 
-                       teleport_player(10);
+                       teleport_player(10, 0L);
                        break;
 
                case RACE_HALF_ORC:
@@ -1563,12 +1571,6 @@ static bool cmd_racial_power_aux(s32b command)
 
                case RACE_HALF_GIANT:
                        if (!get_aim_dir(&dir)) return FALSE;
-#ifdef JP
-                       msg_print("ÀФÎÊɤò᤭¤Ä¤±¤¿¡£");
-#else
-                       msg_print("You bash at a stone wall.");
-#endif
-
                        (void)wall_to_mud(dir);
                        break;
 
@@ -1595,6 +1597,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();
 #ifdef JP
                        msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¶«¤ÓÀ¼¤ò¾å¤²¤¿¡ª");
 #else
@@ -1606,6 +1609,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();
 #ifdef JP
                        msg_print("»À¤òÅǤ¤¤¿¡£");
 #else
@@ -1846,6 +1850,8 @@ static bool cmd_racial_power_aux(s32b command)
                                        }
                                }
 
+                               if (music_singing_any()) stop_singing();
+
 #ifdef JP
                                msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£", Type_desc);
 #else
@@ -1928,6 +1934,8 @@ static bool cmd_racial_power_aux(s32b command)
                                x = px + ddx[dir];
                                c_ptr = &cave[y][x];
 
+                               if (music_singing_any()) stop_singing();
+
                                if (!c_ptr->m_idx)
                                {
 #ifdef JP
@@ -1978,6 +1986,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();
 #ifdef JP
                        msg_print("¤¢¤Ê¤¿¤Ï¤ª¤É¤í¤ª¤É¤í¤·¤¤¶«¤ÓÀ¼¤ò¤¢¤²¤¿¡ª");
 #else
@@ -2002,6 +2011,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();
 #ifdef JP
                                msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",((type == GF_NETHER) ? "ÃϹö" : "²Ð±ê"));
 #else
@@ -2061,7 +2071,7 @@ static bool cmd_racial_power_aux(s32b command)
 #else
                                msg_print("You fire a rocket.");
 #endif
-                               fire_ball(GF_ROCKET, dir, plev * 5, 2);
+                               fire_rocket(GF_ROCKET, dir, plev * 5, 2);
                        }
                        break;