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))));
#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:
int cu, cv;
bool probe = FALSE;
char buf[256];
- char *align;
+ cptr align;
cu = Term->scr->cu;
cv = Term->scr->cv;
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);
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);
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))
/*
+ * 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];
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;
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);
+}
+
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++)
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 */
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++)
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 */