/* ### sp_lev.c ### */
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
-E void FDECL(flip_level_rnd, (int));
+E void FDECL(flip_level_rnd, (int, BOOLEAN_P));
E boolean FDECL(check_room, (xchar *, xchar *, xchar *, xchar *, BOOLEAN_P));
E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
XCHAR_P, XCHAR_P, XCHAR_P));
}
/* #wizlevelflip - randomly flip the current level.
- Does not handle vision, player position, monst mtrack, levregions,
+ Does not handle vision, monst mtrack, levregions,
as flipping is normally done only during level creation.
*/
static int
wiz_level_flip(VOID_ARGS)
{
- if (wizard) flip_level_rnd(3);
+ if (wizard) flip_level_rnd(3, TRUE);
return 0;
}
static void NDECL(solidify_map);
static void FDECL(lvlfill_maze_grid, (int, int, int, int, SCHAR_P));
static void FDECL(lvlfill_solid, (SCHAR_P, SCHAR_P));
+static void FDECL(flip_drawbridge_horizontal, (struct rm *));
+static void FDECL(flip_drawbridge_vertical, (struct rm *));
+static int FDECL(flip_encoded_direction_bits, (int, int));
+static void FDECL(flip_level, (int, BOOLEAN_P));
static void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
int));
static void NDECL(count_features);
}
}
-void
+static void
flip_drawbridge_horizontal(lev)
struct rm *lev;
{
}
}
-void
+static void
flip_drawbridge_vertical(lev)
struct rm *lev;
{
}
}
-int
+static int
flip_encoded_direction_bits(int flp, int val)
{
/* These depend on xdir[] and ydir[] order */
#define FlipX(val) ((maxx - (val)) + minx)
#define FlipY(val) ((maxy - (val)) + miny)
-void
-flip_level(int flp)
+static void
+flip_level(flp, extras)
+int flp;
+boolean extras;
{
int x, y, i;
int minx, miny, maxx, maxy;
}
}
+ if (extras) {
+ if (flp & 1) u.uy = FlipY(u.uy);
+ if (flp & 2) u.ux = FlipX(u.ux);
+ }
+
fix_wall_spines(1, 0, COLNO-1, ROWNO-1);
vision_reset();
#undef FlipY
void
-flip_level_rnd(int flp)
+flip_level_rnd(flp, extras)
+int flp;
+boolean extras;
{
int c = 0;
if ((flp & 1) && rn2(2)) c |= 1;
if ((flp & 2) && rn2(2)) c |= 2;
- if (c) flip_level(c);
+ if (c) flip_level(c, extras);
}
if (!g.level.flags.corrmaze)
wallification(1, 0, COLNO - 1, ROWNO - 1);
- flip_level_rnd(g.coder->allow_flips);
+ flip_level_rnd(g.coder->allow_flips, FALSE);
count_features();