示例#1
0
/*
 * Builds the arena after it is entered -KMW-
 */
static void build_battle(void)
{
	int yval, y_height, y_depth, xval, x_left, x_right;
	register int i, j;

	yval = SCREEN_HGT / 2;
	xval = SCREEN_WID / 2;
	y_height = yval - 10;
	y_depth = yval + 10;
	x_left = xval - 32;
	x_right = xval + 32;

	for (i = y_height; i <= y_height + 5; i++)
		for (j = x_left; j <= x_right; j++)
		{
			place_extra_perm_bold(i, j);
			cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
		}
	for (i = y_depth; i >= y_depth - 3; i--)
		for (j = x_left; j <= x_right; j++)
		{
			place_extra_perm_bold(i, j);
			cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
		}
	for (j = x_left; j <= x_left + 17; j++)
		for (i = y_height; i <= y_depth; i++)
		{
			place_extra_perm_bold(i, j);
			cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
		}
	for (j = x_right; j >= x_right - 17; j--)
		for (i = y_height; i <= y_depth; i++)
		{
			place_extra_perm_bold(i, j);
			cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
		}

	place_extra_perm_bold(y_height+6, x_left+18);
	cave[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
	place_extra_perm_bold(y_depth-4, x_left+18);
	cave[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
	place_extra_perm_bold(y_height+6, x_right-18);
	cave[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
	place_extra_perm_bold(y_depth-4, x_right-18);
	cave[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);

	for (i = y_height + 1; i <= y_height + 5; i++)
		for (j = x_left + 20 + 2 * (y_height + 5 - i); j <= x_right - 20 - 2 * (y_height + 5 - i); j++)
		{
			cave[i][j].feat = feat_permanent_glass_wall;
		}

	i = y_height + 1;
	j = xval;
	cave[i][j].feat = f_tag_to_index("BUILDING_3");
	cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
	player_place(i, j);
}
/*
 * Builds the arena after it is entered -KMW-
 */
static void build_arena(void)
{
    int yval, y_height, y_depth, xval, x_left, x_right;
    register int i, j;

    yval = SCREEN_HGT / 2;
    xval = SCREEN_WID / 2;
    y_height = yval - 10;
    y_depth = yval + 10;
    x_left = xval - 32;
    x_right = xval + 32;

    for (i = y_height; i <= y_height + 5; i++)
        for (j = x_left; j <= x_right; j++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
        }
    for (i = y_depth; i >= y_depth - 5; i--)
        for (j = x_left; j <= x_right; j++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
        }
    for (j = x_left; j <= x_left + 17; j++)
        for (i = y_height; i <= y_depth; i++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
        }
    for (j = x_right; j >= x_right - 17; j--)
        for (i = y_height; i <= y_depth; i++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
        }

    place_extra_perm_bold(y_height+6, x_left+18);
    cave[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
    place_extra_perm_bold(y_depth-6, x_left+18);
    cave[y_depth-6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
    place_extra_perm_bold(y_height+6, x_right-18);
    cave[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
    place_extra_perm_bold(y_depth-6, x_right-18);
    cave[y_depth-6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);

    i = y_height + 5;
    j = xval;
    cave[i][j].feat = f_tag_to_index("ARENA_GATE");
    cave[i][j].info |= (CAVE_GLOW | CAVE_MARK | CAVE_AWARE);
    player_place(i, j);
}
/*
 * Builds the arena after it is entered -KMW-
 */
static void build_battle(void)
{
    int yval, y_height, y_depth, xval, x_left, x_right;
    register int i, j;

    yval = SCREEN_HGT / 2;
    xval = SCREEN_WID / 2;
    y_height = yval - 10;
    y_depth = yval + 10;
    x_left = xval - 32;
    x_right = xval + 32;

    /* Hack: Move the arena down 5 lines so that messages do not
       obstruct the battle. Couldn't this be read from a file just
       like vaults/rooms in v_info?*/
    y_height += 5;
    y_depth += 5;
    for (i = 0; i < y_height; i++)
        for (j = x_left; j <= x_right; j++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
        }


    for (i = y_height; i <= y_height + 5; i++)
        for (j = x_left; j <= x_right; j++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
        }
    for (i = y_depth; i >= y_depth - 3; i--)
        for (j = x_left; j <= x_right; j++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
        }
    for (j = x_left; j <= x_left + 17; j++)
        for (i = y_height; i <= y_depth; i++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
        }
    for (j = x_right; j >= x_right - 17; j--)
        for (i = y_height; i <= y_depth; i++)
        {
            place_extra_perm_bold(i, j);
            cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
        }

    place_extra_perm_bold(y_height+6, x_left+18);
    cave[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
    place_extra_perm_bold(y_depth-4, x_left+18);
    cave[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK);
    place_extra_perm_bold(y_height+6, x_right-18);
    cave[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);
    place_extra_perm_bold(y_depth-4, x_right-18);
    cave[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK);

    for (i = y_height + 1; i <= y_height + 5; i++)
        for (j = x_left + 20 + 2 * (y_height + 5 - i); j <= x_right - 20 - 2 * (y_height + 5 - i); j++)
        {
            cave[i][j].feat = feat_permanent_glass_wall;
        }

    i = y_height + 1;
    j = xval;
    cave[i][j].feat = f_tag_to_index("BUILDING_3");
    cave[i][j].info |= (CAVE_GLOW | CAVE_MARK);
    player_place(i, j);
}