Beispiel #1
0
/**
 * Place an up/down staircase at given location
 */
void place_random_stairs(int y, int x)
{
    /* Paranoia */
    if (!cave_clean_bold(y, x))
	return;

    /* Choose a staircase */
    if (!p_ptr->depth) {
	place_down_stairs(y, x);
    } else if (OPT(adult_dungeon) && !stage_map[p_ptr->stage][DOWN]) {
	place_up_stairs(y, x);
    } else if (randint0(100) < 50) {
	place_down_stairs(y, x);
    } else {
	place_up_stairs(y, x);
    }
}
Beispiel #2
0
/*
 * Place an up/down staircase at given location
 */
void place_random_stairs(int y, int x)
{
    bool up_stairs = TRUE;
    bool down_stairs = TRUE;
    cave_type *c_ptr;

    /* Paranoia */
    c_ptr = &cave[y][x];
    if (!is_floor_grid(c_ptr) || c_ptr->o_idx) return;

    /* Town */
    if (!dun_level)
        up_stairs = FALSE;

    /* Ironman */
    if (ironman_downward)
        up_stairs = FALSE;

    /* Bottom */
    if (dun_level >= d_info[dungeon_type].maxdepth)
        down_stairs = FALSE;

    /* Quest-level */
    if (quest_number(dun_level) && (dun_level > 1))
        down_stairs = FALSE;

    /* We can't place both */
    if (down_stairs && up_stairs)
    {
        /* Choose a staircase randomly */
        if (randint0(100) < 50)
            up_stairs = FALSE;
        else
            down_stairs = FALSE;
    }

    /* Place the stairs */
    if (up_stairs)
        place_up_stairs(y, x);
    else if (down_stairs)
        place_down_stairs(y, x);
}