OSDN Git Service

超能力者の超能力や鏡使いの鏡魔法に失敗して "制御できない力の氾流" が
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 26 May 2004 19:55:15 +0000 (19:55 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 26 May 2004 19:55:15 +0000 (19:55 +0000)
発生してそれが死因となる場合, 死因が表示されなかったり変愚蛮怒が落ち
たりするバグを修正. project()に渡す特殊IDを用意して解決した.

src/defines.h
src/mind.c
src/spells1.c

index 3a004e7..bf1f15a 100644 (file)
 #define PROJECT_FAST        0x4000
 #define PROJECT_LOS         0x8000
 
+
+/*
+ * Special caster ID for project()
+ */
+#define PROJECT_WHO_UNCTRL_POWER -1
+
+
 /*
  * Bit flags for the "enchant()" function
  */
index 5f0a98d..9783e00 100644 (file)
@@ -2012,7 +2012,7 @@ msg_format("%s
                                        msg_print("Your mind unleashes its power in an uncontrollable storm!");
 #endif
 
-                                       project(1, 2 + plev / 10, py, px, plev * 2,
+                                       project(PROJECT_WHO_UNCTRL_POWER, 2 + plev / 10, py, px, plev * 2,
                                                GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
                                        p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
                                }
@@ -2050,7 +2050,7 @@ msg_format("%s
                                        msg_print("Your mind unleashes its power in an uncontrollable storm!");
 #endif
 
-                                       project(1, 2 + plev / 10, py, px, plev * 2,
+                                       project(PROJECT_WHO_UNCTRL_POWER, 2 + plev / 10, py, px, plev * 2,
                                                GF_MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM, -1);
                                        p_ptr->csp = MAX(0, p_ptr->csp - plev * MAX(1, plev / 10));
                                }
index f0a87d9..473af57 100644 (file)
@@ -6348,18 +6348,26 @@ static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int
 
 
                /* Choose 'new' target */
-               do
+               if (who > 0)
                {
-                       t_y = m_list[who].fy - 1 + randint1(3);
-                       t_x = m_list[who].fx - 1 + randint1(3);
-                       max_attempts--;
-               }
-               while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
+                       do
+                       {
+                               t_y = m_list[who].fy - 1 + randint1(3);
+                               t_x = m_list[who].fx - 1 + randint1(3);
+                               max_attempts--;
+                       }
+                       while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
 
-               if (max_attempts < 1)
+                       if (max_attempts < 1)
+                       {
+                               t_y = m_list[who].fy;
+                               t_x = m_list[who].fx;
+                       }
+               }
+               else
                {
-                       t_y = m_list[who].fy;
-                       t_x = m_list[who].fx;
+                       t_y = py - 1 + randint1(3);
+                       t_x = px - 1 + randint1(3);
                }
 
                project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
@@ -6393,13 +6401,29 @@ static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int
                /* Get the monster's real name (gotten before polymorph!) */
                strcpy(killer, who_name);
        }
-       else if (who < 0)
+       else
        {
+               switch (who)
+               {
+               case PROJECT_WHO_UNCTRL_POWER:
 #ifdef JP
-               strcpy(killer, "æ«");
+                       strcpy(killer, "À©¸æ¤Ç¤­¤Ê¤¤ÎϤÎÈÅή");
 #else
-               strcpy(killer, "a trap");
+                       strcpy(killer, "uncontrollable power storm");
 #endif
+                       break;
+
+               default:
+#ifdef JP
+                       strcpy(killer, "æ«");
+#else
+                       strcpy(killer, "a trap");
+#endif
+                       break;
+               }
+
+               /* Paranoia */
+               strcpy(m_name, killer);
        }
 
        /* Analyze the damage */
@@ -7600,7 +7624,7 @@ if (fuzzy) msg_print("
                }
        }
 
-       if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
+       if (p_ptr->tim_eyeeye && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
        {
 #ifdef JP
                msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);