OSDN Git Service

大鷲を強化。SPECIALの行動として、「@を掴んで空中から落す(=引き戻し+ダメージ2d8)」
[hengbandforosx/hengbandosx.git] / src / spells2.c
index ca0cc65..cbc0fe1 100644 (file)
@@ -51,7 +51,7 @@ void self_knowledge(void)
 
        strcpy(Dummy, "");
 
-       percent = (int)(((long)player_hp[PY_MAX_LEVEL - 1] * 200L) /
+       percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
                (2 * p_ptr->hitdie +
                ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
 
@@ -2043,24 +2043,6 @@ info[i++] = "
 #endif
 
        }
-       if (p_ptr->special_attack & ATTACK_CONFUSE)
-       {
-#ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÀÖ¤¯µ±¤¤¤Æ¤¤¤ë¡£";
-#else
-               info[i++] = "Your hands are glowing dull red.";
-#endif
-
-       }
-       if (p_ptr->special_attack & ATTACK_CONFUSE)
-       {
-#ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÀÖ¤¯µ±¤¤¤Æ¤¤¤ë¡£";
-#else
-               info[i++] = "Your hands are glowing dull red.";
-#endif
-
-       }
        switch (p_ptr->action)
        {
                case ACTION_SEARCH:
@@ -4976,7 +4958,7 @@ bool probing(void)
        int cu, cv;
        bool    probe = FALSE;
        char buf[256];
-       char *align;
+       cptr align;
 
        cu = Term->scr->cu;
        cv = Term->scr->cv;
@@ -5157,7 +5139,7 @@ bool destroy_area(int y1, int x1, int r, int full)
                        r_ptr = &r_info[m_ptr->r_idx];
 
                        /* Lose room and vault */
-                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_TRAP | CAVE_UNSAFE);
+                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_TRAP | CAVE_UNSAFE | CAVE_IN_MIRROR);
 
                        /* Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW);
@@ -5372,7 +5354,7 @@ bool earthquake(int cy, int cx, int r)
                        c_ptr = &cave[yy][xx];
 
                        /* Lose room and vault */
-                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_TRAP | CAVE_UNSAFE);
+                       c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_TRAP | CAVE_UNSAFE | CAVE_IN_MIRROR );
 
                        /* Lose light and knowledge */
                        c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
@@ -5970,7 +5952,7 @@ static void cave_temp_room_unlite(void)
                c_ptr->info &= ~(CAVE_TEMP);
 
                /* Darken the grid */
-               c_ptr->info &= ~(CAVE_GLOW);
+               if (!(c_ptr->info & CAVE_IN_MIRROR ))c_ptr->info &= ~(CAVE_GLOW);
 
                /* Hack -- Forget "boring" grids */
                if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
@@ -6000,15 +5982,70 @@ static void cave_temp_room_unlite(void)
 
 
 /*
+ * Determine how much contiguous open space this grid is next to
+ */
+static int next_to_open(int cy, int cx)
+{
+       int i;
+
+       int y, x;
+
+       int len = 0;
+       int blen = 0;
+
+       for (i = 0; i < 16; i++)
+       {
+               y = cy + ddy_cdd[i % 8];
+               x = cx + ddx_cdd[i % 8];
+
+               /* Found a wall, break the length */
+               if (!cave_floor_bold(y, x))
+               {
+                       /* Track best length */
+                       if (len > blen)
+                       {
+                               blen = len;
+                       }
+
+                       len = 0;
+               }
+               else
+               {
+                       len++;
+               }
+       }
+
+       return (MAX(len, blen));
+}
+
+
+static int next_to_walls_adj(int cy, int cx)
+{
+       int i;
+
+       int y, x;
+
+       int c = 0;
+
+       for (i = 0; i < 8; i++)
+       {
+               y = cy + ddy_ddd[i];
+               x = cx + ddx_ddd[i];
+
+               if (!cave_floor_bold(y, x)) c++;
+       }
+
+       return c;
+}
+
+
+/*
  * Aux function -- see below
  */
