OSDN Git Service

no_inate時のマスクの直接指定をRF?_BREATH_MASKに置き換えた. また, 変数
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 3 Jun 2003 22:03:17 +0000 (22:03 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 3 Jun 2003 22:03:17 +0000 (22:03 +0000)
directは常にTRUEで使われ, 成立することのない比較に使われていたので,
directを新たに((x == px) && (y == py))の意味で使うように変更.

src/mspells1.c

index a71395b..667bfe3 100644 (file)
@@ -1242,8 +1242,8 @@ bool make_attack_spell(int m_idx)
        bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
        bool learnable = (seen && maneable && !world_monster);
 
-       /* Assume "projectable" */
-       bool direct = TRUE;
+       /* Check "projectable" */
+       bool direct;
 
        /* Cannot cast spells when confused */
        if (m_ptr->confused)
@@ -1362,7 +1362,12 @@ bool make_attack_spell(int m_idx)
        rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
 
        /* Forbid inate attacks sometimes */
-       if (no_inate) f4 &= 0x500000FF;
+       if (no_inate)
+       {
+               f4 &= ~(RF4_BREATH_MASK);
+               f5 &= ~(RF5_BREATH_MASK);
+               f6 &= ~(RF6_BREATH_MASK);
+       }
 
        if (!p_ptr->csp)
        {
@@ -1510,6 +1515,8 @@ bool make_attack_spell(int m_idx)
                return (TRUE);
        }
 
+       /* Projectable? */
+       direct = ((x == px) && (y == py));
 
        /* Cast the spell. */
        switch (thrown_spell)
@@ -1517,7 +1524,6 @@ bool make_attack_spell(int m_idx)
                /* RF4_SHRIEK */
                case 96+0:
                {
-                       if (!direct) break;
                        disturb(1, 0);
 #ifdef JP
 msg_format("%^s¤¬¤«¤ó¹â¤¤¶âÀÚ¤êÀ¼¤ò¤¢¤²¤¿¡£", m_name);
@@ -1539,7 +1545,7 @@ msg_format("%^s
                /* RF4_DISPEL */
                case 96+2:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
                        if (blind) msg_format("%^s¤¬²¿¤«¤òÎ϶¯¤¯¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -1673,7 +1679,7 @@ else msg_format("%^s
                /* RF4_SHOOT */
                case 96+4:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬´ñ̯¤Ê²»¤òȯ¤·¤¿¡£", m_name);
@@ -2472,8 +2478,7 @@ else msg_format("%^s
                /* RF5_DRAIN_MANA */
                case 128+9:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
                        if (p_ptr->csp)
                        {
@@ -2543,8 +2548,7 @@ msg_format("%^s
                /* RF5_MIND_BLAST */
                case 128+10:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
                        if (!seen)
                        {
@@ -2573,8 +2577,7 @@ msg_format("%^s
                /* RF5_BRAIN_SMASH */
                case 128+11:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
                        if (!seen)
                        {
@@ -2603,8 +2606,7 @@ msg_format("%^s
                /* RF5_CAUSE_1 */
                case 128+12:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2626,8 +2628,7 @@ else msg_format("%^s
                /* RF5_CAUSE_2 */
                case 128+13:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2649,8 +2650,7 @@ else msg_format("%^s
                /* RF5_CAUSE_3 */
                case 128+14:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤òÂçÀ¼¤Ç¶«¤ó¤À¡£", m_name);
@@ -2672,8 +2672,7 @@ else msg_format("%^s
                /* RF5_CAUSE_4 */
                case 128+15:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
@@ -2695,7 +2694,7 @@ else msg_format("%^s
                /* RF5_BO_ACID */
                case 128+16:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2719,7 +2718,7 @@ else msg_format("%^s
                /* RF5_BO_ELEC */
                case 128+17:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2743,7 +2742,7 @@ else msg_format("%^s
                /* RF5_BO_FIRE */
                case 128+18:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2767,7 +2766,7 @@ else msg_format("%^s
                /* RF5_BO_COLD */
                case 128+19:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2813,7 +2812,7 @@ else msg_format("%^s
                /* RF5_BO_NETH */
                case 128+21:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2837,7 +2836,7 @@ else msg_format("%^s
                /* RF5_BO_WATE */
                case 128+22:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2860,7 +2859,7 @@ else msg_format("%^s
                /* RF5_BO_MANA */
                case 128+23:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2883,7 +2882,7 @@ else msg_format("%^s
                /* RF5_BO_PLAS */
                case 128+24:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2906,7 +2905,7 @@ else msg_format("%^s
                /* RF5_BO_ICEE */
                case 128+25:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2930,7 +2929,7 @@ else msg_format("%^s
                /* RF5_MISSILE */
                case 128+26:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -2953,8 +2952,7 @@ else msg_format("%^s
                /* RF5_SCARE */
                case 128+27:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢¶²¤í¤·¤²¤Ê²»¤¬Ê¹¤³¤¨¤¿¡£", m_name);
@@ -2998,8 +2996,7 @@ msg_print("
                /* RF5_BLIND */
                case 128+28:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -3043,8 +3040,7 @@ msg_print("
                /* RF5_CONF */
                case 128+29:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¯¤È¡¢Æ¬¤òǺ¤Þ¤¹²»¤¬¤·¤¿¡£", m_name);
@@ -3088,8 +3084,7 @@ msg_print("
                /* RF5_SLOW */
                case 128+30:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 msg_format("%^s¤¬¤¢¤Ê¤¿¤Î¶ÚÎϤòµÛ¤¤¼è¤í¤¦¤È¤·¤¿¡ª", m_name);
@@ -3127,8 +3122,7 @@ msg_print("
                /* RF5_HOLD */
                case 128+31:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -3209,7 +3203,7 @@ msg_format("%^s
                /* RF6_HAND_DOOM */
                case 160+1:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 msg_format("%^s¤¬ÇËÌǤμê¤òÊü¤Ã¤¿¡ª", m_name);
@@ -3516,9 +3510,8 @@ msg_format("%^s
                        default:
                                if (r_ptr->d_char == 'B')
                                {
-                                       if (!direct) break;
                                        disturb(1, 0);
-                                       if (one_in_(3) || x!=px || y!=py)
+                                       if (one_in_(3) || !direct)
                                        {
 #ifdef JP
                                                msg_format("%^s¤ÏÆÍÁ³»ë³¦¤«¤é¾Ã¤¨¤¿!", m_name);
@@ -3591,8 +3584,7 @@ msg_format("%^s
                /* RF6_TELE_TO */
                case 160+8:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 msg_format("%^s¤¬¤¢¤Ê¤¿¤ò°ú¤­Ìᤷ¤¿¡£", m_name);
@@ -3608,8 +3600,7 @@ msg_format("%^s
                /* RF6_TELE_AWAY */
                case 160+9:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 msg_format("%^s¤Ë¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤é¤ì¤¿¡£", m_name);
@@ -3627,8 +3618,7 @@ msg_format("%^s
                /* RF6_TELE_LEVEL */
                case 160+10:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«´ñ̯¤Ê¸ÀÍÕ¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -3672,7 +3662,7 @@ msg_print("
                /* RF6_PSY_SPEAR */
                case 160+11:
                {
-                       if (x!=px || y!=py) return (FALSE);
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -3694,8 +3684,7 @@ else msg_format("%^s
                /* RF6_DARKNESS */
                case 160+12:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", m_name);
@@ -3723,7 +3712,6 @@ else msg_format("%^s
                /* RF6_TRAPS */
                case 160+13:
                {
-                       if (!direct) break;
                        disturb(1, 0);
 #ifdef JP
 if (blind) msg_format("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤Æ¼Ù°­¤ËÈù¾Ð¤ó¤À¡£", m_name);
@@ -3745,8 +3733,7 @@ else msg_format("%^s
                /* RF6_FORGET */
                case 160+14:
                {
-                       if (x!=px || y!=py) return (FALSE);
-                       if (!direct) break;
+                       if (!direct) return (FALSE);
                        disturb(1, 0);
 #ifdef JP
 msg_format("%^s¤¬¤¢¤Ê¤¿¤Îµ­²±¤ò¾Ãµî¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", m_name);