-static void cave_temp_room_aux(int y, int x)
+static void cave_temp_room_aux(int y, int x, bool only_room)
 {
        cave_type *c_ptr;
 
-       /* Verify */
-/*     if (!in_bounds(y, x)) return; */
-
        /* Get the grid */
        c_ptr = &cave[y][x];
 
@@ -6016,7 +6053,30 @@ static void cave_temp_room_aux(int y, int x)
        if (c_ptr->info & (CAVE_TEMP)) return;
 
        /* Do not "leave" the current room */
-       if (!(c_ptr->info & (CAVE_ROOM))) return;
+       if (!(c_ptr->info & (CAVE_ROOM)))
+       {
+               if (only_room) return;
+
+               /* Verify */
+               if (!in_bounds(y, x)) return;
+
+               /* If a wall, exit */
+               if (!cave_floor_bold(y, x)) return;
+
+               /* Do not exceed the maximum spell range */
+               if (distance(py, px, y, x) > MAX_RANGE) return;
+
+               /* Verify this grid */
+               /*
+                * The reason why it is ==6 instead of >5 is that 8 is impossible
+                * due to the check for cave_bold above.
+                * 7 lights dead-end corridors (you need to do this for the
+                * checkboard interesting rooms, so that the boundary is lit
+                * properly.
+                * This leaves only a check for 6 bounding walls!
+                */
+               if ((next_to_walls_adj(y, x) == 6) && (next_to_open(y, x) <= 1)) return;
+       }
 
        /* Paranoia -- verify space */
        if (temp_n == TEMP_MAX) return;
@@ -6030,6 +6090,22 @@ static void cave_temp_room_aux(int y, int x)
        temp_n++;
 }
 
+/*
+ * Aux function -- see below
+ */
+static void cave_temp_lite_room_aux(int y, int x)
+{
+       cave_temp_room_aux(y, x, FALSE);
+}
+
+/*
+ * Aux function -- see below
+ */
+static void cave_temp_unlite_room_aux(int y, int x)
+{
+       cave_temp_room_aux(y, x, TRUE);
+}
+
 
 
 
@@ -6041,7 +6117,7 @@ void lite_room(int y1, int x1)
        int i, x, y;
 
        /* Add the initial grid */
-       cave_temp_room_aux(y1, x1);
+       cave_temp_lite_room_aux(y1, x1);
 
        /* While grids are in the queue, add their neighbors */
        for (i = 0; i < temp_n; i++)
@@ -6052,16 +6128,16 @@ void lite_room(int y1, int x1)
                if (!cave_floor_bold(y, x)) continue;
 
                /* Spread adjacent */
-               cave_temp_room_aux(y + 1, x);
-               cave_temp_room_aux(y - 1, x);
-               cave_temp_room_aux(y, x + 1);
-               cave_temp_room_aux(y, x - 1);
+               cave_temp_lite_room_aux(y + 1, x);
+               cave_temp_lite_room_aux(y - 1, x);
+               cave_temp_lite_room_aux(y, x + 1);
+               cave_temp_lite_room_aux(y, x - 1);
 
                /* Spread diagonal */
-               cave_temp_room_aux(y + 1, x + 1);
-               cave_temp_room_aux(y - 1, x - 1);
-               cave_temp_room_aux(y - 1, x + 1);
-               cave_temp_room_aux(y + 1, x - 1);
+               cave_temp_lite_room_aux(y + 1, x + 1);
+               cave_temp_lite_room_aux(y - 1, x - 1);
+               cave_temp_lite_room_aux(y - 1, x + 1);
+               cave_temp_lite_room_aux(y + 1, x - 1);
        }
 
        /* Now, lite them all up at once */
@@ -6077,7 +6153,7 @@ void unlite_room(int y1, int x1)
        int i, x, y;
 
        /* Add the initial grid */
-       cave_temp_room_aux(y1, x1);
+       cave_temp_unlite_room_aux(y1, x1);
 
        /* Spread, breadth first */
        for (i = 0; i < temp_n; i++)
@@ -6088,16 +6164,16 @@ void unlite_room(int y1, int x1)
                if (!cave_floor_bold(y, x)) continue;
 
                /* Spread adjacent */
-               cave_temp_room_aux(y + 1, x);
-               cave_temp_room_aux(y - 1, x);
-               cave_temp_room_aux(y, x + 1);
-               cave_temp_room_aux(y, x - 1);
+               cave_temp_unlite_room_aux(y + 1, x);
+               cave_temp_unlite_room_aux(y - 1, x);
+               cave_temp_unlite_room_aux(y, x + 1);
+               cave_temp_unlite_room_aux(y, x - 1);
 
                /* Spread diagonal */
-               cave_temp_room_aux(y + 1, x + 1);
-               cave_temp_room_aux(y - 1, x - 1);
-               cave_temp_room_aux(y - 1, x + 1);
-               cave_temp_room_aux(y + 1, x - 1);
+               cave_temp_unlite_room_aux(y + 1, x + 1);
+               cave_temp_unlite_room_aux(y - 1, x - 1);
+               cave_temp_unlite_room_aux(y - 1, x + 1);
+               cave_temp_unlite_room_aux(y + 1, x - 1);
        }
 
        /* Now, darken them all at once */